Ejemplo n.º 1
0
    def get_optspec(Klass, inheritor):
        """
        Return tuples with optparse command-line argument specification.
        """
        p = inheritor.get_prefixer(Klass)
        return (
#                (('-d', '--database'),{ 'metavar':'URI', 'dest':'dbref',
#                    'help': "A URI formatted relational DB access description, as "
#                        "supported by sqlalchemy. Ex:"
#                        " `sqlite:///radical.sqlite`,"
#                        " `mysql://radical-user@localhost/radical`. "
#                        "The default value (%default) may be overwritten by configuration "
#                        "and/or command line option. ",
#                    'default': klass.DEFAULT_DB }),

                # -f PATTERN   Include only matching files.

                p(('-F', '--add-flavour'),{ 'action': 'callback', 'callback': append_comment_scan,
                    'help': "Scan for these comment flavours only, by default all known fla." }),

                p(('--list-flavours',), libcmd.cmddict(inheritor.NAME)),
                p(('--list-scans',), libcmd.cmddict(inheritor.NAME)),
                p(('--info',), libcmd.cmddict(inheritor.NAME)),

                p(('--issue-format',), {
                    'dest': 'issue_format',
                    'action': 'store',
                    'default': 'id',
                    'help': "" }),

                #(('--no-recurse',),{'action':'store_false', 'dest': 'recurse'}),
                #(('-r', '--recurse'),{'action':'store_true', 'default': True,
                #    'help': 'Recurse into directory paths (default: %default)'}),
            )
Ejemplo n.º 2
0
 def get_optspec(klass, inherit):
     """
     Return tuples with optparse command-line argument specification.
     """
     return (
             (('--status',), libcmd.cmddict()),
             (('--update',), libcmd.cmddict()),
         )
Ejemplo n.º 3
0
    def get_optspec(Klass, inheritor):
        p = inheritor.get_prefixer(Klass)
        return (
                p(('--file-info',), libcmd.cmddict(help="Default command. ")),
                p(('--name-and-categorize',), libcmd.cmddict(
                    help="Need either --interactive, or --name, --mediatype and "
                        " --mediaformat. Optionally provide one or more --genre's. "
                )),
                p(('--stats',), libcmd.cmddict(help="Print media stats. ")),
                p(('--list-mtype',), libcmd.cmddict(help="List all mediatypes. ")),
                p(('--list-mformat',), libcmd.cmddict(help="List all media formats. ")),
                p(('--add-mtype',), libcmd.cmddict(help="Add a new mediatype. ")),
                p(('--add-mformats',), libcmd.cmddict(help="Add a new media format(s). ")),
                p(('--add-genre',), libcmd.cmddict(help="Add a new media genre. ")),

                p(('--name',), dict(
                    type='str'
                )),
                p(('--mtype',), dict(
                    type='str'
                )),
                p(('--mformat',), dict(
                    type='str'
                )),
                p(('--genres',), dict(
                    action='append',
                    default=[],
                    type='str'
                ))
               # (('-d', '--dbref'), {'default':self.DEFAULT_DB, 'metavar':'DB'}),
            )
Ejemplo n.º 4
0
 def get_optspec(Klass, inherit):
     return (
             (('--run-fstree',), libcmd.cmddict()),
         )
