当前位置: 首页>>代码示例>>Python>>正文


Python EitCommandDescriptor.obtain_descriptor方法代码示例

本文整理汇总了Python中eit.commands.descriptor.EitCommandDescriptor.obtain_descriptor方法的典型用法代码示例。如果您正苦于以下问题:Python EitCommandDescriptor.obtain_descriptor方法的具体用法?Python EitCommandDescriptor.obtain_descriptor怎么用?Python EitCommandDescriptor.obtain_descriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eit.commands.descriptor.EitCommandDescriptor的用法示例。


在下文中一共展示了EitCommandDescriptor.obtain_descriptor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitNotice.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitNotice.NAME))

        subparsers = parser.add_subparsers(
            title="action", description=_("execute given action"),
            help=_("available actions"))

        add_parser = subparsers.add_parser("add",
            help=_("add notice-board entry"))
        add_parser.add_argument("repo", nargs='?', default=None,
                                metavar="<repo>", help=_("repository"))
        add_parser.set_defaults(func=self._add)

        remove_parser = subparsers.add_parser("remove",
            help=_("remove notice-board entry"))
        remove_parser.add_argument("repo", nargs='?', default=None,
                                   metavar="<repo>", help=_("repository"))
        remove_parser.set_defaults(func=self._remove)

        show_parser = subparsers.add_parser("show",
            help=_("show notice-board"))
        show_parser.add_argument("repo", nargs='?', default=None,
                                   metavar="<repo>", help=_("repository"))
        show_parser.set_defaults(func=self._show)

        return parser
开发者ID:B-Rich,项目名称:entropy,代码行数:34,代码来源:notice.py

示例2: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitRemote.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitRemote.NAME))

        subparsers = parser.add_subparsers(
            title="action", description=_("execute action"),
            help=_("available actions"))

        list_parser = subparsers.add_parser("list",
            help=_("list repositories"))
        list_parser.set_defaults(func=self._list)

        add_parser = subparsers.add_parser("add",
           help=_("add repository"))
        add_parser.add_argument("repository", metavar="<repository>",
                                help=_("repository id"))
        add_parser.add_argument("--desc", metavar="<description>",
                                default=None,
                                help=_("repository description"))
        add_parser.add_argument("uri", metavar="<uri>", nargs="+",
                                help=_("repository uri"))

        add_parser.set_defaults(func=self._add)

        return parser
开发者ID:dMaggot,项目名称:entropy,代码行数:32,代码来源:remote.py

示例3: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        self._real_command = sys.argv[0]
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitPush.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitPush.NAME))

        parser.add_argument("repo", nargs='?', default=None,
                            metavar="<repo>", help=_("repository"))
        parser.add_argument("--conservative", action="store_true",
                            help=_("do not execute implicit package name "
                                   "and slot updates"),
                            default=self._conservative)
        parser.add_argument("--quick", action="store_true",
                            default=False,
                            help=_("no stupid questions"))
        parser.add_argument("--force", action="store_true",
                            default=False,
                            help=_("force push in case of QA errors"))

        group = parser.add_mutually_exclusive_group()
        group.add_argument("--all", action="store_true",
                            default=False,
                            help=_("push all the repositories"))
        group.add_argument("--as", metavar="<repo>", default=None,
                           help=_("push as fake repository"),
                           dest="asrepo")
        parser.add_argument("--pretend", action="store_true",
                            default=False,
                            help=_("show what would be done"))

        return parser
开发者ID:dMaggot,项目名称:entropy,代码行数:36,代码来源:push.py

