Commits

Sean Summers  committed 3bfda9b

initial commit

  • Participants

Comments (0)

Files changed (84)

+syntax: glob
+*.class
+*.pkc
+*.idx
+*.swp

File Lib/UserDict.py

+/usr/local/jython2.7a2/Lib/UserDict.py

File Lib/_abcoll.py

+/usr/local/jython2.7a2/Lib/_abcoll.py

File Lib/_weakrefset.py

+/usr/local/jython2.7a2/Lib/_weakrefset.py
+/usr/local/jython2.7a2/Lib/abc.py

File Lib/codecs.py

+/usr/local/jython2.7a2/Lib/codecs.py

File Lib/copy_reg.py

+/usr/local/jython2.7a2/Lib/copy_reg.py

File Lib/distutils/__init__.py

+import os
+import sys
+import warnings 
+import imp
+import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
+              # Important! To work on pypy, this must be a module that resides in the
+              # lib-python/modified-x.y.z directory
+
+dirname = os.path.dirname
+
+distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils')
+if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)):
+    warnings.warn(
+        "The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
+else:
+    __path__.insert(0, distutils_path)
+    real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY))
+    # Copy the relevant attributes
+    try:
+        __revision__ = real_distutils.__revision__
+    except AttributeError:
+        pass
+    __version__ = real_distutils.__version__
+
+from distutils import dist, sysconfig
+
+try:
+    basestring
+except NameError:
+    basestring = str
+
+## patch build_ext (distutils doesn't know how to get the libs directory
+## path on windows - it hardcodes the paths around the patched sys.prefix)
+
+if sys.platform == 'win32':
+    from distutils.command.build_ext import build_ext as old_build_ext
+    class build_ext(old_build_ext):
+        def finalize_options (self):
+            if self.library_dirs is None:
+                self.library_dirs = []
+            elif isinstance(self.library_dirs, basestring):
+                self.library_dirs = self.library_dirs.split(os.pathsep)
+            
+            self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs"))
+            old_build_ext.finalize_options(self)
+            
+    from distutils.command import build_ext as build_ext_module 
+    build_ext_module.build_ext = build_ext
+
+## distutils.dist patches:
+
+old_find_config_files = dist.Distribution.find_config_files
+def find_config_files(self):
+    found = old_find_config_files(self)
+    system_distutils = os.path.join(distutils_path, 'distutils.cfg')
+    #if os.path.exists(system_distutils):
+    #    found.insert(0, system_distutils)
+        # What to call the per-user config file
+    if os.name == 'posix':
+        user_filename = ".pydistutils.cfg"
+    else:
+        user_filename = "pydistutils.cfg"
+    user_filename = os.path.join(sys.prefix, user_filename)
+    if os.path.isfile(user_filename):
+        for item in list(found):
+            if item.endswith('pydistutils.cfg'):
+                found.remove(item)
+        found.append(user_filename)
+    return found
+dist.Distribution.find_config_files = find_config_files
+
+## distutils.sysconfig patches:
+
+old_get_python_inc = sysconfig.get_python_inc
+def sysconfig_get_python_inc(plat_specific=0, prefix=None):
+    if prefix is None:
+        prefix = sys.real_prefix
+    return old_get_python_inc(plat_specific, prefix)
+sysconfig_get_python_inc.__doc__ = old_get_python_inc.__doc__
+sysconfig.get_python_inc = sysconfig_get_python_inc
+
+old_get_python_lib = sysconfig.get_python_lib
+def sysconfig_get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+    if standard_lib and prefix is None:
+        prefix = sys.real_prefix
+    return old_get_python_lib(plat_specific, standard_lib, prefix)
+sysconfig_get_python_lib.__doc__ = old_get_python_lib.__doc__
+sysconfig.get_python_lib = sysconfig_get_python_lib
+
+old_get_config_vars = sysconfig.get_config_vars
+def sysconfig_get_config_vars(*args):
+    real_vars = old_get_config_vars(*args)
+    if sys.platform == 'win32':
+        lib_dir = os.path.join(sys.real_prefix, "libs")
+        if isinstance(real_vars, dict) and 'LIBDIR' not in real_vars:
+            real_vars['LIBDIR'] = lib_dir # asked for all
+        elif isinstance(real_vars, list) and 'LIBDIR' in args:
+            real_vars = real_vars + [lib_dir] # asked for list
+    return real_vars
+sysconfig_get_config_vars.__doc__ = old_get_config_vars.__doc__
+sysconfig.get_config_vars = sysconfig_get_config_vars

File Lib/distutils/distutils.cfg

+# This is a config file local to this virtualenv installation
+# You may include options that will be used by all distutils commands,
+# and by easy_install.  For instance:
+#
+#   [easy_install]
+#   find_links = http://mylocalsite

File Lib/encodings

+/usr/local/jython2.7a2/Lib/encodings

File Lib/fnmatch.py

+/usr/local/jython2.7a2/Lib/fnmatch.py

File Lib/genericpath.py

+/usr/local/jython2.7a2/Lib/genericpath.py

File Lib/linecache.py

+/usr/local/jython2.7a2/Lib/linecache.py

File Lib/locale.py

+/usr/local/jython2.7a2/Lib/locale.py

File Lib/no-global-site-packages.txt

Empty file added.

File Lib/ntpath.py

+/usr/local/jython2.7a2/Lib/ntpath.py

File Lib/orig-prefix.txt

+/usr/local/jython2.7a2
+/usr/local/jython2.7a2/Lib/os.py

File Lib/posixpath.py

+/usr/local/jython2.7a2/Lib/posixpath.py
+/usr/local/jython2.7a2/Lib/re.py

File Lib/readline.py

+/usr/local/jython2.7a2/Lib/readline.py

File Lib/site-packages/easy-install.pth

+import sys; sys.__plen = len(sys.path)
+./setuptools-0.6c11-py2.7.egg
+./pip-1.2.1-py2.7.egg
+import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

File Lib/site-packages/pip-1.2.1-py2.7.egg/EGG-INFO/PKG-INFO

