/usr/lib/python2.7/site-packages/setuptools
NameSizeModeActions
command/-0755rm
extern/-0755rm
_vendor/-0755rm
archive_util.py65920644editdlrm
archive_util.pyc61420644editdlrm
archive_util.pyo61420644editdlrm
build_meta.py56710644editdlrm
build_meta.pyc66390644editdlrm
build_meta.pyo65220644editdlrm
config.py163810644editdlrm
config.pyc168880644editdlrm
config.pyo168880644editdlrm
depends.py58370644editdlrm
depends.pyc64830644editdlrm
depends.pyo64830644editdlrm
dep_util.py9350644editdlrm
dep_util.pyc9650644editdlrm
dep_util.pyo9650644editdlrm
dist.py425140644editdlrm
dist.pyc415020644editdlrm
dist.pyo414440644editdlrm
extension.py17290644editdlrm
extension.pyc24180644editdlrm
extension.pyo24180644editdlrm
glibc.py31460644editdlrm
glibc.pyc19600644editdlrm
glibc.pyo19600644editdlrm
glob.py52070644editdlrm
glob.pyc48180644editdlrm
glob.pyo47560644editdlrm
launch.py7870644editdlrm
launch.pyc10000644editdlrm
launch.pyo10000644editdlrm
lib2to3_ex.py20130644editdlrm
lib2to3_ex.pyc30040644editdlrm
lib2to3_ex.pyo30040644editdlrm
monkey.py57890644editdlrm
monkey.pyc63430644editdlrm
monkey.pyo63430644editdlrm
msvc.py408770644editdlrm
msvc.pyc403520644editdlrm
msvc.pyo403520644editdlrm
namespaces.py31990644editdlrm
namespaces.pyc50330644editdlrm
namespaces.pyo50330644editdlrm
package_index.py401530644editdlrm
package_index.pyc397430644editdlrm
package_index.pyo397430644editdlrm
pep425tags.py108820644editdlrm
pep425tags.pyc93340644editdlrm
pep425tags.pyo93340644editdlrm
py27compat.py5360644editdlrm
py27compat.pyc10450644editdlrm
py27compat.pyo10450644editdlrm
py31compat.py11920644editdlrm
py31compat.pyc18980644editdlrm
py31compat.pyo18980644editdlrm
py33compat.py11820644editdlrm
py33compat.pyc17200644editdlrm
py33compat.pyo17200644editdlrm
py36compat.py28910644editdlrm
py36compat.pyc28620644editdlrm
py36compat.pyo28620644editdlrm
sandbox.py142760644editdlrm
sandbox.pyc189000644editdlrm
sandbox.pyo189000644editdlrm
script (dev).tmpl2010644editdlrm
script.tmpl1380644editdlrm
site-patch.py23070644editdlrm
site-patch.pyc17390644editdlrm
site-patch.pyo17390644editdlrm
ssl_support.py84920644editdlrm
ssl_support.pyc85160644editdlrm
ssl_support.pyo85160644editdlrm
unicode_utils.py9960644editdlrm
unicode_utils.pyc14720644editdlrm
unicode_utils.pyo14720644editdlrm
version.py1440644editdlrm
version.pyc3220644editdlrm
version.pyo3220644editdlrm
wheel.py72300644editdlrm
wheel.pyc73430644editdlrm
wheel.pyo73090644editdlrm
windows_support.py7140644editdlrm
windows_support.pyc12740644editdlrm
windows_support.pyo12740644editdlrm
__init__.py57000644editdlrm
__init__.pyc76250644editdlrm
__init__.pyo76250644editdlrm
Edit: /usr/lib/python2.7/site-packages/setuptools/namespaces.py (3199B)
import os from distutils import log import itertools from setuptools.extern.six.moves import map flatten = itertools.chain.from_iterable class Installer: nspkg_ext = '-nspkg.pth' def install_namespaces(self): nsp = self._get_all_ns_packages() if not nsp: return filename, ext = os.path.splitext(self._get_target()) filename += self.nspkg_ext self.outputs.append(filename) log.info("Installing %s", filename) lines = map(self._gen_nspkg_line, nsp) if self.dry_run: # always generate the lines, even in dry run list(lines) return with open(filename, 'wt') as f: f.writelines(lines) def uninstall_namespaces(self): filename, ext = os.path.splitext(self._get_target()) filename += self.nspkg_ext if not os.path.exists(filename): return log.info("Removing %s", filename) os.remove(filename) def _get_target(self): return self.target _nspkg_tmpl = ( "import sys, types, os", "has_mfs = sys.version_info > (3, 5)", "p = os.path.join(%(root)s, *%(pth)r)", "importlib = has_mfs and __import__('importlib.util')", "has_mfs and __import__('importlib.machinery')", "m = has_mfs and " "sys.modules.setdefault(%(pkg)r, " "importlib.util.module_from_spec(" "importlib.machinery.PathFinder.find_spec(%(pkg)r, " "[os.path.dirname(p)])))", "m = m or " "sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))", "mp = (m or []) and m.__dict__.setdefault('__path__',[])", "(p not in mp) and mp.append(p)", ) "lines for the namespace installer" _nspkg_tmpl_multi = ( 'm and setattr(sys.modules[%(parent)r], %(child)r, m)', ) "additional line(s) when a parent package is indicated" def _get_root(self): return "sys._getframe(1).f_locals['sitedir']" def _gen_nspkg_line(self, pkg): # ensure pkg is not a unicode string under Python 2.7 pkg = str(pkg) pth = tuple(pkg.split('.')) root = self._get_root() tmpl_lines = self._nspkg_tmpl parent, sep, child = pkg.rpartition('.') if parent: tmpl_lines += self._nspkg_tmpl_multi return ';'.join(tmpl_lines) % locals() + '\n' def _get_all_ns_packages(self): """Return sorted list of all package namespaces""" pkgs = self.distribution.namespace_packages or [] return sorted(flatten(map(self._pkg_names, pkgs))) @staticmethod def _pkg_names(pkg): """ Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True """ parts = pkg.split('.') while parts: yield '.'.join(parts) parts.pop() class DevelopInstaller(Installer): def _get_root(self): return repr(str(self.egg_path)) def _get_target(self): return self.egg_link