1
0
Fork 0
mirror of https://github.com/clockfort/GitHub-Backup.git synced 2025-03-09 00:00:03 +01:00

added password authentification in case you're getting rate limited

This commit is contained in:
Steffen Vogel 2013-08-27 15:26:18 +02:00
parent 0014d6a4a3
commit a3507dcfe6

View file

@ -21,10 +21,16 @@ def main():
args.git += "--quiet"
# Make the connection to Github here.
gh = Github()
config = { 'user': args.username }
if (args.password):
config['password'] = args.password
config['login'] = args.username
gh = Github(**config)
# Get all of the given user's repos
user_repos = gh.repos.list(args.username).all()
user_repos = gh.repos.list().all()
for repo in user_repos:
repo.user = gh.users.get(repo.owner.login)
process_repo(repo, args)
@ -43,6 +49,7 @@ def init_parser():
parser.add_argument("-m","--mirror", help="Create a bare mirror", action="store_true")
parser.add_argument("-g","--git", help="Pass extra arguments to git", default="", metavar="ARGS")
parser.add_argument("-s", "--suffix", help="Add suffix to repository directory names", default="")
parser.add_argument("-p", "--password", help="Authenticate with Github API")
return parser