REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.70 KB
Close
//opt/alt/python34/lib/python3.4/site-packages/pip/commands/show.py
Text
Base64
import os from pip.basecommand import Command from pip.log import logger from pip._vendor import pkg_resources class ShowCommand(Command): """Show information about one or more installed packages.""" name = 'show' usage = """ %prog [options] <package> ...""" summary = 'Show information about installed packages.' def __init__(self, *args, **kw): super(ShowCommand, self).__init__(*args, **kw) self.cmd_opts.add_option( '-f', '--files', dest='files', action='store_true', default=False, help='Show the full list of installed files for each package.') self.parser.insert_option_group(0, self.cmd_opts) def run(self, options, args): if not args: logger.warn('ERROR: Please provide a package name or names.') return query = args results = search_packages_info(query) print_results(results, options.files) def search_packages_info(query): """ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. """ installed_packages = dict( [(p.project_name.lower(), p) for p in pkg_resources.working_set]) for name in query: normalized_name = name.lower() if normalized_name in installed_packages: dist = installed_packages[normalized_name] package = { 'name': dist.project_name, 'version': dist.version, 'location': dist.location, 'requires': [dep.project_name for dep in dist.requires()], } filelist = os.path.join( dist.location, dist.egg_name() + '.egg-info', 'installed-files.txt') if os.path.isfile(filelist): package['files'] = filelist yield package def print_results(distributions, list_all_files): """ Print the informations from installed distributions found. """ for dist in distributions: logger.notify("---") logger.notify("Name: %s" % dist['name']) logger.notify("Version: %s" % dist['version']) logger.notify("Location: %s" % dist['location']) logger.notify("Requires: %s" % ', '.join(dist['requires'])) if list_all_files: logger.notify("Files:") if 'files' in dist: for line in open(dist['files']): logger.notify(" %s" % line.strip()) else: logger.notify("Cannot locate installed-files.txt")
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2024-03-03 22:37:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bundle.py
1.75 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
completion.py
1.79 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
freeze.py
4.55 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
help.py
927 B
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
install.py
13.46 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
list.py
6.65 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
search.py
4.63 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
show.py
2.70 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
uninstall.py
2.15 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
unzip.py
185 B
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
wheel.py
7.53 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
zip.py
14.47 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
2.18 KB
lrw-r--r--
2023-11-13 21:20:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).