mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
Merge pull request #204 from Assimila/exclude_repositories
Add option to exclude repositories
This commit is contained in:
@@ -41,8 +41,8 @@ CLI Usage is as follows::
|
|||||||
[-P] [-F] [--prefer-ssh] [-v]
|
[-P] [-F] [--prefer-ssh] [-v]
|
||||||
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
[--keychain-name OSX_KEYCHAIN_ITEM_NAME]
|
||||||
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
[--keychain-account OSX_KEYCHAIN_ITEM_ACCOUNT]
|
||||||
[--releases] [--assets] [--throttle-limit THROTTLE_LIMIT]
|
[--releases] [--assets] [--exclude [REPOSITORY [REPOSITORY ...]]
|
||||||
[--throttle-pause THROTTLE_PAUSE]
|
[--throttle-limit THROTTLE_LIMIT] [--throttle-pause THROTTLE_PAUSE]
|
||||||
USER
|
USER
|
||||||
|
|
||||||
Backup a github account
|
Backup a github account
|
||||||
@@ -112,6 +112,8 @@ CLI Usage is as follows::
|
|||||||
binaries
|
binaries
|
||||||
--assets include assets alongside release information; only
|
--assets include assets alongside release information; only
|
||||||
applies if including releases
|
applies if including releases
|
||||||
|
--exclude [REPOSITORY [REPOSITORY ...]]
|
||||||
|
names of repositories to exclude from backup.
|
||||||
--throttle-limit THROTTLE_LIMIT
|
--throttle-limit THROTTLE_LIMIT
|
||||||
start throttling of GitHub API requests after this
|
start throttling of GitHub API requests after this
|
||||||
amount of API requests remain
|
amount of API requests remain
|
||||||
|
|||||||
@@ -328,6 +328,10 @@ def parse_args(args=None):
|
|||||||
type=float,
|
type=float,
|
||||||
default=30.0,
|
default=30.0,
|
||||||
help='wait this amount of seconds when API request throttling is active (default: 30.0, requires --throttle-limit to be set)')
|
help='wait this amount of seconds when API request throttling is active (default: 30.0, requires --throttle-limit to be set)')
|
||||||
|
parser.add_argument('--exclude',
|
||||||
|
dest='exclude',
|
||||||
|
help='names of repositories to exclude',
|
||||||
|
nargs="*")
|
||||||
return parser.parse_args(args)
|
return parser.parse_args(args)
|
||||||
|
|
||||||
|
|
||||||
@@ -753,6 +757,8 @@ def filter_repositories(args, unfiltered_repositories):
|
|||||||
repositories = [r for r in repositories if name_regex.match(r['name'])]
|
repositories = [r for r in repositories if name_regex.match(r['name'])]
|
||||||
if args.skip_archived:
|
if args.skip_archived:
|
||||||
repositories = [r for r in repositories if not r.get('archived')]
|
repositories = [r for r in repositories if not r.get('archived')]
|
||||||
|
if args.exclude:
|
||||||
|
repositories = [r for r in repositories if r['name'] not in args.exclude]
|
||||||
|
|
||||||
return repositories
|
return repositories
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user