+Metadata-Version: 1.1
+Name: pip
+Version: 1.2.1
+Summary: pip installs packages. Python packages. An easy_install replacement
+Home-page: http://www.pip-installer.org
+Author: The pip developers
+Author-email: python-virtualenv@groups.google.com
+License: MIT
+Description: pip
+        ===
+        
+        `pip` is a tool for installing and managing Python packages, such as
+        those found in the `Python Package Index`_. It's a replacement for
+        easy_install_.
+        ::
+        
+            $ pip install simplejson
+            [... progress report ...]
+            Successfully installed simplejson
+        
+        .. _`Python Package Index`: http://pypi.python.org/pypi
+        .. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall
+        
+        Upgrading a package::
+        
+            $ pip install --upgrade simplejson
+            [... progress report ...]
+            Successfully installed simplejson
+        
+        Removing a package::
+        
+            $ pip uninstall simplejson
+            Uninstalling simplejson:
+              /home/me/env/lib/python2.7/site-packages/simplejson
+              /home/me/env/lib/python2.7/site-packages/simplejson-2.2.1-py2.7.egg-info
+            Proceed (y/n)? y
+              Successfully uninstalled simplejson
+        
+        .. comment: 
+        
+        The main website for pip is `www.pip-installer.org
+        <http://www.pip-installer.org>`_. You can also install
+        the `in-development version <https://github.com/pypa/pip/tarball/develop#egg=pip-dev>`_
+        of pip with ``easy_install pip==dev``.
+        
+        
+        
+        Community
+        ---------
+        
+        The homepage for pip is at `pip-installer.org <http://www.pip-installer.org/>`_.
+        Bugs can be filed in the `pip issue tracker
+        <https://github.com/pypa/pip/issues/>`_.  Discussion happens on the
+        `virtualenv email group
+        <http://groups.google.com/group/python-virtualenv?hl=en>`_.
+        
+        
+        ====
+        News
+        ====
+        
+        Changelog
+        =========
+        
+        Next release (1.3) schedule
+        ---------------------------
+        
+        Beta and final releases planned for the end of 2012.
+        
+        1.2.1 (2012-09-06)
+        ------------------
+        
+        * Fixed a regression introduced in 1.2 about raising an exception when
+          not finding any files to uninstall in the current environment. Thanks for
+          the fix, Marcus Smith.
+        
+        1.2 (2012-09-01)
+        ----------------
+        
+        * **Dropped support for Python 2.4** The minimum supported Python version is
+          now Python 2.5.
+        
+        * Fixed issue #605 - pypi mirror support broken on some DNS responses. Thanks
+          philwhin.
+        
+        * Fixed issue #355 - pip uninstall removes files it didn't install. Thanks
+          pjdelport.
+        
+        * Fixed issues #493, #494, #440, and #573 related to improving support for the
+          user installation scheme. Thanks Marcus Smith.
+        
+        * Write failure log to temp file if default location is not writable. Thanks
+          andreigc.
+        
+        * Pull in submodules for git editable checkouts. Fixes #289 and #421. Thanks
+          Hsiaoming Yang and Markus Hametner.
+        
+        * Use a temporary directory as the default build location outside of a
+          virtualenv. Fixes issues #339 and #381. Thanks TC01.
+        
+        * Added support for specifying extras with local editables. Thanks Nick
+          Stenning.
+        
+        * Added ``--egg`` flag to request egg-style rather than flat installation. Refs
+          issue #3. Thanks Kamal Bin Mustafa.
+        
+        * Fixed issue #510 - prevent e.g. ``gmpy2-2.0.tar.gz`` from matching a request
+          to ``pip install gmpy``; sdist filename must begin with full project name
+          followed by a dash. Thanks casevh for the report.
+        
+        * Fixed issue #504 - allow package URLS to have querystrings. Thanks W.
+          Trevor King.
+        
+        * Fixed issue #58 - pip freeze now falls back to non-editable format rather
+          than blowing up if it can't determine the origin repository of an editable.
+          Thanks Rory McCann.
+        
+        * Added a `__main__.py` file to enable `python -m pip` on Python versions
+          that support it. Thanks Alexey Luchko.
+        
+        * Fixed issue #487 - upgrade from VCS url of project that does exist on
+          index. Thanks Andrew Knapp for the report.
+        
+        * Fixed issue #486 - fix upgrade from VCS url of project with no distribution
+          on index.  Thanks Andrew Knapp for the report.
+        
+        * Fixed issue #427 - clearer error message on a malformed VCS url. Thanks
+          Thomas Fenzl.
+        
+        * Added support for using any of the built in guaranteed algorithms in
+          ``hashlib`` as a checksum hash.
+        
+        * Fixed issue #321 - Raise an exception if current working directory can't be
+          found or accessed.
+        
+        * Fixed issue #82 - Removed special casing of the user directory and use the
+          Python default instead.
+        
+        * Fixed #436 - Only warn about version conflicts if there is actually one.
+          This re-enables using ``==dev`` in requirements files.
+        
+        * Moved tests to be run on Travis CI: http://travis-ci.org/pypa/pip
+        
+        * Added a better help formatter.
+        
+        1.1 (2012-02-16)
+        ----------------
+        
+        * Fixed issue #326 - don't crash when a package's setup.py emits UTF-8 and
+          then fails. Thanks Marc Abramowitz.
+        
+        * Added ``--target`` option for installing directly to arbitrary directory.
+          Thanks Stavros Korokithakis.
+        
+        * Added support for authentication with Subversion repositories. Thanks
+          Qiangning Hong.
+        
+        * Fixed issue #315 - ``--download`` now downloads dependencies as well.
+          Thanks Qiangning Hong.
+        
+        * Errors from subprocesses will display the current working directory.
+          Thanks Antti Kaihola.
+        
+        * Fixed issue #369 - compatibility with Subversion 1.7. Thanks Qiangning
+          Hong. Note that setuptools remains incompatible with Subversion 1.7; to
+          get the benefits of pip's support you must use Distribute rather than
+          setuptools.
+        
+        * Fixed issue #57 - ignore py2app-generated OS X mpkg zip files in finder.
+          Thanks Rene Dudfield.
+        
+        * Fixed issue #182 - log to ~/Library/Logs/ by default on OS X framework
+          installs. Thanks Dan Callahan for report and patch.
+        
+        * Fixed issue #310 - understand version tags without minor version ("py3")
+          in sdist filenames. Thanks Stuart Andrews for report and Olivier Girardot for
+          patch.
+        
+        * Fixed issue #7 - Pip now supports optionally installing setuptools
+          "extras" dependencies; e.g. "pip install Paste[openid]". Thanks Matt Maker
+          and Olivier Girardot.
+        
+        * Fixed issue #391 - freeze no longer borks on requirements files with
+          --index-url or --find-links. Thanks Herbert Pfennig.
+        
+        * Fixed issue #288 - handle symlinks properly. Thanks lebedov for the patch.
+        
+        * Fixed issue #49 - pip install -U no longer reinstalls the same versions of
+          packages. Thanks iguananaut for the pull request.
+        
+        * Removed ``-E``/``--environment`` option and ``PIP_RESPECT_VIRTUALENV``;
+          both use a restart-in-venv mechanism that's broken, and neither one is
+          useful since every virtualenv now has pip inside it.  Replace ``pip -E
+          path/to/venv install Foo`` with ``virtualenv path/to/venv &&
+          path/to/venv/pip install Foo``.
+        
+        * Fixed issue #366 - pip throws IndexError when it calls `scraped_rel_links`
+        
+        * Fixed issue #22 - pip search should set and return a userful shell status code
+        
+        * Fixed issue #351 and #365 - added global ``--exists-action`` command line
+          option to easier script file exists conflicts, e.g. from editable
+          requirements from VCS that have a changed repo URL.
+        
+        
+        1.0.2 (2011-07-16)
+        ------------------
+        
+        * Fixed docs issues.
+        * Fixed issue #295 - Reinstall a package when using the ``install -I`` option
+        * Fixed issue #283 - Finds a Git tag pointing to same commit as origin/master
+        * Fixed issue #279 - Use absolute path for path to docs in setup.py
+        * Fixed issue #314 - Correctly handle exceptions on Python3.
+        * Fixed issue #320 - Correctly parse ``--editable`` lines in requirements files
+        
+        1.0.1 (2011-04-30)
+        ------------------
+        
+        * Start to use git-flow.
+        * Fixed issue #274 - `find_command` should not raise AttributeError
+        * Fixed issue #273 - respect Content-Disposition header. Thanks Bradley Ayers.
+        * Fixed issue #233 - pathext handling on Windows.
+        * Fixed issue #252 - svn+svn protocol.
+        * Fixed issue #44 - multiple CLI searches.
+        * Fixed issue #266 - current working directory when running setup.py clean.
+        
+        1.0 (2011-04-04)
+        ----------------
+        
+        * Added Python 3 support! Huge thanks to Vinay Sajip, Vitaly Babiy, Kelsey
+          Hightower, and Alex Gronholm, among others.
+        
+        * Download progress only shown on a real TTY. Thanks Alex Morega.
+        
+        * Fixed finding of VCS binaries to not be fooled by same-named directories.
+          Thanks Alex Morega.
+        
+        * Fixed uninstall of packages from system Python for users of Debian/Ubuntu
+          python-setuptools package (workaround until fixed in Debian and Ubuntu).
+        
+        * Added `get-pip.py <https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_
+          installer. Simply download and execute it, using the Python interpreter of
+          your choice::
+        
+            $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
+            $ python get-pip.py
+        
+          This may have to be run as root.
+        
+          .. note::
+        
+              Make sure you have `distribute <http://pypi.python.org/pypi/distribute>`_
+              installed before using the installer!
+        
+        0.8.3
+        -----
+        
+        * Moved main repository to Github: https://github.com/pypa/pip
+        
+        * Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer, Brian Rosner
+        
+        * Fixed issue #14 - No uninstall-on-upgrade with URL package. Thanks Oliver Tonnhofer
+        
+        * Fixed issue #163 - Egg name not properly resolved. Thanks Igor Sobreira
+        
+        * Fixed issue #178 - Non-alphabetical installation of requirements. Thanks Igor Sobreira
+        
+        * Fixed issue #199 - Documentation mentions --index instead of --index-url. Thanks Kelsey Hightower
+        
+        * Fixed issue #204 - rmtree undefined in mercurial.py. Thanks Kelsey Hightower
+        
+        * Fixed bug in Git vcs backend that would break during reinstallation.
+        
+        * Fixed bug in Mercurial vcs backend related to pip freeze and branch/tag resolution.
+        
+        * Fixed bug in version string parsing related to the suffix "-dev".
+        
+        0.8.2
+        -----
+        
+        * Avoid redundant unpacking of bundles (from pwaller)
+        
+        * Fixed issue #32, #150, #161 - Fixed checking out the correct
+          tag/branch/commit when updating an editable Git requirement.
+        
+        * Fixed issue #49 - Added ability to install version control requirements
+          without making them editable, e.g.::
+        
+            pip install git+https://github.com/pypa/pip/
+        
+        * Fixed issue #175 - Correctly locate build and source directory on Mac OS X.
+        
+        * Added ``git+https://`` scheme to Git VCS backend.
+        
+        0.8.1
+        -----
+        
+        * Added global --user flag as shortcut for --install-option="--user". From
+          Ronny Pfannschmidt.
+        
+        * Added support for `PyPI mirrors <http://pypi.python.org/mirrors>`_ as
+          defined in `PEP 381 <http://www.python.org/dev/peps/pep-0381/>`_, from
+          Jannis Leidel.
+        
+        * Fixed issue #138 - Git revisions ignored. Thanks John-Scott Atlakson.
+        
+        * Fixed issue #95 - Initial editable install of github package from a tag fails. Thanks John-Scott Atlakson.
+        
+        * Fixed issue #107 - Can't install if a directory in cwd has the same name as the package you're installing.
+        
+        * Fixed issue #39 - --install-option="--prefix=~/.local" ignored with -e.
+          Thanks Ronny Pfannschmidt and Wil Tan.
+        
+        
+        
+        0.8
+        ---
+        
+        * Track which ``build/`` directories pip creates, never remove directories
+          it doesn't create.  From Hugo Lopes Tavares.
+        
+        * Pip now accepts file:// index URLs. Thanks Dave Abrahams.
+        
+        * Various cleanup to make test-running more consistent and less fragile.
+          Thanks Dave Abrahams.
+        
+        * Real Windows support (with passing tests). Thanks Dave Abrahams.
+        
+        * ``pip-2.7`` etc. scripts are created (Python-version specific scripts)
+        
+        * ``contrib/build-standalone`` script creates a runnable ``.zip`` form of
+          pip, from Jannis Leidel
+        
+        * Editable git repos are updated when reinstalled
+        
+        * Fix problem with ``--editable`` when multiple ``.egg-info/`` directories
+          are found.
+        
+        * A number of VCS-related fixes for ``pip freeze``, from Hugo Lopes Tavares.
+        
+        * Significant test framework changes, from Hugo Lopes Tavares.
+        
+        0.7.2
+        -----
+        
+        * Set zip_safe=False to avoid problems some people are encountering where
+          pip is installed as a zip file.
+        
+        0.7.1
+        -----
+        
+        * Fixed opening of logfile with no directory name. Thanks Alexandre Conrad.
+        
+        * Temporary files are consistently cleaned up, especially after
+          installing bundles, also from Alex Conrad.
+        
+        * Tests now require at least ScriptTest 1.0.3.
+        
+        0.7
+        ---
+        
+        * Fixed uninstallation on Windows
+        * Added ``pip search`` command.
+        * Tab-complete names of installed distributions for ``pip uninstall``.
+        * Support tab-completion when there is a global-option before the
+          subcommand.
+        * Install header files in standard (scheme-default) location when installing
+          outside a virtualenv. Install them to a slightly more consistent
+          non-standard location inside a virtualenv (since the standard location is
+          a non-writable symlink to the global location).
+        * pip now logs to a central location by default (instead of creating
+          ``pip-log.txt`` all over the place) and constantly overwrites the
+          file in question. On Unix and Mac OS X this is ``'$HOME/.pip/pip.log'``
+          and on Windows it's ``'%HOME%\\pip\\pip.log'``. You are still able to
+          override this location with the ``$PIP_LOG_FILE`` environment variable.
+          For a complete (appended) logfile use the separate ``'--log'`` command line
+          option.
+        * Fixed an issue with Git that left an editable packge as a checkout of a
+          remote branch, even if the default behaviour would have been fine, too.
+        * Fixed installing from a Git tag with older versions of Git.
+        * Expand "~" in logfile and download cache paths.
+        * Speed up installing from Mercurial repositories by cloning without
+          updating the working copy multiple times.
+        * Fixed installing directly from directories (e.g.
+          ``pip install path/to/dir/``).
+        * Fixed installing editable packages with ``svn+ssh`` URLs.
+        * Don't print unwanted debug information when running the freeze command.
+        * Create log file directory automatically. Thanks Alexandre Conrad.
+        * Make test suite easier to run successfully. Thanks Dave Abrahams.
+        * Fixed "pip install ." and "pip install .."; better error for directory
+          without setup.py. Thanks Alexandre Conrad.
+        * Support Debian/Ubuntu "dist-packages" in zip command. Thanks duckx.
+        * Fix relative --src folder. Thanks Simon Cross.
+        * Handle missing VCS with an error message. Thanks Alexandre Conrad.
+        * Added --no-download option to install; pairs with --no-install to separate
+          download and installation into two steps. Thanks Simon Cross.
+        * Fix uninstalling from requirements file containing -f, -i, or
+          --extra-index-url.
+        * Leftover build directories are now removed. Thanks Alexandre Conrad.
+        
+        0.6.3
+        -----
+        
+        * Fixed import error on Windows with regard to the backwards compatibility
+          package
+        
+        0.6.2
+        -----
+        
+        * Fixed uninstall when /tmp is on a different filesystem.
+        
+        * Fixed uninstallation of distributions with namespace packages.
+        
+        0.6.1
+        -----
+        
+        * Added support for the ``https`` and ``http-static`` schemes to the
+          Mercurial and ``ftp`` scheme to the Bazaar backend.
+        
+        * Fixed uninstallation of scripts installed with easy_install.
+        
+        * Fixed an issue in the package finder that could result in an
+          infinite loop while looking for links.
+        
+        * Fixed issue with ``pip bundle`` and local files (which weren't being
+          copied into the bundle), from Whit Morriss.
+        
+        0.6
+        ---
+        
+        * Add ``pip uninstall`` and uninstall-before upgrade (from Carl
+          Meyer).
+        
+        * Extended configurability with config files and environment variables.
+        
+        * Allow packages to be upgraded, e.g., ``pip install Package==0.1``
+          then ``pip install Package==0.2``.
+        
+        * Allow installing/upgrading to Package==dev (fix "Source version does not
+          match target version" errors).
+        
+        * Added command and option completion for bash and zsh.
+        
+        * Extended integration with virtualenv by providing an option to
+          automatically use an active virtualenv and an option to warn if no active
+          virtualenv is found.
+        
+        * Fixed a bug with pip install --download and editable packages, where
+          directories were being set with 0000 permissions, now defaults to 755.
+        
+        * Fixed uninstallation of easy_installed console_scripts.
+        
+        * Fixed uninstallation on Mac OS X Framework layout installs
+        
+        * Fixed bug preventing uninstall of editables with source outside venv.
+        
+        * Creates download cache directory if not existing.
+        
+        0.5.1
+        -----
+        
+        * Fixed a couple little bugs, with git and with extensions.
+        
+        0.5
+        ---
+        
+        * Added ability to override the default log file name (``pip-log.txt``)
+          with the environmental variable ``$PIP_LOG_FILE``.
+        
+        * Made the freeze command print installed packages to stdout instead of
+          writing them to a file. Use simple redirection (e.g.
+          ``pip freeze > stable-req.txt``) to get a file with requirements.
+        
+        * Fixed problem with freezing editable packages from a Git repository.
+        
+        * Added support for base URLs using ``<base href='...'>`` when parsing
+          HTML pages.
+        
+        * Fixed installing of non-editable packages from version control systems.
+        
+        * Fixed issue with Bazaar's bzr+ssh scheme.
+        
+        * Added --download-dir option to the install command to retrieve package
+          archives. If given an editable package it will create an archive of it.
+        
+        * Added ability to pass local file and directory paths to ``--find-links``,
+          e.g. ``--find-links=file:///path/to/my/private/archive``
+        
+        * Reduced the amount of console log messages when fetching a page to find a
+          distribution was problematic. The full messages can be found in pip-log.txt.
+        
+        * Added ``--no-deps`` option to install ignore package dependencies
+        
+        * Added ``--no-index`` option to ignore the package index (PyPI) temporarily
+        
+        * Fixed installing editable packages from Git branches.
+        
+        * Fixes freezing of editable packages from Mercurial repositories.
+        
+        * Fixed handling read-only attributes of build files, e.g. of Subversion and
+          Bazaar on Windows.
+        
+        * When downloading a file from a redirect, use the redirected
+          location's extension to guess the compression (happens specifically
+          when redirecting to a bitbucket.org tip.gz file).
+        
+        * Editable freeze URLs now always use revision hash/id rather than tip or
+          branch names which could move.
+        
+        * Fixed comparison of repo URLs so incidental differences such as
+          presence/absence of final slashes or quoted/unquoted special
+          characters don't trigger "ignore/switch/wipe/backup" choice.
+        
+        * Fixed handling of attempt to checkout editable install to a
+          non-empty, non-repo directory.
+        
+        0.4
+        ---
+        
+        * Make ``-e`` work better with local hg repositories
+        
+        * Construct PyPI URLs the exact way easy_install constructs URLs (you
+          might notice this if you use a custom index that is
+          slash-sensitive).
+        
+        * Improvements on Windows (from `Ionel Maries Cristian
+          <http://ionelmc.wordpress.com/>`_).
+        
+        * Fixed problem with not being able to install private git repositories.
+        
+        * Make ``pip zip`` zip all its arguments, not just the first.
+        
+        * Fix some filename issues on Windows.
+        
+        * Allow the ``-i`` and ``--extra-index-url`` options in requirements
+          files.
+        
+        * Fix the way bundle components are unpacked and moved around, to make
+          bundles work.
+        
+        * Adds ``-s`` option to allow the access to the global site-packages if a
+          virtualenv is to be created.
+        
+        * Fixed support for Subversion 1.6.
+        
+        0.3.1
+        -----
+        
+        * Improved virtualenv restart and various path/cleanup problems on win32.
+        
+        * Fixed a regression with installing from svn repositories (when not
+          using ``-e``).
+        
+        * Fixes when installing editable packages that put their source in a
+          subdirectory (like ``src/``).
+        
+        * Improve ``pip -h``
+        
+        0.3
+        ---
+        
+        * Added support for editable packages created from Git, Mercurial and Bazaar
+          repositories and ability to freeze them. Refactored support for version
+          control systems.
+        
+        * Do not use ``sys.exit()`` from inside the code, instead use a
+          return.  This will make it easier to invoke programmatically.
+        
+        * Put the install record in ``Package.egg-info/installed-files.txt``
+          (previously they went in
+          ``site-packages/install-record-Package.txt``).
+        
+        * Fix a problem with ``pip freeze`` not including ``-e svn+`` when an
+          svn structure is peculiar.
+        
+        * Allow ``pip -E`` to work with a virtualenv that uses a different
+          version of Python than the parent environment.
+        
+        * Fixed Win32 virtualenv (``-E``) option.
+        
+        * Search the links passed in with ``-f`` for packages.
+        
+        * Detect zip files, even when the file doesn't have a ``.zip``
+          extension and it is served with the wrong Content-Type.
+        
+        * Installing editable from existing source now works, like ``pip
+          install -e some/path/`` will install the package in ``some/path/``.
+          Most importantly, anything that package requires will also be
+          installed by pip.
+        
+        * Add a ``--path`` option to ``pip un/zip``, so you can avoid zipping
+          files that are outside of where you expect.
+        
+        * Add ``--simulate`` option to ``pip zip``.
+        
+        0.2.1
+        -----
+        
+        * Fixed small problem that prevented using ``pip.py`` without actually
+          installing pip.
+        
+        * Fixed ``--upgrade``, which would download and appear to install
+          upgraded packages, but actually just reinstall the existing package.
+        
+        * Fixed Windows problem with putting the install record in the right
+          place, and generating the ``pip`` script with Setuptools.
+        
+        * Download links that include embedded spaces or other unsafe
+          characters (those characters get %-encoded).
+        
+        * Fixed use of URLs in requirement files, and problems with some blank
+          lines.
+        
+        * Turn some tar file errors into warnings.
+        
+        0.2
+        ---
+        
+        * Renamed to ``pip``, and to install you now do ``pip install
+          PACKAGE``
+        
+        * Added command ``pip zip PACKAGE`` and ``pip unzip PACKAGE``.  This
+          is particularly intended for Google App Engine to manage libraries
+          to stay under the 1000-file limit.
+        
+        * Some fixes to bundles, especially editable packages and when
+          creating a bundle using unnamed packages (like just an svn
+          repository without ``#egg=Package``).
+        
+        0.1.4
+        -----
+        
+        * Added an option ``--install-option`` to pass options to pass
+          arguments to ``setup.py install``
+        
+        * ``.svn/`` directories are no longer included in bundles, as these
+          directories are specific to a version of svn -- if you build a
+          bundle on a system with svn 1.5, you can't use the checkout on a
+          system with svn 1.4.  Instead a file ``svn-checkout.txt`` is
+          included that notes the original location and revision, and the
+          command you can use to turn it back into an svn checkout.  (Probably
+          unpacking the bundle should, maybe optionally, recreate this
+          information -- but that is not currently implemented, and it would
+          require network access.)
+        
+        * Avoid ambiguities over project name case, where for instance
+          MyPackage and mypackage would be considered different packages.
+          This in particular caused problems on Macs, where ``MyPackage/`` and
+          ``mypackage/`` are the same directory.
+        
+        * Added support for an environmental variable
+          ``$PIP_DOWNLOAD_CACHE`` which will cache package downloads, so
+          future installations won't require large downloads.  Network access
+          is still required, but just some downloads will be avoided when
+          using this.
+        
+        0.1.3
+        -----
+        
+        * Always use ``svn checkout`` (not ``export``) so that
+          ``tag_svn_revision`` settings give the revision of the package.
+        
+        * Don't update checkouts that came from ``.pybundle`` files.
+        
+        0.1.2
+        -----
+        
+        * Improve error text when there are errors fetching HTML pages when
+          seeking packages.
+        
+        * Improve bundles: include empty directories, make them work with
+          editable packages.
+        
+        * If you use ``-E env`` and the environment ``env/`` doesn't exist, a
+          new virtual environment will be created.
+        
+        * Fix ``dependency_links`` for finding packages.
+        
+        0.1.1
+        -----
+        
+        * Fixed a NameError exception when running pip outside of a
+          virtualenv environment.
+        
+        * Added HTTP proxy support (from Prabhu Ramachandran)
+        
+        * Fixed use of ``hashlib.md5`` on python2.5+ (also from Prabhu
+          Ramachandran)
+        
+        0.1
+        ---
+        
+        * Initial release
+        
+Keywords: easy_install distutils setuptools egg virtualenv
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Topic :: Software Development :: Build Tools
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.5
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.1
+Classifier: Programming Language :: Python :: 3.2

File Lib/site-packages/pip-1.2.1-py2.7.egg/EGG-INFO/SOURCES.txt

+AUTHORS.txt
+LICENSE.txt
+MANIFEST.in
+setup.cfg
+setup.py
+docs/ci-server-step-by-step.txt
+docs/configuration.txt
+docs/contributing.txt
+docs/glossary.txt
+docs/index.txt
+docs/installing.txt
+docs/news.txt
+docs/other-tools.txt
+docs/requirements.txt
+docs/usage.txt
+pip/__init__.py
+pip/__main__.py
+pip/backwardcompat.py
+pip/basecommand.py
+pip/baseparser.py
+pip/download.py
+pip/exceptions.py
+pip/index.py
+pip/locations.py
+pip/log.py
+pip/req.py
+pip/runner.py
+pip/status_codes.py
+pip/util.py
+pip.egg-info/PKG-INFO
+pip.egg-info/SOURCES.txt
+pip.egg-info/dependency_links.txt
+pip.egg-info/entry_points.txt
+pip.egg-info/not-zip-safe
+pip.egg-info/top_level.txt
+pip/commands/__init__.py
+pip/commands/bundle.py
+pip/commands/completion.py
+pip/commands/freeze.py
+pip/commands/help.py
+pip/commands/install.py
+pip/commands/search.py
+pip/commands/uninstall.py
+pip/commands/unzip.py
+pip/commands/zip.py
+pip/vcs/__init__.py
+pip/vcs/bazaar.py
+pip/vcs/git.py
+pip/vcs/mercurial.py
+pip/vcs/subversion.py

File Lib/site-packages/pip-1.2.1-py2.7.egg/EGG-INFO/dependency_links.txt

+

File Lib/site-packages/pip-1.2.1-py2.7.egg/EGG-INFO/entry_points.txt

+[console_scripts]
+pip-2.7 = pip:main
+pip = pip:main
+

File Lib/site-packages/pip-1.2.1-py2.7.egg/EGG-INFO/not-zip-safe

+

File Lib/site-packages/pip-1.2.1-py2.7.egg/EGG-INFO/top_level.txt

+pip

File Lib/site-packages/pip-1.2.1-py2.7.egg/pip/__init__.py

+#!/usr/bin/env python
+import os
+import optparse
+
+import sys
+import re
+import difflib
+
+from pip.basecommand import command_dict, load_command, load_all_commands, command_names
+from pip.baseparser import parser
+from pip.exceptions import InstallationError
+from pip.log import logger
+from pip.util import get_installed_distributions, get_prog
+from pip.vcs import git, mercurial, subversion, bazaar  # noqa
+
+
+# The version as used in the setup.py and the docs conf.py
+__version__ = "1.2.1"
+
+
+def autocomplete():
+    """Command and option completion for the main option parser (and options)
+    and its subcommands (and options).
+
+    Enable by sourcing one of the completion shell scripts (bash or zsh).
+    """
+    # Don't complete if user hasn't sourced bash_completion file.
+    if 'PIP_AUTO_COMPLETE' not in os.environ:
+        return
+    cwords = os.environ['COMP_WORDS'].split()[1:]
+    cword = int(os.environ['COMP_CWORD'])
+    try:
+        current = cwords[cword - 1]
+    except IndexError:
+        current = ''
+    load_all_commands()
+    subcommands = [cmd for cmd, cls in command_dict.items() if not cls.hidden]
+    options = []
+    # subcommand
+    try:
+        subcommand_name = [w for w in cwords if w in subcommands][0]
+    except IndexError:
+        subcommand_name = None
+    # subcommand options
+    if subcommand_name:
+        # special case: 'help' subcommand has no options
+        if subcommand_name == 'help':
+            sys.exit(1)
+        # special case: list locally installed dists for uninstall command
+        if subcommand_name == 'uninstall' and not current.startswith('-'):
+            installed = []
+            lc = current.lower()
+            for dist in get_installed_distributions(local_only=True):
+                if dist.key.startswith(lc) and dist.key not in cwords[1:]:
+                    installed.append(dist.key)
+            # if there are no dists installed, fall back to option completion
+            if installed:
+                for dist in installed:
+                    print(dist)
+                sys.exit(1)
+        subcommand = command_dict.get(subcommand_name)
+        options += [(opt.get_opt_string(), opt.nargs)
+                    for opt in subcommand.parser.option_list
+                    if opt.help != optparse.SUPPRESS_HELP]
+        # filter out previously specified options from available options
+        prev_opts = [x.split('=')[0] for x in cwords[1:cword - 1]]
+        options = [(x, v) for (x, v) in options if x not in prev_opts]
+        # filter options by current input
+        options = [(k, v) for k, v in options if k.startswith(current)]
+        for option in options:
+            opt_label = option[0]
+            # append '=' to options which require args
+            if option[1]:
+                opt_label += '='
+            print(opt_label)
+    else:
+        # show options of main parser only when necessary
+        if current.startswith('-') or current.startswith('--'):
+            subcommands += [opt.get_opt_string()
+                            for opt in parser.option_list
+                            if opt.help != optparse.SUPPRESS_HELP]
+        print(' '.join([x for x in subcommands if x.startswith(current)]))
+    sys.exit(1)
+
+
+def main(initial_args=None):
+    if initial_args is None:
+        initial_args = sys.argv[1:]
+    autocomplete()
+    options, args = parser.parse_args(initial_args)
+    if options.help and not args:
+        args = ['help']
+    if not args:
+        parser.error('You must give a command '
+            '(use "%s help" to see a list of commands)' % get_prog())
+    command = args[0].lower()
+    load_command(command)
+    if command not in command_dict:
+        close_commands = difflib.get_close_matches(command, command_names())
+        if close_commands:
+            guess = close_commands[0]
+            if args[1:]:
+                guess = "%s %s" % (guess, " ".join(args[1:]))
+        else:
+            guess = 'install %s' % command
+        error_dict = {'arg': command, 'guess': guess,
+                      'script': os.path.basename(sys.argv[0])}
+        parser.error('No command by the name %(script)s %(arg)s\n  '
+                     '(maybe you meant "%(script)s %(guess)s")' % error_dict)
+    command = command_dict[command]
+    return command.main(args[1:], options)
+
+
+def bootstrap():
+    """
+    Bootstrapping function to be called from install-pip.py script.
+    """
+    return main(['install', '--upgrade', 'pip'])
+
+############################################################
+## Writing freeze files
+
+
+class FrozenRequirement(object):
+
+    def __init__(self, name, req, editable, comments=()):
+        self.name = name
+        self.req = req
+        self.editable = editable
+        self.comments = comments
+
+    _rev_re = re.compile(r'-r(\d+)$')
+    _date_re = re.compile(r'-(20\d\d\d\d\d\d)$')
+
+    @classmethod
+    def from_dist(cls, dist, dependency_links, find_tags=False):
+        location = os.path.normcase(os.path.abspath(dist.location))
+        comments = []
+        from pip.vcs import vcs, get_src_requirement
+        if vcs.get_backend_name(location):
+            editable = True
+            try:
+                req = get_src_requirement(dist, location, find_tags)
+            except InstallationError:
+                ex = sys.exc_info()[1]
+                logger.warn("Error when trying to get requirement for VCS system %s, falling back to uneditable format" % ex)
+                req = None
+            if req is None:
+                logger.warn('Could not determine repository location of %s' % location)
+                comments.append('## !! Could not determine repository location')
+                req = dist.as_requirement()
+                editable = False
+        else:
+            editable = False
+            req = dist.as_requirement()
+            specs = req.specs
+            assert len(specs) == 1 and specs[0][0] == '=='
+            version = specs[0][1]
+            ver_match = cls._rev_re.search(version)
+            date_match = cls._date_re.search(version)
+            if ver_match or date_match:
+                svn_backend = vcs.get_backend('svn')
+                if svn_backend:
+                    svn_location = svn_backend(
+                        ).get_location(dist, dependency_links)
+                if not svn_location:
+                    logger.warn(
+                        'Warning: cannot find svn location for %s' % req)
+                    comments.append('## FIXME: could not find svn URL in dependency_links for this package:')
+                else:
+                    comments.append('# Installing as editable to satisfy requirement %s:' % req)
+                    if ver_match:
+                        rev = ver_match.group(1)
+                    else:
+                        rev = '{%s}' % date_match.group(1)
+                    editable = True
+                    req = '%s@%s#egg=%s' % (svn_location, rev, cls.egg_name(dist))
+        return cls(dist.project_name, req, editable, comments)
+
+    @staticmethod
+    def egg_name(dist):
+        name = dist.egg_name()
+        match = re.search(r'-py\d\.\d$', name)
+        if match:
+            name = name[:match.start()]
+        return name
+
+    def __str__(self):
+        req = self.req
+        if self.editable:
+            req = '-e %s' % req
+        return '\n'.join(list(self.comments) + [str(req)]) + '\n'
+
+
+if __name__ == '__main__':
+    exit = main()
+    if exit:
+        sys.exit(exit)

File Lib/site-packages/pip-1.2.1-py2.7.egg/pip/__main__.py

+import sys
+from .runner import run
+
+if __name__ == '__main__':
+    exit = run()
+    if exit:
+        sys.exit(exit)

File Lib/site-packages/pip-1.2.1-py2.7.egg/pip/backwardcompat.py

+"""Stuff that differs in different Python versions"""
+
+import os
+import imp
+import sys
+import site
+
+__all__ = ['WindowsError']
+
+uses_pycache = hasattr(imp,'cache_from_source')
+
+try:
+    WindowsError = WindowsError
+except NameError:
+    class NeverUsedException(Exception):
+        """this exception should never be raised"""
+    WindowsError = NeverUsedException
+
+
+console_encoding = sys.__stdout__.encoding
+
+if sys.version_info >= (3,):
+    from io import StringIO, BytesIO
+    from functools import reduce
+    from urllib.error import URLError, HTTPError
+    from queue import Queue, Empty
+    from urllib.request import url2pathname
+    from urllib.request import urlretrieve
+    from email import message as emailmessage
+    import urllib.parse as urllib
+    import urllib.request as urllib2
+    import configparser as ConfigParser
+    import xmlrpc.client as xmlrpclib
+    import urllib.parse as urlparse
+    import http.client as httplib
+
+    def cmp(a, b):
+        return (a > b) - (a < b)
+
+    def b(s):
+        return s.encode('utf-8')
+
+    def u(s):
+        return s.decode('utf-8')
+
+    def console_to_str(s):
+        try:
+            return s.decode(console_encoding)
+        except UnicodeDecodeError:
+            return s.decode('utf_8')
+
+    def fwrite(f, s):
+        f.buffer.write(b(s))
+
+    bytes = bytes
+    string_types = (str,)
+    raw_input = input
+else:
+    from cStringIO import StringIO
+    from urllib2 import URLError, HTTPError
+    from Queue import Queue, Empty
+    from urllib import url2pathname, urlretrieve
+    from email import Message as emailmessage
+    import urllib
+    import urllib2
+    import urlparse
+    import ConfigParser
+    import xmlrpclib
+    import httplib
+
+    def b(s):
+        return s
+
+    def u(s):
+        return s
+
+    def console_to_str(s):
+        return s
+
+    def fwrite(f, s):
+        f.write(s)
+
+    bytes = str
+    string_types = (basestring,)
+    reduce = reduce
+    cmp = cmp
+    raw_input = raw_input
+    BytesIO = StringIO
+
+
+from distutils.sysconfig import get_python_lib, get_python_version
+
+#site.USER_SITE was created in py2.6
+user_site = getattr(site,'USER_SITE',None)
+
+def product(*args, **kwds):
+    # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy
+    # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111
+    pools = list(map(tuple, args)) * kwds.get('repeat', 1)
+    result = [[]]
+    for pool in pools:
+        result = [x+[y] for x in result for y in pool]
+    for prod in result:
+        yield tuple(prod)
+
+def home_lib(home):
+    """Return the lib dir under the 'home' installation scheme"""
+    if hasattr(sys, 'pypy_version_info'):
+        lib = 'site-packages'
+    else:
+        lib = os.path.join('lib', 'python')
+    return os.path.join(home, lib)

File Lib/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py

+"""Base Command class, and related routines"""
+
+import os
+from pkgutil import walk_packages
+import socket
+import sys
+import tempfile
+import traceback
+import time
+
+from pip import commands
+from pip.log import logger
+from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter
+from pip.download import urlopen
+from pip.exceptions import (BadCommand, InstallationError, UninstallationError,
+                            CommandError)
+from pip.backwardcompat import StringIO
+from pip.status_codes import SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND
+from pip.util import get_prog
+
+
+__all__ = ['command_dict', 'Command', 'load_all_commands',
+           'load_command', 'command_names']
+
+command_dict = {}
+
+# for backwards compatibiliy
+get_proxy = urlopen.get_proxy
+
+
+class Command(object):
+    name = None
+    usage = None
+    hidden = False
+
+    def __init__(self):
+        assert self.name
+        self.parser = ConfigOptionParser(
+            usage=self.usage,
+            prog='%s %s' % (get_prog(), self.name),
+            version=parser.version,
+            formatter=UpdatingDefaultsHelpFormatter(),
+            name=self.name)
+        for option in parser.option_list:
+            if not option.dest or option.dest == 'help':
+                # -h, --version, etc
+                continue
+            self.parser.add_option(option)
+        command_dict[self.name] = self
+
+    def merge_options(self, initial_options, options):
+        # Make sure we have all global options carried over
+        for attr in ['log', 'proxy', 'require_venv',
+                     'log_explicit_levels', 'log_file',
+                     'timeout', 'default_vcs',
+                     'skip_requirements_regex',
+                     'no_input', 'exists_action']:
+            setattr(options, attr, getattr(initial_options, attr) or getattr(options, attr))
+        options.quiet += initial_options.quiet
+        options.verbose += initial_options.verbose
+
+    def setup_logging(self):
+        pass
+
+    def main(self, args, initial_options):
+        options, args = self.parser.parse_args(args)
+        self.merge_options(initial_options, options)
+
+        level = 1 # Notify
+        level += options.verbose
+        level -= options.quiet
+        level = logger.level_for_integer(4-level)
+        complete_log = []
+        logger.consumers.extend(
+            [(level, sys.stdout),
+             (logger.DEBUG, complete_log.append)])
+        if options.log_explicit_levels:
+            logger.explicit_levels = True
+
+        self.setup_logging()
+
+        if options.no_input:
+            os.environ['PIP_NO_INPUT'] = '1'
+
+        if options.exists_action:
+            os.environ['PIP_EXISTS_ACTION'] = ''.join(options.exists_action)
+
+        if options.require_venv:
+            # If a venv is required check if it can really be found
+            if not os.environ.get('VIRTUAL_ENV'):
+                logger.fatal('Could not find an activated virtualenv (required).')
+                sys.exit(VIRTUALENV_NOT_FOUND)
+
+        if options.log:
+            log_fp = open_logfile(options.log, 'a')
+            logger.consumers.append((logger.DEBUG, log_fp))
+        else:
+            log_fp = None
+
+        socket.setdefaulttimeout(options.timeout or None)
+
+        urlopen.setup(proxystr=options.proxy, prompting=not options.no_input)
+
+        exit = SUCCESS
+        store_log = False
+        try:
+            status = self.run(options, args)
+            # FIXME: all commands should return an exit status
+            # and when it is done, isinstance is not needed anymore
+            if isinstance(status, int):
+                exit = status
+        except (InstallationError, UninstallationError):
+            e = sys.exc_info()[1]
+            logger.fatal(str(e))
+            logger.info('Exception information:\n%s' % format_exc())
+            store_log = True
+            exit = ERROR
+        except BadCommand:
+            e = sys.exc_info()[1]
+            logger.fatal(str(e))
+            logger.info('Exception information:\n%s' % format_exc())
+            store_log = True
+            exit = ERROR
+        except CommandError:
+            e = sys.exc_info()[1]
+            logger.fatal('ERROR: %s' % e)
+            logger.info('Exception information:\n%s' % format_exc())
+            exit = ERROR
+        except KeyboardInterrupt:
+            logger.fatal('Operation cancelled by user')
+            logger.info('Exception information:\n%s' % format_exc())
+            store_log = True
+            exit = ERROR
+        except:
+            logger.fatal('Exception:\n%s' % format_exc())
+            store_log = True
+            exit = UNKNOWN_ERROR
+        if log_fp is not None:
+            log_fp.close()
+        if store_log:
+            log_fn = options.log_file
+            text = '\n'.join(complete_log)
+            try:
+               log_fp = open_logfile(log_fn, 'w')
+            except IOError:
+               temp = tempfile.NamedTemporaryFile(delete=False)
+               log_fn = temp.name
+               log_fp = open_logfile(log_fn, 'w')
+            logger.fatal('Storing complete log in %s' % log_fn)			
+            log_fp.write(text)
+            log_fp.close()
+        return exit
+
+
+def format_exc(exc_info=None):
+    if exc_info is None:
+        exc_info = sys.exc_info()
+    out = StringIO()
+    traceback.print_exception(*exc_info, **dict(file=out))
+    return out.getvalue()
+
+
+def open_logfile(filename, mode='a'):
+    """Open the named log file in append mode.
+
+    If the file already exists, a separator will also be printed to
+    the file to separate past activity from current activity.
+    """
+    filename = os.path.expanduser(filename)
+    filename = os.path.abspath(filename)
+    dirname = os.path.dirname(filename)
+    if not os.path.exists(dirname):
+        os.makedirs(dirname)
+    exists = os.path.exists(filename)
+
+    log_fp = open(filename, mode)
+    if exists:
+        log_fp.write('%s\n' % ('-'*60))
+        log_fp.write('%s run on %s\n' % (sys.argv[0], time.strftime('%c')))
+    return log_fp
+
+
+def load_command(name):
+    full_name = 'pip.commands.%s' % name
+    if full_name in sys.modules:
+        return
+    try:
+        __import__(full_name)
+    except ImportError:
+        pass
+
+
+def load_all_commands():
+    for name in command_names():
+        load_command(name)
+
+
+def command_names():
+    names = set((pkg[1] for pkg in walk_packages(path=commands.__path__)))
+    return list(names)
+

File Lib/site-packages/pip-1.2.1-py2.7.egg/pip/baseparser.py

+"""Base option parser setup"""
+
+import sys
+import optparse
+import pkg_resources
+import os
+from distutils.util import strtobool
+from pip.backwardcompat import ConfigParser, string_types
+from pip.locations import default_config_file, default_log_file
+from pip.util import get_terminal_size, get_prog
+
+
+class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
+    """A prettier/less verbose help formatter for optparse."""
+
+    def __init__(self, *args, **kwargs):
+        kwargs['max_help_position'] = 30
+        kwargs['indent_increment'] = 1
+        kwargs['width'] = get_terminal_size()[0] - 2
+        optparse.IndentedHelpFormatter.__init__(self, *args, **kwargs)
+
+    def format_option_strings(self, option):
+        return self._format_option_strings(option, ' <%s>', ', ')
+
+    def _format_option_strings(self, option, mvarfmt=' <%s>', optsep=', '):
+        """
+        Return a comma-separated list of option strings and metavars.
+
+        :param option:  tuple of (short opt, long opt), e.g: ('-f', '--format')
+        :param mvarfmt: metavar format string - evaluated as mvarfmt % metavar
+        :param optsep:  separator
+        """
+        opts = []
+
+        if option._short_opts:
+            opts.append(option._short_opts[0])
+        if option._long_opts:
+            opts.append(option._long_opts[0])
+        if len(opts) > 1:
+            opts.insert(1, optsep)
+
+        if option.takes_value():
+            metavar = option.metavar or option.dest.lower()
+            opts.append(mvarfmt % metavar.upper())
+
+        return ''.join(opts)
+
+    def format_heading(self, heading):
+        if heading == 'Options':
+            return ''
+        return heading + ':\n'
+
+    def format_usage(self, usage):
+        """
+        ensure there is only one newline between usage and the first heading
+        if there is no description
+        """
+        msg = 'Usage: %s' % usage
+        if self.parser.description:
+            msg += '\n'
+        return msg
+
+    def format_description(self, description):
+        # leave full control over description to us
+        if description:
+            return description
+        else:
+            return ''
+
+    def format_epilog(self, epilog):
+        # leave full control over epilog to us
+        if epilog:
+            return epilog
+        else:
+            return ''
+
+
+class UpdatingDefaultsHelpFormatter(PrettyHelpFormatter):
+    """Custom help formatter for use in ConfigOptionParser that updates
+    the defaults before expanding them, allowing them to show up correctly
+    in the help listing"""
+
+    def expand_default(self, option):
+        if self.parser is not None:
+            self.parser.update_defaults(self.parser.defaults)
+        return optparse.IndentedHelpFormatter.expand_default(self, option)
+
+
+class ConfigOptionParser(optparse.OptionParser):
+    """Custom option parser which updates its defaults by by checking the
+    configuration files and environmental variables"""
+
+    def __init__(self, *args, **kwargs):
+        self.config = ConfigParser.RawConfigParser()
+        self.name = kwargs.pop('name')
+        self.files = self.get_config_files()
+        self.config.read(self.files)
+        assert self.name
+        optparse.OptionParser.__init__(self, *args, **kwargs)
+
+    def get_config_files(self):
+        config_file = os.environ.get('PIP_CONFIG_FILE', False)
+        if config_file and os.path.exists(config_file):
+            return [config_file]
+        return [default_config_file]
+
+    def update_defaults(self, defaults):
+        """Updates the given defaults with values from the config files and
+        the environ. Does a little special handling for certain types of
+        options (lists)."""
+        # Then go and look for the other sources of configuration:
+        config = {}
+        # 1. config files
+        for section in ('global', self.name):
+            config.update(self.normalize_keys(self.get_config_section(section)))
+        # 2. environmental variables
+        config.update(self.normalize_keys(self.get_environ_vars()))
+        # Then set the options with those values
+        for key, val in config.items():
+            option = self.get_option(key)
+            if option is not None:
+                # ignore empty values
+                if not val:
+                    continue
+                # handle multiline configs
+                if option.action == 'append':
+                    val = val.split()
+                else:
+                    option.nargs = 1
+                if option.action in ('store_true', 'store_false', 'count'):
+                    val = strtobool(val)
+                try:
+                    val = option.convert_value(key, val)
+                except optparse.OptionValueError:
+                    e = sys.exc_info()[1]
+                    print("An error occured during configuration: %s" % e)
+                    sys.exit(3)
+                defaults[option.dest] = val
+        return defaults
+
+    def normalize_keys(self, items):
+        """Return a config dictionary with normalized keys regardless of
+        whether the keys were specified in environment variables or in config
+        files"""
+        normalized = {}
+        for key, val in items:
+            key = key.replace('_', '-')
+            if not key.startswith('--'):
+                key = '--%s' % key  # only prefer long opts
+            normalized[key] = val
+        return normalized
+
+    def get_config_section(self, name):
+        """Get a section of a configuration"""
+        if self.config.has_section(name):
+            return self.config.items(name)
+        return []
+
+    def get_environ_vars(self, prefix='PIP_'):
+        """Returns a generator with all environmental vars with prefix PIP_"""
+        for key, val in os.environ.items():
+            if key.startswith(prefix):
+                yield (key.replace(prefix, '').lower(), val)
+
+    def get_default_values(self):
+        """Overridding to make updating the defaults after instantiation of
+        the option parser possible, update_defaults() does the dirty work."""
+        if not self.process_default_values:
+            # Old, pre-Optik 1.5 behaviour.
+            return optparse.Values(self.defaults)
+
+        defaults = self.update_defaults(self.defaults.copy())  # ours
+        for option in self._get_all_options():
+            default = defaults.get(option.dest)
+            if isinstance(default, string_types):
+                opt_str = option.get_opt_string()
+                defaults[option.dest] = option.check_value(opt_str, default)
+        return optparse.Values(defaults)
+
+    def error(self, msg):
+        self.print_usage(sys.stderr)
+        self.exit(2, "%s\n" % msg)
+
+
+try:
+    pip_dist = pkg_resources.get_distribution('pip')
+    version = '%s from %s (python %s)' % (
+        pip_dist, pip_dist.location, sys.version[:3])
+except pkg_resources.DistributionNotFound:
+    # when running pip.py without installing
+    version = None
+
+
+parser = ConfigOptionParser(
+    usage='%prog COMMAND [OPTIONS]',
+    version=version,
+    add_help_option=False,
+    formatter=UpdatingDefaultsHelpFormatter(),
+    name='global',
+    prog=get_prog())
+
+parser.add_option(
+    '-h', '--help',
+    dest='help',
+    action='store_true',
+    help='Show help')
+parser.add_option(
+    # Run only if inside a virtualenv, bail if not.
+    '--require-virtualenv', '--require-venv',
+    dest='require_venv',
+    action='store_true',
+    default=False,
+    help=optparse.SUPPRESS_HELP)
+
+parser.add_option(
+    '-v', '--verbose',
+    dest='verbose',
+    action='count',
+    default=0,
+    help='Give more output')
+parser.add_option(
+    '-q', '--quiet',
+    dest='quiet',
+    action='count',
+    default=0,
+    help='Give less output')
+parser.add_option(
+    '--log',
+    dest='log',
+    metavar='FILENAME',
+    help='Log file where a complete (maximum verbosity) record will be kept')
+parser.add_option(
+    # Writes the log levels explicitely to the log'
+    '--log-explicit-levels',
+    dest='log_explicit_levels',
+    action='store_true',
+    default=False,
+    help=optparse.SUPPRESS_HELP)
+parser.add_option(
+    # The default log file
+    '--local-log', '--log-file',
+    dest='log_file',
+    metavar='FILENAME',
+    default=default_log_file,
+    help=optparse.SUPPRESS_HELP)
+parser.add_option(
+    # Don't ask for input
+    '--no-input',
+    dest='no_input',
+    action='store_true',
+    default=False,
+    help=optparse.SUPPRESS_HELP)
+