mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-06 00:28:01 +01:00
chore: format python code
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, sys, logging
|
import logging
|
||||||
|
import os
|
||||||
logging.basicConfig(
|
import sys
|
||||||
format='%(asctime)s.%(msecs)03d: %(message)s',
|
|
||||||
datefmt='%Y-%m-%dT%H:%M:%S',
|
|
||||||
level=logging.INFO
|
|
||||||
)
|
|
||||||
|
|
||||||
from github_backup.github_backup import (
|
from github_backup.github_backup import (
|
||||||
backup_account,
|
backup_account,
|
||||||
@@ -20,6 +16,12 @@ from github_backup.github_backup import (
|
|||||||
retrieve_repositories,
|
retrieve_repositories,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logging.basicConfig(
|
||||||
|
format="%(asctime)s.%(msecs)03d: %(message)s",
|
||||||
|
datefmt="%Y-%m-%dT%H:%M:%S",
|
||||||
|
level=logging.INFO,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
@@ -29,7 +31,7 @@ def main():
|
|||||||
|
|
||||||
output_directory = os.path.realpath(args.output_directory)
|
output_directory = os.path.realpath(args.output_directory)
|
||||||
if not os.path.isdir(output_directory):
|
if not os.path.isdir(output_directory):
|
||||||
logger.info('Create output directory {0}'.format(output_directory))
|
logger.info("Create output directory {0}".format(output_directory))
|
||||||
mkdir_p(output_directory)
|
mkdir_p(output_directory)
|
||||||
|
|
||||||
if args.lfs_clone:
|
if args.lfs_clone:
|
||||||
@@ -41,10 +43,10 @@ def main():
|
|||||||
logger.root.setLevel(log_level)
|
logger.root.setLevel(log_level)
|
||||||
|
|
||||||
if not args.as_app:
|
if not args.as_app:
|
||||||
logger.info('Backing up user {0} to {1}'.format(args.user, output_directory))
|
logger.info("Backing up user {0} to {1}".format(args.user, output_directory))
|
||||||
authenticated_user = get_authenticated_user(args)
|
authenticated_user = get_authenticated_user(args)
|
||||||
else:
|
else:
|
||||||
authenticated_user = {'login': None}
|
authenticated_user = {"login": None}
|
||||||
|
|
||||||
repositories = retrieve_repositories(args, authenticated_user)
|
repositories = retrieve_repositories(args, authenticated_user)
|
||||||
repositories = filter_repositories(args, repositories)
|
repositories = filter_repositories(args, repositories)
|
||||||
@@ -52,7 +54,7 @@ def main():
|
|||||||
backup_account(args, output_directory)
|
backup_account(args, output_directory)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user