mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Fix whitespace issues
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user