Fix whitespace issues

This commit is contained in:
Albert Wang
2020-08-15 17:23:44 -07:00
parent 8fd0f2b64f
commit bb2e2b8c6f

View File

@@ -424,7 +424,7 @@ def get_github_repo_url(args, repository):
if args.prefer_ssh: if args.prefer_ssh:
# The git_pull_url value is always https for gists, so we need to transform it to ssh form # The git_pull_url value is always https for gists, so we need to transform it to ssh form
repo_url = re.sub('^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url']) repo_url = re.sub('^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url'])
repo_url = re.sub('^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility repo_url = re.sub('^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility
else: else:
repo_url = repository['git_pull_url'] repo_url = repository['git_pull_url']
return repo_url return repo_url
@@ -497,9 +497,11 @@ def retrieve_data_gen(args, template, query_args=None, single_request=False):
if single_request: if single_request:
break break
def retrieve_data(args, template, query_args=None, single_request=False): def retrieve_data(args, template, query_args=None, single_request=False):
return list(retrieve_data_gen(args, template, query_args, single_request)) return list(retrieve_data_gen(args, template, query_args, single_request))
def get_query_args(query_args=None): def get_query_args(query_args=None):
if not query_args: if not query_args:
query_args = {} query_args = {}
@@ -903,18 +905,22 @@ def backup_pulls(args, repo_cwd, repository, repos_template):
pull_states = ['open', 'closed'] pull_states = ['open', 'closed']
for pull_state in pull_states: for pull_state in pull_states:
query_args['state'] = pull_state query_args['state'] = pull_state
_pulls = retrieve_data_gen(args, _pulls = retrieve_data_gen(
_pulls_template, args,
query_args=query_args) _pulls_template,
query_args=query_args
)
for pull in _pulls: for pull in _pulls:
if args.since and pull['updated_at'] < args.since: if args.since and pull['updated_at'] < args.since:
break break
if not args.since or pull['updated_at'] >= args.since: if not args.since or pull['updated_at'] >= args.since:
pulls[pull['number']] = pull pulls[pull['number']] = pull
else: else:
_pulls = retrieve_data_gen(args, _pulls = retrieve_data_gen(
_pulls_template, args,
query_args=query_args) _pulls_template,
query_args=query_args
)
for pull in _pulls: for pull in _pulls:
if args.since and pull['updated_at'] < args.since: if args.since and pull['updated_at'] < args.since:
break break