Ejemplo n.º 5
0
    def get_optspec(Klass, inheritor):
        """
        Return tuples with optparse command-line argument specification.
        """
        p = inheritor.get_prefixer(Klass)
        return (
                # XXX: duplicates Options
                p(('-d', '--dbref'), { 'metavar':'URI',
                    'default': inheritor.DEFAULT_DB,
                    'dest': 'dbref',
                    'help': "A URI formatted relational DB access description "
                        "(SQLAlchemy implementation). Ex: "
                        " `sqlite:///taxus.sqlite`,"
                        " `mysql://taxus-user@localhost/taxus`. "
                        "The default value (%default) may be overwritten by configuration "
                        "and/or command line option. " }),
                p(('--repo',), {
                    'metavar':'NAME',
                    'default': "cllct",
                    'action': 'store',
                    'dest': 'repo',
                    'help': "Set data repository" }),
                p(('--session',), {
                    'metavar':'NAME',
                    'default': "default",
                    'action': 'store',
                    'dest': 'session',
                    'help': "Session determines working tree root" }),
                p(('--auto-commit',), {
#                    "default": False,
                    'action': 'store_true',
                    'help': "target" }),
                p(('-Q', '--query'), {'action':'callback',
                    'callback_args': ('query',),
                    'callback': libcmd.optparse_set_handler_list,
                    'dest': 'command',
                    'help': "TODO" }),
                p(('--init-db',), {
                    'dest': 'init_db',
                    'action': 'store_true',
                    'help': "Create database" }),

                p(('--init-volume',), {
                    'dest': 'init_volume',
                    'action': 'store_true',
                    'help': "(Re)set volume Id" }),
                p(('--init-workspace',), {
                    'dest': 'init_workspace',
                    'action': 'store_true',
                    'help': "(Re)set workspace Id" }),
                # commands
                p(('--info',), libcmd.cmddict(Klass.NAME, append=True)),
                p(('--show-metafile',), libcmd.cmddict(Klass.NAME)),
                p(('--show-sha1sum-hexdigest',), libcmd.cmddict(Klass.NAME)),
                p(('--volume',), libcmd.cmddict(Klass.NAME, append=True)),
                p(('--assert',), libcmd.cmddict(Klass.NAME, help="Add Node.")),
                p(('--assert-group',), libcmd.cmddict(Klass.NAME, help="Add Group-node.")),
                p(('--remove',), libcmd.cmddict(Klass.NAME, help="Drop Node.")),
                p(('--commit',), libcmd.cmddict(Klass.NAME, append=True)),
                p(('--nodes',), libcmd.cmddict(Klass.NAME)),
                p(('--set-root-bool',), libcmd.cmddict(Klass.NAME)),
                p(('--update',), libcmd.cmddict(Klass.NAME)),
                p(('--repo-update',), libcmd.cmddict(Klass.NAME)),
                #listtree?
                p(('-l', '--list',), libcmd.cmddict(Klass.NAME)),
                p(('-t', '--tree',), libcmd.cmddict(Klass.NAME)),
                p(('--list-groups',), libcmd.cmddict(Klass.NAME)),
                p(('--show',), libcmd.cmddict(Klass.NAME, help="Print Node.")),
            )
Ejemplo n.º 6
0
    def get_optspec(Klass, inheritor):

        """
        Return tuples with optparse command-line argument specification.
        """
        p = inheritor.get_prefixer(Klass)
        return (
            # actions
                p(('-s', '--stats',), libcmd.cmddict()),
                p(('-l', '--list',), libcmd.cmddict()),
                p(('-a', '--add',), libcmd.cmddict()),
                p(('--list-lctr',), libcmd.cmddict()),

                (('--moz-js-import',), libcmd.cmddict()),
                (('--dlcs-post-import',), libcmd.cmddict()),
                (('--dlcs-post-test',), libcmd.cmddict()),

                p(('--export',), libcmd.cmddict(help="TODO: bm export")),

                (('--moz-js-group-import',), libcmd.cmddict()),

                (('--add-lctrs',), libcmd.cmddict(
                    help="Add locator records for given URL's.")),
                (('--add-ref-md5',), libcmd.cmddict(
                    help="Add MD5-refs missing (on all locators). ")),

            # params
                p(('--public',), dict( action='store_true', default=False )),
                p(('--name',), dict( default=None, type="str" )),
                p(('--href',), dict( default=None, type="str" )),
                p(('--ext',), dict( default=None, type="str" )),
                p(('--tags',), dict( default=None, type="str" )),
                p(('--ref-md5',), dict( action='store_true',
                    default=False, help="Calculate MD5 for new locators. " )),

            )