示例4: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCp """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitCp.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitCp.NAME))

        parser.add_argument("source", nargs=1,
                            metavar="<source>",
                            help=_("source repository"))
        parser.add_argument("dest", nargs=1,
                            metavar="<dest>",
                            help=_("destination repository"))
        parser.add_argument("--conservative", action="store_true",
                            help=_("do not execute implicit package name "
                                   "and slot updates"),
                            default=self._conservative)
        parser.add_argument("--deps", action="store_true",
                            default=False,
                            help=_("include dependencies"))
        parser.add_argument("package", nargs='+', metavar="<package>",
                            help=_("package dependency"))
        return parser
开发者ID:dMaggot,项目名称:entropy,代码行数:27,代码来源:cp.py

示例5: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitBranch.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitBranch.NAME))

        parser.add_argument("--quick", action="store_true",
                            default=not self._ask,
                            help=_("no stupid questions"))
        parser.add_argument("branch", nargs='?',
                            metavar="<branch>",
                            help=_("switch to given branch"))
        parser.add_argument("repo", nargs='?',
                            metavar="<repo>",
                            help=_("repository"))
        parser.add_argument("--from", metavar="<branch>",
                            help=_("from branch"),
                            dest="frombranch", default=None)
        parser.add_argument("--no-copy", action="store_true",
                            default=not self._copy, dest="nocopy",
                            help=_("don't copy packages from branch"))
        return parser
开发者ID:dMaggot,项目名称:entropy,代码行数:27,代码来源:branch.py

示例6: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitTest.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitTest.NAME))

        subparsers = parser.add_subparsers(
            title="test", description=_("run given test"),
            help=_("available tests"))

        deps_parser = subparsers.add_parser("deps",
            help=_("dependencies test"))
        deps_parser.set_defaults(func=self._deptest)

        libs_parser = subparsers.add_parser("libs",
            help=_("libraries test"))
        libs_parser.add_argument("--dump", action="store_true",
            default=False, help=_("dump results to file"))
        libs_parser.set_defaults(func=self._libtest)

        links_parser = subparsers.add_parser("links",
            help=_("library linking test (using repository metadata)"))
        links_parser.add_argument("excllibs", nargs='*', default=None,
                                  metavar="<excluded lib>",
                                  help=_("excluded soname"))
        links_parser.set_defaults(func=self._linktest)

        pkglibs_parser = subparsers.add_parser("pkglibs",
            help=_("library linking test (using live system)"))
        pkglibs_parser.add_argument("packages", nargs='+', default=None,
                                  metavar="<package>",
                                  help=_("package names"))
        pkglibs_parser.set_defaults(func=self._pkglibs)

        pkgs_parser = subparsers.add_parser("local",
            help=_("verify local packages integrity"))
        pkgs_parser.add_argument("repo", nargs='?', default=None,
                                 metavar="<repo>", help=_("repository"))
        pkgs_parser.add_argument("--quick", action="store_true",
                                 default=not self._ask,
                                 help=_("no stupid questions"))
        pkgs_parser.set_defaults(func=self._pkgtest)

        rempkgs_parser = subparsers.add_parser("remote",
            help=_("verify remote packages integrity"))
        rempkgs_parser.add_argument("repo", nargs='?', default=None,
                                    metavar="<repo>", help=_("repository"))
        rempkgs_parser.add_argument("--quick", action="store_true",
                                    default=not self._ask,
                                    help=_("no stupid questions"))
        rempkgs_parser.set_defaults(func=self._rem_pkgtest)

        return parser
开发者ID:dMaggot,项目名称:entropy,代码行数:58,代码来源:test.py

示例7: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitCheckout.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitCheckout.NAME))

        parser.add_argument("repo", metavar="<repo>",
                            help=_("repository"))
        return parser
开发者ID:B-Rich,项目名称:entropy,代码行数:14,代码来源:checkout.py

示例8: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitLog.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitLog.NAME))

        parser.add_argument("repo", nargs='?', default=None,
                            metavar="<repo>", help=_("repository"))

        return parser
开发者ID:B-Rich,项目名称:entropy,代码行数:14,代码来源:log.py

示例9: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitRepo.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitRepo.NAME))

        subparsers = parser.add_subparsers(
            title="action", description=_("manage repositories"),
            help=_("available commands"))

        show_parser = subparsers.add_parser(
            "show", help=_("show repositories and mirrors status"))
        show_parser.set_defaults(func=self._show)

        add_parser = subparsers.add_parser(
            "add", help=_("add a repository"))
        add_parser.add_argument(
            "id", metavar="<repository>",
            help=_("repository name"))
        add_parser.add_argument(
            "--desc", metavar="<description>", required=True,
            help=_("repository description"))
        add_parser.add_argument(
            "--repo", nargs='+',
            metavar="<repo uri>", required=True,
            help=_("synchronization URI for both packages and database"))
        add_parser.add_argument(
            "--repo-only", nargs='*', default=[],
            metavar="<database only uri>",
            help=_("synchronization URI for database only"))
        add_parser.add_argument(
            "--pkg-only", nargs='*', default=[],
            metavar="<packages only uri>",
            help=_("synchronization URI for packages only"))
        add_parser.add_argument(
            "--base", action="store_true", default=None,
            help=_("set this to make this repository the "
                   "'base' for all the others"))
        add_parser.set_defaults(func=self._add)

        remove_parser = subparsers.add_parser("remove",
            help=_("remove a repository"))
        remove_parser.add_argument(
            "id", nargs='+',
            metavar="<repository>",
            help=_("repository name"))
        remove_parser.set_defaults(func=self._remove)

        return parser
开发者ID:dMaggot,项目名称:entropy,代码行数:54,代码来源:repo.py

示例10: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitInit """
        descriptor = EitCommandDescriptor.obtain_descriptor(EitInit.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitInit.NAME),
        )

        parser.add_argument("repo", nargs=1, default=None, metavar="<repo>", help=_("repository"))
        parser.add_argument("--quick", action="store_true", default=not self._ask, help=_("no stupid questions"))

        return parser
