diff options
author | Papoteur <papoteur@mageialinux-online.org> | 2016-11-05 15:38:08 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageialinux-online.org> | 2016-11-05 15:38:08 +0100 |
commit | f372e877cb32a6c009e29ff9ddf1a14f8b2fd216 (patch) | |
tree | be50c72a1a883aa07cad805d44a0cda906285997 /MgaRepo/commands/github.py | |
parent | 8f51e35c875c9cbb4637cbf8796ee66a871ba57f (diff) | |
download | mgarepo-f372e877cb32a6c009e29ff9ddf1a14f8b2fd216.tar mgarepo-f372e877cb32a6c009e29ff9ddf1a14f8b2fd216.tar.gz mgarepo-f372e877cb32a6c009e29ff9ddf1a14f8b2fd216.tar.bz2 mgarepo-f372e877cb32a6c009e29ff9ddf1a14f8b2fd216.tar.xz mgarepo-f372e877cb32a6c009e29ff9ddf1a14f8b2fd216.zip |
Revert to 1.12.3 state
Diffstat (limited to 'MgaRepo/commands/github.py')
-rw-r--r-- | MgaRepo/commands/github.py | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/MgaRepo/commands/github.py b/MgaRepo/commands/github.py deleted file mode 100644 index 7d787e4..0000000 --- a/MgaRepo/commands/github.py +++ /dev/null @@ -1,56 +0,0 @@ -from MgaRepo import Error -from MgaRepo.command import * -from MgaRepo.GitHub import GitHub -import getopt -import sys - -HELP = """\ -Usage: mgarepo github [OPTIONS] URL - -Import a git-svn cloned repository to github - -Options: - -h Show this message - -Examples: - mgarepo github import existingpkg - mgarepo github import svn://svn.mageia.org/svn/packages/cauldron/existingpkg -""" -def github_clone(pkg, **kwargs): - github = GitHub() - github.clone_repository(pkg) - -def github_import(target=".", **kwargs): - github = GitHub() - github.import_package(target) - -def github_delete(pkg, **kwargs): - github = GitHub() - github.delete_repository(pkg) - -def parse_options(): - parser = OptionParser(help=HELP) - opts, args = parser.parse_args() - if len(args) < 1: - raise Error("invalid arguments") - opts.func = globals().get("github_"+args[0], None) - if args[0] == "import": - if len(args) > 1: - opts.target = args[1] - elif args[0] == "delete" or args[0] == "clone": - opts.pkg = args[1] - else: - raise Error("invalid arguments: %s" % str(args)) - return opts - -def dispatch_cmd(*args, **kwargs): - func = kwargs.pop("func", None) - if func: - func(**kwargs) - else: - raise Error("invalid command: %s %s" % (sys.argv[0], sys.argv[1])) - -def main(): - do_command(parse_options, dispatch_cmd) - -# vim:et:ts=4:sw=4 |