mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a00bb1903 | ||
|
|
e53f8d4724 | ||
|
|
356f5f674b | ||
|
|
13128635cb | ||
|
|
6e6842b025 | ||
|
|
272177c395 |
@@ -1,9 +1,14 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
0.33.0 (2020-04-13)
|
||||
0.34.0 (2020-07-24)
|
||||
-------------------
|
||||
------------------------
|
||||
- Add logic for transforming gist repository urls to ssh. [Matt Fields]
|
||||
|
||||
|
||||
0.33.0 (2020-04-13)
|
||||
-------------------
|
||||
- Add basic API request throttling. [Enrico Tröger]
|
||||
|
||||
A simple approach to throttle API requests and so keep within the rate
|
||||
|
||||
10
README.rst
10
README.rst
@@ -41,7 +41,8 @@ CLI Usage is as follows::
|
||||
[-P] [-F] [--prefer-ssh] [-v]
|
||||
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
||||
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
||||
[--releases] [--assets]
|
||||
[--releases] [--assets] [--throttle-limit THROTTLE_LIMIT]
|
||||
[--throttle-pause THROTTLE_PAUSE]
|
||||
USER
|
||||
|
||||
Backup a github account
|
||||
@@ -111,6 +112,13 @@ CLI Usage is as follows::
|
||||
binaries
|
||||
--assets include assets alongside release information; only
|
||||
applies if including releases
|
||||
--throttle-limit THROTTLE_LIMIT
|
||||
start throttling of GitHub API requests after this
|
||||
amount of API requests remain
|
||||
--throttle-pause THROTTLE_PAUSE
|
||||
wait this amount of seconds when API request
|
||||
throttling is active (default: 30.0, requires
|
||||
--throttle-limit to be set)
|
||||
|
||||
|
||||
The package can be used to backup an *entire* organization or repository, including issues and wikis in the most appropriate format (clones for wikis, json files for issues).
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = '0.33.0'
|
||||
__version__ = '0.34.0'
|
||||
|
||||
@@ -419,7 +419,13 @@ def get_github_host(args):
|
||||
|
||||
def get_github_repo_url(args, repository):
|
||||
if repository.get('is_gist'):
|
||||
return repository['git_pull_url']
|
||||
if args.prefer_ssh:
|
||||
# The git_pull_url value is always https for gists, so we need to transform it to ssh form
|
||||
repo_url = re.sub('^https?:\/\/(.+)\/(.+)\.git$', r'git@\1:\2.git', repository['git_pull_url'])
|
||||
repo_url = re.sub('^git@gist\.', 'git@', repo_url) # strip gist subdomain for better hostkey compatibility
|
||||
else:
|
||||
repo_url = repository['git_pull_url']
|
||||
return repo_url
|
||||
|
||||
if args.prefer_ssh:
|
||||
return repository['ssh_url']
|
||||
|
||||
Reference in New Issue
Block a user