开发者ID:StefanCristian,项目名称:entropy,代码行数:15,代码来源:init.py

示例11: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommit """
        descriptor = EitCommandDescriptor.obtain_descriptor(EitRepack.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitRepack.NAME),
        )

        parser.add_argument("packages", nargs="+", metavar="<package>", help=_("package names"))
        parser.add_argument(
            "--in", metavar="<repository>", help=_("repack to given repository"), default=None, dest="into"
        )
        return parser
开发者ID:prescott66,项目名称:entropy,代码行数:16,代码来源:repack.py

示例12: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        descriptor = EitCommandDescriptor.obtain_descriptor(EitFiles.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitFiles.NAME),
        )

        parser.add_argument("packages", nargs="+", metavar="<package>", help=_("package names"))
        parser.add_argument(
            "--quiet", "-q", action="store_true", default=self._quiet, help=_("quiet output, for scripting purposes")
        )

        return parser
开发者ID:StefanCristian,项目名称:entropy,代码行数:16,代码来源:files.py

示例13: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitDeps.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitDeps.NAME))

        parser.add_argument("packages", nargs='+', metavar="<package>",
                            help=_("package name"))
        parser.add_argument("--in", metavar="<repository>",
                            help=_("inject into given repository"),
                            dest="inrepo", default=None)

        return parser
开发者ID:Heather,项目名称:entropy,代码行数:17,代码来源:deps.py

示例14: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        """ Overridden from EitCommand """
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitBump.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitBump.NAME))

        parser.add_argument("repo", nargs='?', default=None,
                            metavar="<repo>", help=_("repository"))
        parser.add_argument("--sync", action="store_true",
                            default=self._sync,
                            help=_("sync with remote repository"))
        return parser
开发者ID:B-Rich,项目名称:entropy,代码行数:17,代码来源:bump.py

示例15: _get_parser

# 需要导入模块: from eit.commands.descriptor import EitCommandDescriptor [as 别名]
# 或者: from eit.commands.descriptor.EitCommandDescriptor import obtain_descriptor [as 别名]
    def _get_parser(self):
        descriptor = EitCommandDescriptor.obtain_descriptor(
            EitInject.NAME)
        parser = argparse.ArgumentParser(
            description=descriptor.get_description(),
            formatter_class=argparse.RawDescriptionHelpFormatter,
            prog="%s %s" % (sys.argv[0], EitInject.NAME))

        parser.add_argument("packages", nargs='+', metavar="<path>",
                            help=_("package paths"))
        parser.add_argument("--to", metavar="<repository>",
                            help=_("inject into given repository"),
                            default=None)
        parser.add_argument("--quick", action="store_true",
                            default=not self._ask,
                            help=_("no stupid questions"))
        return parser
开发者ID:geaaru,项目名称:entropy,代码行数:19,代码来源:inject.py


注:本文中的eit.commands.descriptor.EitCommandDescriptor.obtain_descriptor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。