def __init__(self, description, epilog):

        BaseCLI.__init__(self, description, epilog, __version__)
        self.remove_options(['--host', '--config-file'])
        self.parser.add_argument("--catalog",
                                 default=1,
                                 metavar="<1>",
                                 help="Catalog number. Default: 1")
        self.parser.add_argument('host',
                                 default='localhost',
                                 metavar='<host>',
                                 help="Fully qualified host name.")
        self.parser.add_argument('config',
                                 metavar='<config file>',
                                 help="Path to a configuration file.")
        self.parser.add_argument("path",
                                 metavar="<output dir>",
                                 help="Path to an output directory.")
        self.parser.add_argument(
            "kwargs",
            metavar="[key=value key=value ...]",
            nargs=argparse.REMAINDER,
            action=KeyValuePairArgs,
            help=
            "Variable length of whitespace-delimited key=value pair arguments used for "
            "string interpolation in specific parts of the configuration file. "
            "For example: key1=value1 key2=value2")
Exemple #2
0
 def __init__(self, description, epilog, version):
     BaseCLI.__init__(self, description, epilog, version)
     self.remove_options(['--config-file'])
     self.parser.add_argument('--config-file',
                              metavar='<file>',
                              help="Path to a configuration file.",
                              required=True)
     self.parser.add_argument('-s',
                              '--schema',
                              help="schema name",
                              default=None,
                              action='append')
     self.parser.add_argument('-t',
                              '--table',
                              help="table name",
                              default=None,
                              action='append')
     self.parser.add_argument('-n',
                              '--dryrun',
                              help="dryrun",
                              action="store_true")
     self.parser.add_argument('-v',
                              '--verbose',
                              help="verbose",
                              action="store_true")
     self.parser.add_argument('catalog', help="catalog number", type=int)
     self.parser.set_defaults(host=platform.uname()[1])
Exemple #3
0
    def __init__(self, uploader, description, epilog, cookie_persistence=True, window_icon=":/images/upload.png"):

        if not issubclass(uploader, DerivaUpload):
            raise TypeError("DerivaUpload subclass required")

        BaseCLI.__init__(self, description, epilog, uploader.getVersion())
        self.uploader = uploader
        self.cookie_persistence = cookie_persistence
        self.window_icon = window_icon
Exemple #4
0
    def __init__(self, uploader, description, epilog):
        if not issubclass(uploader, DerivaUpload):
            raise TypeError("DerivaUpload subclass required")

        BaseCLI.__init__(self, description, epilog, uploader.getVersion())
        self.remove_options(['--host'])
        self.parser.add_argument('--no-cfg-update', action="store_true", help="Do not update local config from server.")
        self.parser.add_argument("--catalog", default=1, metavar="<1>", help="Catalog number. Default: 1")
        self.parser.add_argument('host', metavar='<host>', help="Fully qualified host name.")
        self.parser.add_argument("path", metavar="<dir>", help="Path to an input directory.")
        self.uploader = uploader
    def __init__(self, uploader, description, epilog):
        if not issubclass(uploader, DerivaUpload):
            raise TypeError("DerivaUpload subclass required")

        BaseCLI.__init__(self, description, epilog, uploader.getVersion(), hostname_required=True)
        self.parser.add_argument('--no-config-update', action="store_true",
                                 help="Do not check for (and download) an updated configuration from the server.")
        self.parser.add_argument('--purge-state', action="store_true",
                                 help="Purge (delete) any existing transfer state files found in the directory "
                                      "hierarchy of the input path.")
        self.parser.add_argument("--catalog", default=1, metavar="<1>", help="Catalog number. Default: 1")
        self.parser.add_argument("path", metavar="<input dir>", help="Path to an input directory.")
        self.uploader = uploader
Exemple #6
0
    def __init__(self, description, epilog, **kwargs):

        BaseCLI.__init__(self, description, epilog, **kwargs)
        self.parser.add_argument("--catalog",
                                 default=1,
                                 metavar="<1>",
                                 help="Catalog number. Default: 1")
        self.parser.add_argument("output_dir",
                                 metavar="<output dir>",
                                 help="Path to an output directory.")
        self.parser.add_argument(
            "envars",
            metavar="[key=value key=value ...]",
            nargs=argparse.REMAINDER,
            action=KeyValuePairArgs,
            default={},
            help=
            "Variable length of whitespace-delimited key=value pair arguments used for "
            "string interpolation in specific parts of the configuration file. "
            "For example: key1=value1 key2=value2")