/
opt
/
alt
/
python33
/
lib
/
python3.3
/
site-packages
/
pip
/
commands
/
/opt/alt/python33/lib/python3.3/site-packages/pip/commands
mkdir
upload
Name
Size
Mode
Actions
__pycache__/
-
0755
rm
bundle.py
1787
0644
edit
dl
rm
bundle.pyc
2280
0644
edit
dl
rm
bundle.pyo
2280
0644
edit
dl
rm
completion.py
1838
0644
edit
dl
rm
completion.pyc
2452
0644
edit
dl
rm
completion.pyo
2452
0644
edit
dl
rm
freeze.py
4664
0644
edit
dl
rm
freeze.pyc
4624
0644
edit
dl
rm
freeze.pyo
4624
0644
edit
dl
rm
help.py
927
0644
edit
dl
rm
help.pyc
1334
0644
edit
dl
rm
help.pyo
1334
0644
edit
dl
rm
install.py
13780
0644
edit
dl
rm
install.pyc
10449
0644
edit
dl
rm
install.pyo
10449
0644
edit
dl
rm
list.py
6814
0644
edit
dl
rm
list.pyc
6616
0644
edit
dl
rm
list.pyo
6616
0644
edit
dl
rm
search.py
4736
0644
edit
dl
rm
search.pyc
5546
0644
edit
dl
rm
search.pyo
5546
0644
edit
dl
rm
show.py
2767
0644
edit
dl
rm
show.pyc
3471
0644
edit
dl
rm
show.pyo
3471
0644
edit
dl
rm
uninstall.py
2203
0644
edit
dl
rm
uninstall.pyc
2716
0644
edit
dl
rm
uninstall.pyo
2716
0644
edit
dl
rm
unzip.py
185
0644
edit
dl
rm
unzip.pyc
577
0644
edit
dl
rm
unzip.pyo
577
0644
edit
dl
rm
wheel.py
7714
0644
edit
dl
rm
wheel.pyc
6327
0644
edit
dl
rm
wheel.pyo
6327
0644
edit
dl
rm
zip.py
14821
0644
edit
dl
rm
zip.pyc
12160
0644
edit
dl
rm
zip.pyo
12160
0644
edit
dl
rm
__init__.py
2236
0644
edit
dl
rm
__init__.pyc
2689
0644
edit
dl
rm
__init__.pyo
2689
0644
edit
dl
rm
Edit:
/opt/alt/python33/lib/python3.3/site-packages/pip/commands/freeze.py
(4664B)
import re import sys import pip from pip.req import InstallRequirement from pip.log import logger from pip.basecommand import Command from pip.util import get_installed_distributions from pip._vendor import pkg_resources class FreezeCommand(Command): """Output installed packages in requirements format.""" name = 'freeze' usage = """ %prog [options]""" summary = 'Output installed packages in requirements format.' def __init__(self, *args, **kw): super(FreezeCommand, self).__init__(*args, **kw) self.cmd_opts.add_option( '-r', '--requirement', dest='requirement', action='store', default=None, metavar='file', help="Use the order in the given requirements file and it's comments when generating output.") self.cmd_opts.add_option( '-f', '--find-links', dest='find_links', action='append', default=[], metavar='URL', help='URL for finding packages, which will be added to the output.') self.cmd_opts.add_option( '-l', '--local', dest='local', action='store_true', default=False, help='If in a virtualenv that has global access, do not output globally-installed packages.') self.parser.insert_option_group(0, self.cmd_opts) def setup_logging(self): logger.move_stdout_to_stderr() def run(self, options, args): requirement = options.requirement find_links = options.find_links or [] local_only = options.local ## FIXME: Obviously this should be settable: find_tags = False skip_match = None skip_regex = options.skip_requirements_regex if skip_regex: skip_match = re.compile(skip_regex) dependency_links = [] f = sys.stdout for dist in pkg_resources.working_set: if dist.has_metadata('dependency_links.txt'): dependency_links.extend(dist.get_metadata_lines('dependency_links.txt')) for link in find_links: if '#egg=' in link: dependency_links.append(link) for link in find_links: f.write('-f %s\n' % link) installations = {} for dist in get_installed_distributions(local_only=local_only): req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags) installations[req.name] = req if requirement: req_f = open(requirement) for line in req_f: if not line.strip() or line.strip().startswith('#'): f.write(line) continue if skip_match and skip_match.search(line): f.write(line) continue elif line.startswith('-e') or line.startswith('--editable'): if line.startswith('-e'): line = line[2:].strip() else: line = line[len('--editable'):].strip().lstrip('=') line_req = InstallRequirement.from_editable(line, default_vcs=options.default_vcs) elif (line.startswith('-r') or line.startswith('--requirement') or line.startswith('-Z') or line.startswith('--always-unzip') or line.startswith('-f') or line.startswith('-i') or line.startswith('--extra-index-url') or line.startswith('--find-links') or line.startswith('--index-url')): f.write(line) continue else: line_req = InstallRequirement.from_line(line) if not line_req.name: logger.notify("Skipping line because it's not clear what it would install: %s" % line.strip()) logger.notify(" (add #egg=PackageName to the URL to avoid this warning)") continue if line_req.name not in installations: logger.warn("Requirement file contains %s, but that package is not installed" % line.strip()) continue f.write(str(installations[line_req.name])) del installations[line_req.name] f.write('## The following requirements were added by pip --freeze:\n') for installation in sorted(installations.values(), key=lambda x: x.name): f.write(str(installation))
Save
cmd:
run