-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sourcery refactored master branch #3
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,14 +52,16 @@ def searchMessages( | |
:param fields: | ||
:return: | ||
""" | ||
params = {} | ||
params['userId'] = userId | ||
params['labelIds'] = labelIds | ||
params['q'] = q | ||
params['pageToken'] = pageToken | ||
params['maxResults'] = maxResults | ||
params['includeSpamTrash'] = includeSpamTrash | ||
params['fields'] = fields | ||
params = { | ||
'userId': userId, | ||
'labelIds': labelIds, | ||
'q': q, | ||
'pageToken': pageToken, | ||
'maxResults': maxResults, | ||
'includeSpamTrash': includeSpamTrash, | ||
'fields': fields, | ||
} | ||
|
||
return self.__service.users().messages().list(**params).execute() | ||
|
||
def deleteMessages(self, ids, userId='me'): | ||
|
@@ -72,8 +74,7 @@ def deleteMessages(self, ids, userId='me'): | |
if not isinstance(ids, list): | ||
raise ValueError('Ids should be a list of id') | ||
else: | ||
body = {} | ||
body['ids'] = ids | ||
body = {'ids': ids} | ||
Comment on lines
-75
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
return self.__service.users().messages().batchDelete(userId=userId, body=body).execute() | ||
|
||
def trashMessages(self, messageId, userId='me'): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ def send_mail(me, you, message, subject): | |
you=args.target, | ||
message='Purchase link : https://www.kimsufi.com/fr/commande/kimsufi.xml?reference=' + args.server, | ||
subject=MAIL_SUBJECT.format(args.server)) | ||
logging.info('Done.') | ||
else: | ||
logging.info(args.server + ' not found.') | ||
logging.info('Done.') | ||
|
||
logging.info('Done.') | ||
Comment on lines
-128
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,16 +152,16 @@ def get_last_tag(image_name): | |
# Ask for credentials if not set on cli | ||
ask = input( | ||
'Image {} unknown\nDo you want to try with your DockerHub credentials ? (y/n) '.format(image_name)) | ||
if ask == 'y' or ask == 'Y' or ask == 'yes': | ||
if ask in ['y', 'Y', 'yes']: | ||
DOCKER_HUB_USERNAME = input('Username ? ') | ||
DOCKER_HUB_PASSWORD = input('Password ? ') | ||
else: | ||
return 'undefined (Private repository ?)' | ||
|
||
r = get_request(url, jwt_auth=True, token=get_docker_token()) | ||
if 'results' not in r: | ||
logging.error('Invalid password or username, by pass') | ||
return 'undefined' | ||
if 'results' not in r: | ||
logging.error('Invalid password or username, by pass') | ||
return 'undefined' | ||
Comment on lines
-155
to
+164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
# on each case, return the last tag | ||
for tag in r['results']: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
GmailApp.searchMessages
refactored with the following changes:merge-dict-assign
)