/
usr
/
lib
/
python2.6
/
site-packages
/
setuptools
/
command
/
/usr/lib/python2.6/site-packages/setuptools/command
mkdir
upload
Name
Size
Mode
Actions
alias.py
2477
0644
edit
dl
rm
alias.pyc
3252
0644
edit
dl
rm
alias.pyo
3252
0644
edit
dl
rm
bdist_egg.py
17993
0644
edit
dl
rm
bdist_egg.pyc
18015
0644
edit
dl
rm
bdist_egg.pyo
18015
0644
edit
dl
rm
bdist_rpm.py
2025
0644
edit
dl
rm
bdist_rpm.pyc
2317
0644
edit
dl
rm
bdist_rpm.pyo
2317
0644
edit
dl
rm
bdist_wininst.py
1548
0644
edit
dl
rm
bdist_wininst.pyc
1836
0644
edit
dl
rm
bdist_wininst.pyo
1836
0644
edit
dl
rm
build_ext.py
11704
0644
edit
dl
rm
build_ext.pyc
10361
0644
edit
dl
rm
build_ext.pyo
10315
0644
edit
dl
rm
build_py.py
9944
0644
edit
dl
rm
build_py.pyc
11055
0644
edit
dl
rm
build_py.pyo
11055
0644
edit
dl
rm
develop.py
9535
0644
edit
dl
rm
develop.pyc
9028
0644
edit
dl
rm
develop.pyo
9028
0644
edit
dl
rm
easy_install.py
64104
0755
edit
dl
rm
easy_install.pyc
59092
0644
edit
dl
rm
easy_install.pyo
59092
0644
edit
dl
rm
egg_info.py
14356
0644
edit
dl
rm
egg_info.pyc
17028
0644
edit
dl
rm
egg_info.pyo
17028
0644
edit
dl
rm
install.py
4065
0644
edit
dl
rm
install.pyc
3801
0644
edit
dl
rm
install.pyo
3801
0644
edit
dl
rm
install_egg_info.py
3732
0644
edit
dl
rm
install_egg_info.pyc
4672
0644
edit
dl
rm
install_egg_info.pyo
4672
0644
edit
dl
rm
install_lib.py
2486
0644
edit
dl
rm
install_lib.pyc
3273
0644
edit
dl
rm
install_lib.pyo
3223
0644
edit
dl
rm
install_scripts.py
2011
0644
edit
dl
rm
install_scripts.pyc
2534
0644
edit
dl
rm
install_scripts.pyo
2534
0644
edit
dl
rm
launcher manifest.xml
628
0644
edit
dl
rm
register.py
277
0644
edit
dl
rm
register.pyc
692
0644
edit
dl
rm
register.pyo
692
0644
edit
dl
rm
rotate.py
2021
0644
edit
dl
rm
rotate.pyc
2940
0644
edit
dl
rm
rotate.pyo
2940
0644
edit
dl
rm
saveopts.py
740
0644
edit
dl
rm
saveopts.pyc
1275
0644
edit
dl
rm
saveopts.pyo
1275
0644
edit
dl
rm
sdist.py
7183
0644
edit
dl
rm
sdist.pyc
8309
0644
edit
dl
rm
sdist.pyo
8309
0644
edit
dl
rm
setopt.py
5053
0644
edit
dl
rm
setopt.pyc
6063
0644
edit
dl
rm
setopt.pyo
6063
0644
edit
dl
rm
test.py
5110
0644
edit
dl
rm
test.pyc
5442
0644
edit
dl
rm
test.pyo
5442
0644
edit
dl
rm
upload.py
6681
0644
edit
dl
rm
upload.pyc
6408
0644
edit
dl
rm
upload.pyo
6375
0644
edit
dl
rm
upload_docs.py
5507
0644
edit
dl
rm
upload_docs.pyc
5741
0644
edit
dl
rm
upload_docs.pyo
5708
0644
edit
dl
rm
__init__.py
690
0644
edit
dl
rm
__init__.pyc
915
0644
edit
dl
rm
__init__.pyo
915
0644
edit
dl
rm
Edit:
/usr/lib/python2.6/site-packages/setuptools/command/sdist.py
(7183B)
from distutils.command.sdist import sdist as _sdist from distutils.util import convert_path from distutils import log import os, re, sys, pkg_resources from glob import glob entities = [ ("<","<"), (">", ">"), (""", '"'), ("'", "'"), ("&", "&") ] def unescape(data): for old,new in entities: data = data.replace(old,new) return data def re_finder(pattern, postproc=None): def find(dirname, filename): f = open(filename,'rU') data = f.read() f.close() for match in pattern.finditer(data): path = match.group(1) if postproc: path = postproc(path) yield joinpath(dirname,path) return find def joinpath(prefix,suffix): if not prefix: return suffix return os.path.join(prefix,suffix) def walk_revctrl(dirname=''): """Find all files under revision control""" for ep in pkg_resources.iter_entry_points('setuptools.file_finders'): for item in ep.load()(dirname): yield item def _default_revctrl(dirname=''): for path, finder in finders: path = joinpath(dirname,path) if os.path.isfile(path): for path in finder(dirname,path): if os.path.isfile(path): yield path elif os.path.isdir(path): for item in _default_revctrl(path): yield item def externals_finder(dirname, filename): """Find any 'svn:externals' directories""" found = False f = open(filename,'rt') for line in iter(f.readline, ''): # can't use direct iter! parts = line.split() if len(parts)==2: kind,length = parts data = f.read(int(length)) if kind=='K' and data=='svn:externals': found = True elif kind=='V' and found: f.close() break else: f.close() return for line in data.splitlines(): parts = line.split() if parts: yield joinpath(dirname, parts[0]) entries_pattern = re.compile(r'name="([^"]+)"(?![^>]+deleted="true")', re.I) def entries_finder(dirname, filename): f = open(filename,'rU') data = f.read() f.close() if data.startswith('10') or data.startswith('9') or data.startswith('8'): for record in map(str.splitlines, data.split('\n\x0c\n')[1:]): # subversion 1.6/1.5/1.4 if not record or len(record)>=6 and record[5]=="delete": continue # skip deleted yield joinpath(dirname, record[0]) elif data.startswith('<?xml'): for match in entries_pattern.finditer(data): yield joinpath(dirname,unescape(match.group(1))) else: log.warn("unrecognized .svn/entries format in %s", dirname) finders = [ (convert_path('CVS/Entries'), re_finder(re.compile(r"^\w?/([^/]+)/", re.M))), (convert_path('.svn/entries'), entries_finder), (convert_path('.svn/dir-props'), externals_finder), (convert_path('.svn/dir-prop-base'), externals_finder), # svn 1.4 ] class sdist(_sdist): """Smart sdist that finds anything supported by revision control""" user_options = [ ('formats=', None, "formats for source distribution (comma-separated list)"), ('keep-temp', 'k', "keep the distribution tree around after creating " + "archive file(s)"), ('dist-dir=', 'd', "directory to put the source distribution archive(s) in " "[default: dist]"), ] negative_opt = {} def run(self): self.run_command('egg_info') ei_cmd = self.get_finalized_command('egg_info') self.filelist = ei_cmd.filelist self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt')) self.check_readme() self.check_metadata() self.make_distribution() dist_files = getattr(self.distribution,'dist_files',[]) for file in self.archive_files: data = ('sdist', '', file) if data not in dist_files: dist_files.append(data) def add_defaults(self): standards = [('README', 'README.txt'), self.distribution.script_name] for fn in standards: if isinstance(fn, tuple): alts = fn got_it = 0 for fn in alts: if os.path.exists(fn): got_it = 1 self.filelist.append(fn) break if not got_it: self.warn("standard file not found: should have one of " + ', '.join(alts)) else: if os.path.exists(fn): self.filelist.append(fn) else: self.warn("standard file '%s' not found" % fn) optional = ['test/test*.py', 'setup.cfg'] for pattern in optional: files = filter(os.path.isfile, glob(pattern)) if files: self.filelist.extend(files) # getting python files if self.distribution.has_pure_modules(): build_py = self.get_finalized_command('build_py') self.filelist.extend(build_py.get_source_files()) if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) if self.distribution.has_c_libraries(): build_clib = self.get_finalized_command('build_clib') self.filelist.extend(build_clib.get_source_files()) if self.distribution.has_scripts(): build_scripts = self.get_finalized_command('build_scripts') self.filelist.extend(build_scripts.get_source_files()) def read_template(self): try: _sdist.read_template(self) except: # grody hack to close the template file (MANIFEST.in) # this prevents easy_install's attempt at deleting the file from # dying and thus masking the real error sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close() raise def check_readme(self): alts = ("README", "README.txt") for f in alts: if os.path.exists(f): return else: self.warn( "standard file not found: should have one of " +', '.join(alts) ) def make_release_tree(self, base_dir, files): _sdist.make_release_tree(self, base_dir, files) # Save any egg_info command line options used to create this sdist dest = os.path.join(base_dir, 'setup.cfg') if hasattr(os,'link') and os.path.exists(dest): # unlink and re-copy, since it might be hard-linked, and # we don't want to change the source version os.unlink(dest) self.copy_file('setup.cfg', dest) self.get_finalized_command('egg_info').save_version_info(dest) #
Save
cmd:
run