Try to make compatible code with direct Python call ; reduce the hard link of the code with the cli

This commit is contained in:
Gallo Feliz
2021-02-16 13:13:51 +01:00
parent 943e84e3d9
commit 480ce3ce2a
2 changed files with 22 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
import os
import os, sys, logging
from github_backup.github_backup import (
backup_account,
@@ -9,11 +9,13 @@ from github_backup.github_backup import (
filter_repositories,
get_authenticated_user,
log_info,
log_warning,
mkdir_p,
parse_args,
retrieve_repositories,
)
logging.basicConfig(format='%(asctime)s.%(msecs)03d: %(message)s', datefmt='%Y-%m-%dT%H:%M:%S')
def main():
args = parse_args()
@@ -39,4 +41,8 @@ def main():
if __name__ == '__main__':
main()
try:
main()
except Exception as e:
log_warning(str(e))
sys.exit(1)