Orbits
1
|
Classes | |
class | _Inf |
Functions | |
def | get_prog |
def | rmtree |
def | rmtree_errorhandler |
def | display_path |
def | backup_dir |
def | find_command |
def | get_pathext |
def | ask_path_exists |
def | ask |
def | normalize_name |
def | format_size |
def | is_installable_dir |
def | is_svn_page |
def | file_contents |
def | split_leading_dir |
def | has_leading_dir |
def | make_path_relative |
def | normalize_path |
def | splitext |
def | renames |
def | is_local |
def | dist_is_local |
def | dist_in_usersite |
def | dist_in_site_packages |
def | dist_is_editable |
def | get_installed_distributions |
def | egg_link_path |
def | dist_location |
def | get_terminal_size |
def | current_umask |
def | unzip_file |
def | untar_file |
def | create_download_cache_folder |
def | cache_download |
def | unpack_file |
def | call_subprocess |
def | is_prerelease |
Variables | |
list | __all__ |
tuple | Inf = _Inf() |
tuple | _normalize_re = re.compile(r'[^a-z]', re.I) |
def pip.util.ask | ( | message, | |
options | |||
) |
Ask the message interactively, with the given possible responses
def pip.util.ask_path_exists | ( | message, | |
options | |||
) |
def pip.util.backup_dir | ( | dir, | |
ext = '.bak' |
|||
) |
Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc)
def pip.util.cache_download | ( | target_file, | |
temp_location, | |||
content_type | |||
) |
def pip.util.call_subprocess | ( | cmd, | |
show_stdout = True , |
|||
filter_stdout = None , |
|||
cwd = None , |
|||
raise_on_returncode = True , |
|||
command_level = logger.DEBUG , |
|||
command_desc = None , |
|||
extra_environ = None |
|||
) |
def pip.util.create_download_cache_folder | ( | folder | ) |
def pip.util.current_umask | ( | ) |
Get the current umask which involves having to set it temporarily.
def pip.util.display_path | ( | path | ) |
Gives the display value for a given path, making it relative to cwd if possible.
def pip.util.dist_in_site_packages | ( | dist | ) |
Return True if given Distribution is installed in distutils.sysconfig.get_python_lib().
def pip.util.dist_in_usersite | ( | dist | ) |
Return True if given Distribution is installed in user site.
def pip.util.dist_is_editable | ( | dist | ) |
Is distribution an editable install?
def pip.util.dist_is_local | ( | dist | ) |
Return True if given Distribution object is installed locally (i.e. within current virtualenv). Always True if we're not in a virtualenv.
def pip.util.dist_location | ( | dist | ) |
Get the site-packages location of this distribution. Generally this is dist.location, except in the case of develop-installed packages, where dist.location is the source code location, and we want to know where the egg-link file is.
def pip.util.egg_link_path | ( | dist | ) |
Return the path for the .egg-link file if it exists, otherwise, None. There's 3 scenarios: 1) not in a virtualenv try to find in site.USER_SITE, then site_packages 2) in a no-global virtualenv try to find in site_packages 3) in a yes-global virtualenv try to find in site_packages, then site.USER_SITE (don't look in global location) For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations. This method will just return the first one found.
def pip.util.file_contents | ( | filename | ) |
def pip.util.find_command | ( | cmd, | |
paths = None , |
|||
pathext = None |
|||
) |
Searches the PATH for the given command and returns its path
def pip.util.format_size | ( | bytes | ) |
def pip.util.get_installed_distributions | ( | local_only = True , |
|
skip = ('setuptools', 'pip' , |
|||
python, | |||
distribute, | |||
include_editables = True , |
|||
editables_only = False |
|||
) |
Return a list of installed Distribution objects. If ``local_only`` is True (default), only return installations local to the current virtualenv, if in a virtualenv. ``skip`` argument is an iterable of lower-case project names to ignore; defaults to ('setuptools', 'pip', 'python'). [FIXME also skip virtualenv?] If ``editables`` is False, don't report editables. If ``editables_only`` is True , only report editables.
def pip.util.get_pathext | ( | default_pathext = None | ) |
Returns the path extensions from environment or a default
def pip.util.get_prog | ( | ) |
def pip.util.get_terminal_size | ( | ) |
Returns a tuple (x, y) representing the width(x) and the height(x) in characters of the terminal window.
def pip.util.has_leading_dir | ( | paths | ) |
Returns true if all the paths have the same leading path name (i.e., everything is in one subdirectory in an archive)
def pip.util.is_installable_dir | ( | path | ) |
Return True if `path` is a directory containing a setup.py file.
def pip.util.is_local | ( | path | ) |
Return True if path is within sys.prefix, if we're running in a virtualenv. If we're not in a virtualenv, all paths are considered "local."
def pip.util.is_prerelease | ( | vers | ) |
Attempt to determine if this is a pre-release using PEP386/PEP426 rules. Will return True if it is a pre-release and False if not. Versions are assumed to be a pre-release if they cannot be parsed.
def pip.util.is_svn_page | ( | html | ) |
Returns true if the page appears to be the index page of an svn repository
def pip.util.make_path_relative | ( | path, | |
rel_to | |||
) |
Make a filename relative, where the filename path, and it is relative to rel_to >>> make_relative_path('/usr/share/something/a-file.pth', ... '/usr/share/another-place/src/Directory') '../../../something/a-file.pth' >>> make_relative_path('/usr/share/something/a-file.pth', ... '/home/user/src/Directory') '../../../usr/share/something/a-file.pth' >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/') 'a-file.pth'
def pip.util.normalize_name | ( | name | ) |
def pip.util.normalize_path | ( | path | ) |
Convert a path to its canonical, case-normalized, absolute version.
def pip.util.renames | ( | old, | |
new | |||
) |
Like os.renames(), but handles renaming across devices.
def pip.util.rmtree | ( | dir, | |
ignore_errors = False |
|||
) |
def pip.util.rmtree_errorhandler | ( | func, | |
path, | |||
exc_info | |||
) |
On Windows, the files in .svn are read-only, so when rmtree() tries to remove them, an exception is thrown. We catch that here, remove the read-only attribute, and hopefully continue without problems.
def pip.util.split_leading_dir | ( | path | ) |
def pip.util.splitext | ( | path | ) |
Like os.path.splitext, but take off .tar too
def pip.util.unpack_file | ( | filename, | |
location, | |||
content_type, | |||
link | |||
) |
def pip.util.untar_file | ( | filename, | |
location | |||
) |
Untar the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions are not preserved), except that regular file members with any execute permissions (user, group, or world) have "chmod +x" applied after being written. Note that for windows, any execute changes using os.chmod are no-ops per the python docs.
def pip.util.unzip_file | ( | filename, | |
location, | |||
flatten = True |
|||
) |
Unzip the file (with path `filename`) to the destination `location`. All files are written based on system defaults and umask (i.e. permissions are not preserved), except that regular file members with any execute permissions (user, group, or world) have "chmod +x" applied after being written. Note that for windows, any execute changes using os.chmod are no-ops per the python docs.
list pip.util.__all__ |
tuple pip.util._normalize_re = re.compile(r'[^a-z]', re.I) |
tuple pip.util.Inf = _Inf() |
Copyright 2014 Google Inc. All rights reserved.