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


Python Distribution.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs=None):
        have_package_data = hasattr(self, "package_data")
        if not have_package_data:
            self.package_data = {}
        _attrs_dict = attrs or {}
        if 'features' in _attrs_dict or 'require_features' in _attrs_dict:
            Feature.warn_deprecated()
        self.require_features = []
        self.features = {}
        self.dist_files = []
        self.src_root = attrs and attrs.pop("src_root", None)
        self.patch_missing_pkg_info(attrs)
        # Make sure we have any eggs needed to interpret 'attrs'
        if attrs is not None:
            self.dependency_links = attrs.pop('dependency_links', [])
            assert_string_list(self,'dependency_links',self.dependency_links)
        if attrs and 'setup_requires' in attrs:
            self.fetch_build_eggs(attrs.pop('setup_requires'))
        for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
            if not hasattr(self,ep.name):
                setattr(self,ep.name,None)
        _Distribution.__init__(self,attrs)
        if isinstance(self.metadata.version, numeric_types):
            # Some people apparently take "version number" too literally :)
            self.metadata.version = str(self.metadata.version) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:27,代码来源:dist.py

示例2: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs=None):
        _Distribution.__init__(self, attrs)
        if not self.ext_modules:
            return
        for idx in range(len(self.ext_modules) - 1, -1, -1):
            ext = self.ext_modules[idx]
            if not isinstance(ext, Extension):
                continue
            setattr(self, ext.attr_name, None)
            self.global_options = [
                (
                    ext.option_name,
                    None,
                    "include %s (default if %s is available)"
                    % (ext.feature_description, ext.feature_name),
                ),
                (ext.neg_option_name, None, "exclude %s" % ext.feature_description),
            ] + self.global_options
            self.negative_opt = self.negative_opt.copy()
            self.negative_opt[ext.neg_option_name] = ext.option_name 
开发者ID:python-poetry,项目名称:poetry,代码行数:22,代码来源:setup.py

示例3: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs=None):
        have_package_data = hasattr(self, "package_data")
        if not have_package_data:
            self.package_data = {}
        _attrs_dict = attrs or {}
        if 'features' in _attrs_dict or 'require_features' in _attrs_dict:
            Feature.warn_deprecated()
        self.require_features = []
        self.features = {}
        self.dist_files = []
        self.src_root = attrs and attrs.pop("src_root", None)
        self.patch_missing_pkg_info(attrs)
        # Make sure we have any eggs needed to interpret 'attrs'
        if attrs is not None:
            self.dependency_links = attrs.pop('dependency_links', [])
            assert_string_list(self,'dependency_links',self.dependency_links)
        if attrs and 'setup_requires' in attrs:
            self.fetch_build_eggs(attrs['setup_requires'])
        for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
            if not hasattr(self,ep.name):
                setattr(self,ep.name,None)
        _Distribution.__init__(self,attrs)
        if isinstance(self.metadata.version, numbers.Number):
            # Some people apparently take "version number" too literally :)
            self.metadata.version = str(self.metadata.version) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:27,代码来源:dist.py

示例4: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs):
        # this does most of the work...
        build_num = committed_rev()
        if build_num:
            # if there is SVN revision data, assign the new version number
            attrs['version'] = '%i' % build_num
            try:
                # then try to create a user specified version file
                filename, format  = attrs['version_file']
                file(filename,'w').write(format % build_num)
            # in case a 'version_file' attribute was not set, do nothing
            except KeyError:
                pass
        # the parent class does not know about 'version_file', so delete it
        del attrs['version_file']
        Distribution.__init__(self, attrs) 
开发者ID:ActiveState,项目名称:code,代码行数:18,代码来源:recipe-573449.py

示例5: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, attrs = None):
        # A list of (sconscripts, pre_hook, post_hook, src, parent_names)
        self.scons_data = []
        # A list of installable libraries
        self.installed_libraries = []
        # A dict of pkg_config files to generate/install
        self.installed_pkg_config = {}
        Distribution.__init__(self, attrs) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:numpy_distribution.py

示例6: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self, description, standard=False, available=True,
            optional=True, require_features=(), remove=(), **extras):
        self.warn_deprecated()

        self.description = description
        self.standard = standard
        self.available = available
        self.optional = optional
        if isinstance(require_features,(str,Require)):
            require_features = require_features,

        self.require_features = [
            r for r in require_features if isinstance(r,str)
        ]
        er = [r for r in require_features if not isinstance(r,str)]
        if er: extras['require_features'] = er

        if isinstance(remove,str):
            remove = remove,
        self.remove = remove
        self.extras = extras

        if not remove and not require_features and not extras:
            raise DistutilsSetupError(
                "Feature %s: must define 'require_features', 'remove', or at least one"
                " of 'packages', 'py_modules', etc."
            ) 
开发者ID:jpush,项目名称:jbox,代码行数:29,代码来源:dist.py

示例7: __init__

# 需要导入模块: from distutils.core import Distribution [as 别名]
# 或者: from distutils.core.Distribution import __init__ [as 别名]
def __init__(self,attrs=None):
        self.twisted_plugins = None
        Distribution.__init__(self, attrs)
        self.cmdclass = {'install':twisted_install,
                         'install_twisted_plugins':install_twisted_plugins,
                         'build':twisted_build,
                         'build_twisted_plugins':build_twisted_plugins,
                         'sdist':twisted_sdist,
                         } 
开发者ID:jlachowski,项目名称:clonedigger,代码行数:11,代码来源:twisted_distutils.py


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