mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d148f9b900 | ||
|
|
89ee22c2be | ||
|
|
9e472b74e6 | ||
|
|
4b459f9af8 | ||
|
|
b70ea87db7 |
10
CHANGES.rst
10
CHANGES.rst
@@ -1,6 +1,16 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
0.22.0 (2019-02-01)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Remove unnecessary sys.exit call. [W. Harrison Wright]
|
||||||
|
|
||||||
|
- Add org check to avoid incorrect log output. [W. Harrison Wright]
|
||||||
|
|
||||||
|
- Fix accidental system exit with better logging strategy. [W. Harrison
|
||||||
|
Wright]
|
||||||
|
|
||||||
0.21.1 (2018-12-25)
|
0.21.1 (2018-12-25)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
|||||||
@@ -40,16 +40,17 @@ FNULL = open(os.devnull, 'w')
|
|||||||
|
|
||||||
|
|
||||||
def log_error(message):
|
def log_error(message):
|
||||||
if type(message) == str:
|
"""
|
||||||
message = [message]
|
Log message (str) or messages (List[str]) to stderr and exit with status 1
|
||||||
|
"""
|
||||||
for msg in message:
|
log_warning(message)
|
||||||
sys.stderr.write("{0}\n".format(msg))
|
|
||||||
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def log_info(message):
|
def log_info(message):
|
||||||
|
"""
|
||||||
|
Log message (str) or messages (List[str]) to stdout
|
||||||
|
"""
|
||||||
if type(message) == str:
|
if type(message) == str:
|
||||||
message = [message]
|
message = [message]
|
||||||
|
|
||||||
@@ -57,6 +58,17 @@ def log_info(message):
|
|||||||
sys.stdout.write("{0}\n".format(msg))
|
sys.stdout.write("{0}\n".format(msg))
|
||||||
|
|
||||||
|
|
||||||
|
def log_warning(message):
|
||||||
|
"""
|
||||||
|
Log message (str) or messages (List[str]) to stderr
|
||||||
|
"""
|
||||||
|
if type(message) == str:
|
||||||
|
message = [message]
|
||||||
|
|
||||||
|
for msg in message:
|
||||||
|
sys.stderr.write("{0}\n".format(msg))
|
||||||
|
|
||||||
|
|
||||||
def logging_subprocess(popenargs,
|
def logging_subprocess(popenargs,
|
||||||
logger,
|
logger,
|
||||||
stdout_log_level=logging.DEBUG,
|
stdout_log_level=logging.DEBUG,
|
||||||
@@ -513,7 +525,6 @@ def check_git_lfs_install():
|
|||||||
exit_code = subprocess.call(['git', 'lfs', 'version'])
|
exit_code = subprocess.call(['git', 'lfs', 'version'])
|
||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
log_error('The argument --lfs requires you to have Git LFS installed.\nYou can get it from https://git-lfs.github.com.')
|
log_error('The argument --lfs requires you to have Git LFS installed.\nYou can get it from https://git-lfs.github.com.')
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def retrieve_repositories(args, authenticated_user):
|
def retrieve_repositories(args, authenticated_user):
|
||||||
@@ -524,8 +535,8 @@ def retrieve_repositories(args, authenticated_user):
|
|||||||
template = 'https://{0}/user/repos'.format(
|
template = 'https://{0}/user/repos'.format(
|
||||||
get_github_api_host(args))
|
get_github_api_host(args))
|
||||||
else:
|
else:
|
||||||
if args.private:
|
if args.private and not args.organization:
|
||||||
log_error('Authenticated user is different from user being backed up, thus private repositories cannot be accessed')
|
log_warning('Authenticated user is different from user being backed up, thus private repositories cannot be accessed')
|
||||||
template = 'https://{0}/users/{1}/repos'.format(
|
template = 'https://{0}/users/{1}/repos'.format(
|
||||||
get_github_api_host(args),
|
get_github_api_host(args),
|
||||||
args.user)
|
args.user)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = '0.21.1'
|
__version__ = '0.22.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user