@@ -110,6 +110,7 @@ def mkdir_p(*args):
110110 else :
111111 raise
112112
113+
113114def mask_password (url , secret = '*****' ):
114115 parsed = urlparse (url )
115116
@@ -120,6 +121,7 @@ def mask_password(url, secret='*****'):
120121
121122 return url .replace (parsed .password , secret )
122123
124+
123125def parse_args ():
124126 parser = argparse .ArgumentParser (description = 'Backup a github account' )
125127 parser .add_argument ('user' ,
@@ -268,7 +270,7 @@ def get_auth(args, encode=True):
268270 if not auth :
269271 return None
270272
271- if encode == False :
273+ if not encode :
272274 return auth
273275
274276 return base64 .b64encode (auth .encode ('ascii' ))
@@ -291,6 +293,7 @@ def get_github_host(args):
291293
292294 return host
293295
296+
294297def get_github_repo_url (args , repository ):
295298 if args .prefer_ssh :
296299 return repository ['ssh_url' ]
@@ -307,6 +310,7 @@ def get_github_repo_url(args, repository):
307310
308311 return repo_url
309312
313+
310314def retrieve_data (args , template , query_args = None , single_request = False ):
311315 auth = get_auth (args )
312316 query_args = get_query_args (query_args )
@@ -527,6 +531,7 @@ def backup_repositories(args, output_directory, repositories):
527531 if args .incremental :
528532 open (last_update_path , 'w' ).write (last_update )
529533
534+
530535def backup_issues (args , repo_cwd , repository , repos_template ):
531536 has_issues_dir = os .path .isdir ('{0}/issues/.git' .format (repo_cwd ))
532537 if args .skip_existing and has_issues_dir :
@@ -675,7 +680,7 @@ def backup_hooks(args, repo_cwd, repository, repos_template):
675680 hook_cwd = os .path .join (repo_cwd , 'hooks' )
676681 output_file = '{0}/hooks.json' .format (hook_cwd )
677682 template = '{0}/{1}/hooks' .format (repos_template ,
678- repository ['full_name' ])
683+ repository ['full_name' ])
679684 try :
680685 _backup_data (args ,
681686 'hooks' ,
0 commit comments