Python distutils.core.Command.__init__() Examples

The following are 22 code examples of distutils.core.Command.__init__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module distutils.core.Command , or try the search function .
Example #1
Source File: __init__.py    From ImageFusion with MIT License 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #2
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #3
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
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 
Example #4
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #5
Source File: __init__.py    From Flask with Apache License 2.0 5 votes vote down vote up
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 
Example #6
Source File: extract_dist.py    From pyp2rpm with MIT License 5 votes vote down vote up
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 
Example #7
Source File: __init__.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
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) 
Example #8
Source File: __init__.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #9
Source File: distutilscmd.py    From pth-toolkit with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __init__(self, dist):
        Command.__init__(self, dist)
        self.runner = TestToolsTestRunner(sys.stdout) 
Example #10
Source File: __init__.py    From datafari with Apache License 2.0 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #11
Source File: __init__.py    From datafari with Apache License 2.0 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #12
Source File: __init__.py    From jbox with MIT License 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #13
Source File: __init__.py    From ImageFusion with MIT License 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #14
Source File: __init__.py    From Flask-P2P with MIT License 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #15
Source File: __init__.py    From Flask-P2P with MIT License 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #16
Source File: __init__.py    From oss-ftp with MIT License 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #17
Source File: __init__.py    From oss-ftp with MIT License 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #18
Source File: __init__.py    From lambda-chef-node-cleanup with Apache License 2.0 5 votes vote down vote up
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) 
Example #19
Source File: __init__.py    From lambda-chef-node-cleanup with Apache License 2.0 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #20
Source File: __init__.py    From pledgeservice with Apache License 2.0 5 votes vote down vote up
def __init__(self, dist, **kw):
        # Add support for keyword arguments
        _Command.__init__(self,dist)
        for k,v in kw.items():
            setattr(self,k,v) 
Example #21
Source File: __init__.py    From pledgeservice with Apache License 2.0 5 votes vote down vote up
def _looks_like_package(path):
        return os.path.isfile(os.path.join(path, '__init__.py')) 
Example #22
Source File: __init__.py    From jbox with MIT License 5 votes vote down vote up
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)