當前位置: 首頁>>代碼示例>>Python>>正文


Python Command.__init__方法代碼示例

本文整理匯總了Python中distutils.core.Command.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Command.__init__方法的具體用法?Python Command.__init__怎麽用?Python Command.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.core.Command的用法示例。


在下文中一共展示了Command.__init__方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _looks_like_package

# 需要導入模塊: from distutils.core import Command [as 別名]
# 或者: from distutils.core.Command import __init__ [as 別名]
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
開發者ID:jpush,項目名稱:jbox,代碼行數:4,代碼來源:__init__.py

示例2: __init__

# 需要導入模塊: from distutils.core import Command [as 別名]
# 或者: from distutils.core.Command import __init__ [as 別名]
def __init__(self, dist, **kw):
        """
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        """
        _Command.__init__(self, dist)
        vars(self).update(kw) 
開發者ID:jpush,項目名稱:jbox,代碼行數:9,代碼來源:__init__.py

示例3: __init__

# 需要導入模塊: from distutils.core import Command [as 別名]
# 或者: from distutils.core.Command import __init__ [as 別名]
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:7,代碼來源:__init__.py

示例4: __init__

# 需要導入模塊: from distutils.core import Command [as 別名]
# 或者: from distutils.core.Command import __init__ [as 別名]
def __init__(self, dist):
        Command.__init__(self, dist)
        self.runner = TestToolsTestRunner(sys.stdout) 
開發者ID:byt3bl33d3r,項目名稱:pth-toolkit,代碼行數:5,代碼來源:distutilscmd.py

示例5: __init__

# 需要導入模塊: from distutils.core import Command [as 別名]
# 或者: from distutils.core.Command import __init__ [as 別名]
def __init__(self, *args, **kwargs):
        """Metadata dictionary is created, all the metadata attributes,
        that were not found are set to default empty values. Checks of data
        types are performed.
        """
        Command.__init__(self, *args, **kwargs)

        self.metadata = {}

        for attr in ['setup_requires', 'tests_require', 'install_requires',
                     'packages', 'py_modules', 'scripts']:
            self.metadata[attr] = to_list(getattr(self.distribution, attr, []))

        try:
            for k, v in getattr(
                    self.distribution, 'extras_require', {}).items():
                if k in ['test, docs', 'doc', 'dev']:
                    attr = 'setup_requires'
                else:
                    attr = 'install_requires'
                self.metadata[attr] += to_list(v)
        except (AttributeError, ValueError):
            # extras require are skipped in case of wrong data format
            # can't log here, because this file is executed in a subprocess
            pass

        for attr in ['url', 'long_description', 'description', 'license']:
            self.metadata[attr] = to_str(
                getattr(self.distribution.metadata, attr, None))

        self.metadata['classifiers'] = to_list(
            getattr(self.distribution.metadata, 'classifiers', []))

        if isinstance(getattr(self.distribution, "entry_points", None), dict):
            self.metadata['entry_points'] = self.distribution.entry_points
        else:
            self.metadata['entry_points'] = None

        self.metadata['test_suite'] = getattr(
            self.distribution, "test_suite", None) is not None 
開發者ID:fedora-python,項目名稱:pyp2rpm,代碼行數:42,代碼來源:extract_dist.py

示例6: find_packages

# 需要導入模塊: from distutils.core import Command [as 別名]
# 或者: from distutils.core.Command import __init__ [as 別名]
def find_packages(where='.', exclude=()):
    """Return a list all Python packages found within directory 'where'

    'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
    will be converted to the appropriate local path syntax.  'exclude' is a
    sequence of package names to exclude; '*' can be used as a wildcard in the
    names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
    'foo' itself).
    """
    out = []
    stack=[(convert_path(where), '')]
    while stack:
        where,prefix = stack.pop(0)
        for name in os.listdir(where):
            fn = os.path.join(where,name)
            looks_like_package = (
                '.' not in name
                and os.path.isdir(fn)
                and os.path.isfile(os.path.join(fn, '__init__.py'))
            )
            if looks_like_package:
                out.append(prefix+name)
                stack.append((fn, prefix+name+'.'))
    for pat in list(exclude)+['ez_setup']:
        from fnmatch import fnmatchcase
        out = [item for item in out if not fnmatchcase(item,pat)]
    return out 
開發者ID:GeekTrainer,項目名稱:Flask,代碼行數:29,代碼來源:__init__.py


注:本文中的distutils.core.Command.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。