本文整理汇总了Python中setuptools.Command.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Command.__init__方法的具体用法?Python Command.__init__怎么用?Python Command.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.Command
的用法示例。
在下文中一共展示了Command.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
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
示例2: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
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
示例3: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
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')
示例4: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
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')
示例5: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
def __init__(self, *args):
self.args = args[0] # so we can pass it to other classes
Command.__init__(self, *args)
示例6: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
def __init__ ( self, *args, **kwargs ):
# super ( NoseTest, self ).__init__ ( *args, **kwargs )
Command.__init__ ( self, *args, **kwargs )
示例7: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
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)
示例8: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
def __init__(self, *args):
self.args = args[0]
Command.__init__(self, *args)
示例9: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
def __init__(self, dist, **kw):
# underlying commands are old-style classes on Python 2 :-(
Command.__init__(self, dist, **kw)
示例10: __init__
# 需要导入模块: from setuptools import Command [as 别名]
# 或者: from setuptools.Command import __init__ [as 别名]
def __init__(self, dist):
self.compiler = None
Command.__init__(self, dist)