Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robota #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Robota #1

wants to merge 4 commits into from

Conversation

Djsouls
Copy link

@Djsouls Djsouls commented Aug 23, 2019

Changing the message that's sent when a new e-mail arrives.

mail.py Outdated
message = 'Shalom Adonai, irmãos. {} novos emails, deem uma olhada.'.format(number_of_new_mails)
else:
message = 'Shalom Adonai, irmãos. Novo email, deem uma olhada.\n\nTítulo: {}\n\nRemetente: {}'.format(subject, sender)
for ss in senders_subjects:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid using abbreviations or simplified names for variables, it's better to be explicit about what we are doing here.
This variable is something related to an old army from europe or it's a abbreviation for sender_object ?

mail.py Outdated
file_reader.close()


latest_email_id = possible_new_email_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can possible_new_email_id be not a new email ? There is not checks that validate such name or latest_email_id. You should aim to rename possible_new_email_id to just new_email_id to simplify logic and names.

@@ -3,6 +3,7 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit messages is not clear, I believe that you want to say:
Changing email script to support multiple emails subjects in inbox or something like.

@@ -25,6 +25,5 @@ def get_sender(self):

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually commit messages are don in an imperative format, take a look in https://chris.beams.io/posts/git-commit/

@@ -11,40 +11,38 @@ def check_gmail():

imap = ImapGmailWrapper(mail, app_password)
imap.select_mail_box('inbox')
possible_new_email_id = int(imap.get_last_email_id('UNSEEN'))
new_email_id = int(imap.get_last_email_id('UNSEEN'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be squashed with 5453374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants