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


Python distutils.cmd方法代码示例

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


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

示例1: get_cmdline_options

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import cmd [as 别名]
def get_cmdline_options(self):
        """Return a '{cmd: {opt:val}}' map of all command-line options

        Option names are all long, but do not include the leading '--', and
        contain dashes rather than underscores.  If the option doesn't take
        an argument (e.g. '--quiet'), the 'val' is 'None'.

        Note that options provided by config files are intentionally excluded.
        """

        d = {}

        for cmd, opts in self.command_options.items():

            for opt, (src, val) in opts.items():

                if src != "command line":
                    continue

                opt = opt.replace('_', '-')

                if val == 0:
                    cmdobj = self.get_command_obj(cmd)
                    neg_opt = self.negative_opt.copy()
                    neg_opt.update(getattr(cmdobj, 'negative_opt', {}))
                    for neg, pos in neg_opt.items():
                        if pos == opt:
                            opt = neg
                            val = None
                            break
                    else:
                        raise AssertionError("Shouldn't be able to get here")

                elif val == 1:
                    val = None

                d.setdefault(cmd, {})[opt] = val

        return d 
开发者ID:pantsbuild,项目名称:pex,代码行数:41,代码来源:dist.py

示例2: create_command

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import cmd [as 别名]
def create_command(text, commands):
    """Creates a custom setup.py command."""

    class CustomCommand(BaseCommand):
        description = text

        def run(self):
            for cmd in commands:
                subprocess.check_call(cmd)

    return CustomCommand 
开发者ID:SectorLabs,项目名称:django-localized-fields,代码行数:13,代码来源:setup.py

示例3: run

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import cmd [as 别名]
def run(self):
        pattern = "vies/locale/*/LC_MESSAGES/django.po"
        for file in glob.glob(pattern):
            cmd = ["msgfmt", "-c"]
            name, ext = os.path.splitext(file)

            cmd += ["-o", "%s.mo" % name]
            cmd += ["%s.po" % name]
            self.announce(
                "running command: %s" % " ".join(cmd), level=distutils.log.INFO
            )
            subprocess.check_call(cmd, cwd=BASE_DIR)  # nosec 
开发者ID:codingjoe,项目名称:django-vies,代码行数:14,代码来源:setup.py

示例4: run

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import cmd [as 别名]
def run(self):
            # shamelessly lifted from setuptools.command.test.test.run()
            dist = self.distribution
            if dist.install_requires:
                dist.fetch_build_eggs(dist.install_requires)
            if dist.tests_require:
                dist.fetch_build_eggs(dist.tests_require)

            cmd = self._test_cmd_string()
            if self.dry_run:
                self.announce("skipping '%s' (dry run)" % (cmd,))
            else:
                self.announce("running '%s'" % (cmd,))
                self.with_project_on_sys_path(self.run_tests) 
开发者ID:suds-community,项目名称:suds,代码行数:16,代码来源:setup.py

示例5: run

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import cmd [as 别名]
def run(self):
        for cmd in pipenv_setup:
            assert os.system(cmd) == 0
        print(
            "\npipenv run pytest      runs the tests"
            "\npipenv shell           enters the virtualenv"
        ) 
开发者ID:projectcaluma,项目名称:caluma,代码行数:9,代码来源:setup.py


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