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


Python setuptools.Command类代码示例

本文整理汇总了Python中setuptools.Command的典型用法代码示例。如果您正苦于以下问题:Python Command类的具体用法?Python Command怎么用?Python Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __init__

    def __init__(self, *args, **kwargs):
        os.environ['DJANGO_SETTINGS_MODULE'] = 'RestAuth.testsettings'

        Command.__init__(self, *args, **kwargs)

        # import here so coverage results are not tainted:
        from Users.models import user_permissions
        from Users.models import prop_permissions
        from Groups.models import group_permissions
        from common.cli import helpers
        from Services.cli import parsers as service_parser
        from Users.cli import parsers as user_parser
        from Groups.cli import parsers as group_parser
        from common.cli import parsers as import_parser

        # generate files for cli-scripts:
        service_parser.parser.prog = '|bin-restauth-service|'
        user_parser.parser.prog = '|bin-restauth-user|'
        group_parser.parser.prog = '|bin-restauth-group|'
        import_parser.parser.prog = '|bin-restauth-import|'

        # create necesarry folders:
        if not os.path.exists('doc/_static'):
            os.mkdir('doc/_static')
        if not os.path.exists('doc/gen'):
            os.mkdir('doc/gen')

        for parser, name in [(service_parser, 'restauth-service'),
                             (user_parser, 'restauth-user'),
                             (group_parser, 'restauth-group'),
                             (import_parser, 'restauth-import')]:

            for suffix in ['usage', 'commands', 'parameters']:
                filename = 'doc/gen/%s-%s.rst' % (name, suffix)
                if self.should_generate(parser.__file__, filename):
                    func = getattr(helpers, 'write_%s' % suffix)

                    with open(filename, 'w') as f:
                        func(f, parser.parser, name)

        # generate permissions:
        self.write_perm_table('users', user_permissions)
        self.write_perm_table('properties', prop_permissions)
        self.write_perm_table('groups', group_permissions)

        pythonpath = os.environ.get('PYTHONPATH')
        if pythonpath:
            os.environ['PYTHONPATH'] += ':.'
        else:
            os.environ['PYTHONPATH'] = '.'
        common_path = os.path.abspath(os.path.join('..', 'RestAuthCommon', 'python'))
        if os.path.exists(common_path):
            os.environ['PYTHONPATH'] += ':%s' % common_path

        version = get_version()
        os.environ['SPHINXOPTS'] = '-D release=%s -D version=%s' \
            % (version, version)
        os.environ['RESTAUTH_LATEST_RELEASE'] = LATEST_RELEASE
开发者ID:asd1355215911,项目名称:server,代码行数:58,代码来源:setup.py

示例2: __init__

    def __init__(self, dist):
        Command.__init__(self, dist)

        self.debug_client = None
        self.scp_version = 2
        self.splunk_home = os.environ['SPLUNK_HOME']
        self.app_name = self.distribution.metadata.name
        self.app_source = os.path.join(project_dir, 'package')

        return
开发者ID:splkfinn,项目名称:splunk-sdk-python,代码行数:10,代码来源:setup.py

示例3: __init__

    def __init__(self, dist):
        Command.__init__(self, dist)

        self.oonisupportdir = dirname(dirname(abspath(__file__)))
        self.pkgdir = join(self.oonisupportdir, 'mlab-ns-simulator')
        self.testdir = join(self.pkgdir, 'build', 'test')
        self.venvdir = join(self.testdir, 'venv')

        bindir = join(self.venvdir, 'bin')
        self.pip = join(bindir, 'pip')
        self.coverage = join(bindir, 'coverage')
        self.trial = join(bindir, 'trial')
开发者ID:hellais,项目名称:ooni-support,代码行数:12,代码来源:setup.py

示例4: __init__

    def __init__(self, dist):
        Command.__init__(self, dist)
        join = os.path.join

        self.basedir = os.path.dirname(os.path.abspath(__file__))
        self.pymod = join(self.basedir, PACKAGENAME)
        self.testdir = join(self.basedir, 'build', 'test')
        self.venvdir = join(self.testdir, 'venv')

        self.bindir = os.path.join(self.venvdir, 'bin')
        self.trial = os.path.join(self.bindir, 'trial')
        self.pip = os.path.join(self.bindir, 'pip')
        self.coverage = os.path.join(self.bindir, 'coverage')
开发者ID:nejucomo,项目名称:c2c,代码行数:13,代码来源:setup.py

示例5: __init__

 def __init__(self, *args):
     self.args = args[0]  # so we can pass it to other classes
     Command.__init__(self, *args)
开发者ID:kirpit,项目名称:Mathics,代码行数:3,代码来源:setup.py

示例6: __init__

 def __init__ ( self, *args, **kwargs ):
     # super ( NoseTest, self ).__init__ ( *args, **kwargs )
     Command.__init__ ( self, *args, **kwargs )
开发者ID:cjxiaohao,项目名称:libstorages,代码行数:3,代码来源:setup.py

示例7: __init__

    def __init__(self, dist, **kw):
        from babel.messages import frontend as babel

        self.babel_compile_messages = babel.compile_catalog(dist)
        Command.__init__(self, dist, **kw)
开发者ID:Bevaz,项目名称:OctoPrint,代码行数:5,代码来源:setup.py

示例8: __init__

 def __init__(self, *args):
     self.args = args[0]
     Command.__init__(self, *args)
开发者ID:iambernie,项目名称:fractalsfun,代码行数:3,代码来源:setup.py

示例9: __init__

 def __init__(self, dist, **kw):
     # underlying commands are old-style classes on Python 2 :-(
     Command.__init__(self, dist, **kw)
开发者ID:wtforms,项目名称:wtforms,代码行数:3,代码来源:setup.py

示例10: __init__

 def __init__(self, dist):
     self.compiler = None
     Command.__init__(self, dist)
开发者ID:zjc5415,项目名称:pyq,代码行数:3,代码来源:setup.py


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