# PaCkAgE DaTaStReAm distribute 1 4015 # end of header 070701000685e8000081a4000000000000000000000001513ff7e60000013a000000b500010002ffffffffffffffff0000001300000000distribute/pkginfoPKG=distribute NAME=distribute 0.6.28 i86pc Solaris 10 VERSION=0.6.28 PSTAMP=13th March 2013 VENDOR=Phillip Eby EMAIL=https://pypi.python.org/pypi/distribute DESC=download, build, install, upgrade, and uninstall Python packages ARCH=i386 CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 070701000685e7000081a4000000000000000000000001513ff7e600003ef7000000b500010002ffffffffffffffff0000001200000000distribute/pkgmap: 1 4015 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/lib 0755 root root 1 d none /usr/local/lib/python2.7 0755 root root 1 d none /usr/local/lib/python2.7/site-packages 0755 root root 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg 0755 root root 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/PKG-INFO 0644 root root 26178 33625 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/SOURCES.txt 0644 root root 3041 37372 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/dependency_links.txt 0644 root root 1 10 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/entry_points.txt 0644 root root 2773 11922 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/top_level.txt 0644 root root 43 4291 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/zip-safe 0644 root root 2 23 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/easy_install.py 0755 root root 126 10618 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/easy_install.pyc 0644 root root 349 22330 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py 0755 root root 93260 22222 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyc 0644 root root 106407 57360 1363146085 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/__init__.py 0755 root root 3744 54080 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/__init__.pyc 0644 root root 4232 56413 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/archive_util.py 0755 root root 6165 29137 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/archive_util.pyc 0644 root root 6000 1617 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/cli-32.exe 0644 root root 69632 55904 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/cli-64.exe 0644 root root 75264 32813 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/cli.exe 0644 root root 69632 55904 1363146085 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/__init__.py 0755 root root 689 58609 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/__init__.pyc 0644 root root 954 60725 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.py 0755 root root 2477 59130 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyc 0644 root root 3465 2601 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.py 0755 root root 18594 49756 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyc 0644 root root 19030 53202 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.py 0755 root root 2025 23372 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyc 0644 root root 2497 16730 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.py 0755 root root 1548 52451 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyc 0644 root root 2005 52222 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.py 0755 root root 11704 2155 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyc 0644 root root 10803 15083 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.py 0755 root root 10548 34052 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyc 0644 root root 12604 18640 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.py 0755 root root 5368 35569 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyc 0644 root root 5583 64797 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.py 0755 root root 72429 44412 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyc 0644 root root 68459 44042 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.py 0755 root root 14356 59109 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyc 0644 root root 17985 59072 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.py 0755 root root 4065 817 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyc 0644 root root 4069 47654 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.py 0755 root root 3833 19459 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyc 0644 root root 5007 34692 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.py 0755 root root 2486 59208 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyc 0644 root root 3492 10985 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.py 0755 root root 2059 38248 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyc 0644 root root 2771 36062 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.py 0755 root root 277 23573 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyc 0644 root root 794 47790 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.py 0755 root root 2021 20226 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pyc 0644 root root 3066 55288 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/saveopts.py 0755 root root 740 59579 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/saveopts.pyc 0644 root root 1369 18804 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.py 0755 root root 7599 43683 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyc 0644 root root 9055 49450 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.py 0755 root root 5053 56412 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyc 0644 root root 6365 64510 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.py 0755 root root 5110 64591 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyc 0644 root root 5746 17407 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.py 0755 root root 6683 29572 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.pyc 0644 root root 6552 45911 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.py 0755 root root 6174 2139 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyc 0644 root root 6734 65196 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/depends.py 0755 root root 6209 21041 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/depends.pyc 0644 root root 7157 31598 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py 0755 root root 30309 46853 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.pyc 0644 root root 31731 11826 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/extension.py 0755 root root 1398 50285 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/extension.pyc 0644 root root 2535 25426 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui-32.exe 0644 root root 65536 55069 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui-64.exe 0644 root root 75264 43191 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui.exe 0644 root root 65536 55069 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/package_index.py 0755 root root 30995 43639 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/package_index.pyc 0644 root root 30930 20039 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/sandbox.py 0755 root root 8999 45796 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/sandbox.pyc 0644 root root 12603 49540 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template.py 0755 root root 163 13232 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template.pyc 0644 root root 309 20443 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template_dev.py 0755 root root 202 16429 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template_dev.pyc 0644 root root 366 22782 1363146085 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.py 0755 root root 12396 64657 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyc 0644 root root 15058 33397 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.py 0755 root root 99730 8298 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyc 0644 root root 85610 22972 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.py 0755 root root 267 22073 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pyc 0644 root root 931 55281 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.py 0755 root root 2493 243 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyc 0644 root root 4514 1211 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.py 0755 root root 1945 18543 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyc 0644 root root 3130 45151 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.py 0755 root root 673 57494 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.pyc 0644 root root 1252 11891 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.py 0755 root root 2377 48825 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyc 0644 root root 3401 60154 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.py 0755 root root 2323 48769 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyc 0644 root root 3536 15306 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.py 0755 root root 13420 56892 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyc 0644 root root 16928 13450 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.py 0755 root root 5217 13450 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyc 0644 root root 6587 13905 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.py 0755 root root 24677 51521 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyc 0644 root root 29231 2519 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.py 0755 root root 1724 65181 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyc 0644 root root 3366 1111 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.py 0755 root root 1885 15095 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyc 0644 root root 2655 17521 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.py 0755 root root 2362 43241 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.pyc 0644 root root 1793 30310 1363146085 1 f none /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info 0644 root root 144 12788 1363146086 1 f none /usr/local/lib/python2.7/site-packages/setuptools.pth 0644 root root 34 2860 1363146086 1 i checkinstall 790 2504 1363146726 1 i pkginfo 314 25282 1363146726 1 i postinstall 523 46420 1363146726 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!070701000685e8000081a4000000000000000000000001513ff7e60000013a000000b500010002ffffffffffffffff0000000800000000pkginfoPKG=distribute NAME=distribute 0.6.28 i86pc Solaris 10 VERSION=0.6.28 PSTAMP=13th March 2013 VENDOR=Phillip Eby EMAIL=https://pypi.python.org/pypi/distribute DESC=download, build, install, upgrade, and uninstall Python packages ARCH=i386 CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 070701000685e7000081a4000000000000000000000001513ff7e600003ef7000000b500010002ffffffffffffffff0000000700000000pkgmap: 1 4015 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/lib 0755 root root 1 d none /usr/local/lib/python2.7 0755 root root 1 d none /usr/local/lib/python2.7/site-packages 0755 root root 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg 0755 root root 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/PKG-INFO 0644 root root 26178 33625 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/SOURCES.txt 0644 root root 3041 37372 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/dependency_links.txt 0644 root root 1 10 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/entry_points.txt 0644 root root 2773 11922 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/top_level.txt 0644 root root 43 4291 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/zip-safe 0644 root root 2 23 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/easy_install.py 0755 root root 126 10618 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/easy_install.pyc 0644 root root 349 22330 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py 0755 root root 93260 22222 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyc 0644 root root 106407 57360 1363146085 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/__init__.py 0755 root root 3744 54080 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/__init__.pyc 0644 root root 4232 56413 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/archive_util.py 0755 root root 6165 29137 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/archive_util.pyc 0644 root root 6000 1617 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/cli-32.exe 0644 root root 69632 55904 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/cli-64.exe 0644 root root 75264 32813 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/cli.exe 0644 root root 69632 55904 1363146085 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/__init__.py 0755 root root 689 58609 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/__init__.pyc 0644 root root 954 60725 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.py 0755 root root 2477 59130 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyc 0644 root root 3465 2601 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.py 0755 root root 18594 49756 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyc 0644 root root 19030 53202 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.py 0755 root root 2025 23372 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyc 0644 root root 2497 16730 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.py 0755 root root 1548 52451 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyc 0644 root root 2005 52222 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.py 0755 root root 11704 2155 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyc 0644 root root 10803 15083 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.py 0755 root root 10548 34052 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyc 0644 root root 12604 18640 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.py 0755 root root 5368 35569 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyc 0644 root root 5583 64797 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.py 0755 root root 72429 44412 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyc 0644 root root 68459 44042 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.py 0755 root root 14356 59109 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyc 0644 root root 17985 59072 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.py 0755 root root 4065 817 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyc 0644 root root 4069 47654 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.py 0755 root root 3833 19459 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyc 0644 root root 5007 34692 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.py 0755 root root 2486 59208 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyc 0644 root root 3492 10985 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.py 0755 root root 2059 38248 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyc 0644 root root 2771 36062 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.py 0755 root root 277 23573 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyc 0644 root root 794 47790 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.py 0755 root root 2021 20226 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pyc 0644 root root 3066 55288 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/saveopts.py 0755 root root 740 59579 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/saveopts.pyc 0644 root root 1369 18804 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.py 0755 root root 7599 43683 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyc 0644 root root 9055 49450 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.py 0755 root root 5053 56412 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyc 0644 root root 6365 64510 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.py 0755 root root 5110 64591 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyc 0644 root root 5746 17407 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.py 0755 root root 6683 29572 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.pyc 0644 root root 6552 45911 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.py 0755 root root 6174 2139 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyc 0644 root root 6734 65196 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/depends.py 0755 root root 6209 21041 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/depends.pyc 0644 root root 7157 31598 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py 0755 root root 30309 46853 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.pyc 0644 root root 31731 11826 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/extension.py 0755 root root 1398 50285 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/extension.pyc 0644 root root 2535 25426 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui-32.exe 0644 root root 65536 55069 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui-64.exe 0644 root root 75264 43191 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui.exe 0644 root root 65536 55069 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/package_index.py 0755 root root 30995 43639 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/package_index.pyc 0644 root root 30930 20039 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/sandbox.py 0755 root root 8999 45796 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/sandbox.pyc 0644 root root 12603 49540 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template.py 0755 root root 163 13232 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template.pyc 0644 root root 309 20443 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template_dev.py 0755 root root 202 16429 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/script_template_dev.pyc 0644 root root 366 22782 1363146085 1 d none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests 0755 root root 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.py 0755 root root 12396 64657 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyc 0644 root root 15058 33397 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.py 0755 root root 99730 8298 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyc 0644 root root 85610 22972 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.py 0755 root root 267 22073 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pyc 0644 root root 931 55281 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.py 0755 root root 2493 243 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyc 0644 root root 4514 1211 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.py 0755 root root 1945 18543 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyc 0644 root root 3130 45151 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.py 0755 root root 673 57494 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.pyc 0644 root root 1252 11891 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.py 0755 root root 2377 48825 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyc 0644 root root 3401 60154 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.py 0755 root root 2323 48769 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyc 0644 root root 3536 15306 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.py 0755 root root 13420 56892 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyc 0644 root root 16928 13450 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.py 0755 root root 5217 13450 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyc 0644 root root 6587 13905 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.py 0755 root root 24677 51521 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyc 0644 root root 29231 2519 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.py 0755 root root 1724 65181 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyc 0644 root root 3366 1111 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.py 0755 root root 1885 15095 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyc 0644 root root 2655 17521 1363146086 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.py 0755 root root 2362 43241 1363146085 1 f none /usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.pyc 0644 root root 1793 30310 1363146085 1 f none /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info 0644 root root 144 12788 1363146086 1 f none /usr/local/lib/python2.7/site-packages/setuptools.pth 0644 root root 34 2860 1363146086 1 i checkinstall 790 2504 1363146726 1 i pkginfo 314 25282 1363146726 1 i postinstall 523 46420 1363146726 0707010006868e000041ed000000000000000000000002513ff7e600000000000000b500010002ffffffffffffffff0000000800000000install07070100068690000081ed000000000000000000000001513ff7e60000020b000000b500010002ffffffffffffffff0000001400000000install/postinstall#!/usr/bin/ksh easy_install_pth="/usr/local/lib/python2.7/site-packages/easy-install.pth" distribute_egg='distribute-0.6.28-py2.7.egg' distribute_check=`/bin/grep ${distribute_egg} ${easy_install_pth} | /bin/grep -ci ${distribute_egg}` # # Add distribute to easy_install.pth if missing # if [ "$distribute_check" -eq "0" ]; then perl -pe 's%^import sys; new=sys.path%./distribute-0.6.28-py2.7.egg\nimport sys; new=sys.path%' -i ${easy_install_pth} echo "Added ${distribute_egg} to ${easy_install_pth}." fi exit 0 0707010006868f000081ed000000000000000000000001513ff7e600000316000000b500010002ffffffffffffffff0000001500000000install/checkinstall#!/bin/sh # expected_bits="64" expected_release="5.10" expected_platform="i386" # release=`uname -r` platform=`uname -p` bits=`isainfo -b` # if [ ${platform} != ${expected_platform} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n" echo "\tAborting installation.\n\n\n" exit 1 fi if [ ${release} != ${expected_release} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n" echo "\tAborting installation.\n\n\n" exit 1 fi #if [ ${bits} != ${expected_bits} ]; then # echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n" # echo "\tYour machine is running a ${bits} bit O.S. currently\n" # echo "\tAborting installation.\n\n\n" # exit 1 #fi exit 0 070701000685e9000041ed000000000000000000000003513ff7e600000000000000b500010002ffffffffffffffff0000000500000000root070701000685ea000041ed000000000000000000000003513ff7e600000000000000b500010002ffffffffffffffff0000000900000000root/usr07070100068619000041ed000000000000000000000003513ff7e600000000000000b500010002ffffffffffffffff0000000f00000000root/usr/local0707010006861a000041ed000000000000000000000003513ff7e600000000000000b500010002ffffffffffffffff0000001300000000root/usr/local/lib0707010006861b000041ed000000000000000000000003513ff7e600000000000000b500010002ffffffffffffffff0000001d00000000root/usr/local/lib/python2.70707010006861c000041ed000000000000000000000003513ff7e600000000000000b500010002ffffffffffffffff0000002b00000000root/usr/local/lib/python2.7/site-packages0707010006861d000041ed000000000000000000000004513ff7e600000000000000b500010002ffffffffffffffff0000004700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg0707010006861e000041ed000000000000000000000002513ff7e600000000000000b500010002ffffffffffffffff0000005000000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO07070100068624000081a4000000000000000000000001513ff56500000002000000b500010002ffffffffffffffff0000005900000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/zip-safe 07070100068622000081a4000000000000000000000001513ff56500000ad5000000b500010002ffffffffffffffff0000006100000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/entry_points.txt[distutils.commands] bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm rotate = setuptools.command.rotate:rotate develop = setuptools.command.develop:develop setopt = setuptools.command.setopt:setopt build_py = setuptools.command.build_py:build_py saveopts = setuptools.command.saveopts:saveopts egg_info = setuptools.command.egg_info:egg_info register = setuptools.command.register:register upload_docs = setuptools.command.upload_docs:upload_docs install_egg_info = setuptools.command.install_egg_info:install_egg_info alias = setuptools.command.alias:alias easy_install = setuptools.command.easy_install:easy_install install_scripts = setuptools.command.install_scripts:install_scripts bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst bdist_egg = setuptools.command.bdist_egg:bdist_egg install = setuptools.command.install:install test = setuptools.command.test:test install_lib = setuptools.command.install_lib:install_lib build_ext = setuptools.command.build_ext:build_ext sdist = setuptools.command.sdist:sdist [egg_info.writers] dependency_links.txt = setuptools.command.egg_info:overwrite_arg requires.txt = setuptools.command.egg_info:write_requirements PKG-INFO = setuptools.command.egg_info:write_pkg_info eager_resources.txt = setuptools.command.egg_info:overwrite_arg top_level.txt = setuptools.command.egg_info:write_toplevel_names namespace_packages.txt = setuptools.command.egg_info:overwrite_arg entry_points.txt = setuptools.command.egg_info:write_entries depends.txt = setuptools.command.egg_info:warn_depends_obsolete [console_scripts] easy_install = setuptools.command.easy_install:main easy_install-2.7 = setuptools.command.easy_install:main [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl [distutils.setup_keywords] dependency_links = setuptools.dist:assert_string_list entry_points = setuptools.dist:check_entry_points extras_require = setuptools.dist:check_extras use_2to3_exclude_fixers = setuptools.dist:assert_string_list package_data = setuptools.dist:check_package_data install_requires = setuptools.dist:check_requirements use_2to3 = setuptools.dist:assert_bool use_2to3_fixers = setuptools.dist:assert_string_list include_package_data = setuptools.dist:assert_bool exclude_package_data = setuptools.dist:check_package_data namespace_packages = setuptools.dist:check_nsp test_suite = setuptools.dist:check_test_suite eager_resources = setuptools.dist:assert_string_list zip_safe = setuptools.dist:assert_bool test_loader = setuptools.dist:check_importable packages = setuptools.dist:check_packages convert_2to3_doctests = setuptools.dist:assert_string_list tests_require = setuptools.dist:check_requirements [setuptools.installation] eggsecutable = setuptools.command.easy_install:bootstrap 07070100068623000081a4000000000000000000000001513ff5650000002b000000b500010002ffffffffffffffff0000005e00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/top_level.txteasy_install pkg_resources setuptools site 07070100068620000081a4000000000000000000000001513ff56500000be1000000b500010002ffffffffffffffff0000005c00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/SOURCES.txtCHANGES.txt CONTRIBUTORS.txt DEVGUIDE.txt MANIFEST.in README.txt distribute_setup.py easy_install.py launcher.c pkg_resources.py release.py setup.cfg setup.py site.py distribute.egg-info/PKG-INFO distribute.egg-info/SOURCES.txt distribute.egg-info/dependency_links.txt distribute.egg-info/entry_points.txt distribute.egg-info/top_level.txt distribute.egg-info/zip-safe docs/Makefile docs/conf.py docs/easy_install.txt docs/index.txt docs/pkg_resources.txt docs/python3.txt docs/roadmap.txt docs/setuptools.txt docs/using.txt docs/_templates/indexsidebar.html docs/_theme/nature/theme.conf docs/_theme/nature/static/nature.css_t docs/_theme/nature/static/pygments.css docs/build/html/_sources/easy_install.txt docs/build/html/_sources/index.txt docs/build/html/_sources/pkg_resources.txt docs/build/html/_sources/python3.txt docs/build/html/_sources/roadmap.txt docs/build/html/_sources/setuptools.txt docs/build/html/_sources/using.txt docs/build/html/_static/basic.css docs/build/html/_static/nature.css docs/build/html/_static/pygments.css setuptools/__init__.py setuptools/archive_util.py setuptools/cli-32.exe setuptools/cli-64.exe setuptools/cli.exe setuptools/depends.py setuptools/dist.py setuptools/extension.py setuptools/gui-32.exe setuptools/gui-64.exe setuptools/gui.exe setuptools/package_index.py setuptools/sandbox.py setuptools/script_template.py setuptools/script_template_dev.py setuptools/command/__init__.py setuptools/command/alias.py setuptools/command/bdist_egg.py setuptools/command/bdist_rpm.py setuptools/command/bdist_wininst.py setuptools/command/build_ext.py setuptools/command/build_py.py setuptools/command/develop.py setuptools/command/easy_install.py setuptools/command/egg_info.py setuptools/command/install.py setuptools/command/install_egg_info.py setuptools/command/install_lib.py setuptools/command/install_scripts.py setuptools/command/register.py setuptools/command/rotate.py setuptools/command/saveopts.py setuptools/command/sdist.py setuptools/command/setopt.py setuptools/command/test.py setuptools/command/upload.py setuptools/command/upload_docs.py setuptools/tests/__init__.py setuptools/tests/doctest.py setuptools/tests/py26compat.py setuptools/tests/server.py setuptools/tests/test_bdist_egg.py setuptools/tests/test_build_ext.py setuptools/tests/test_develop.py setuptools/tests/test_dist_info.py setuptools/tests/test_easy_install.py setuptools/tests/test_packageindex.py setuptools/tests/test_resources.py setuptools/tests/test_sandbox.py setuptools/tests/test_upload_docs.py setuptools/tests/win_script_wrapper.txt setuptools/tests/indexes/test_links_priority/external.html setuptools/tests/indexes/test_links_priority/simple/foobar/index.html tests/api_tests.txt tests/install_test.py tests/manual_test.py tests/test_distribute_setup.py tests/test_python33_bdist_egg.py tests/python3.3_bdist_egg_test/module.py tests/python3.3_bdist_egg_test/setup.py tests/shlib_test/hello.c tests/shlib_test/hello.pyx tests/shlib_test/hellolib.c tests/shlib_test/setup.py tests/shlib_test/test_hello.py0707010006861f000081a4000000000000000000000001513ff56500006642000000b500010002ffffffffffffffff0000005900000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/PKG-INFOMetadata-Version: 1.1 Name: distribute Version: 0.6.28 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: http://packages.python.org/distribute Author: The fellowship of the packaging Author-email: distutils-sig@python.org License: PSF or ZPL Description: =============================== Installing and Using Distribute =============================== .. contents:: **Table of Contents** ----------- Disclaimers ----------- About the fork ============== `Distribute` is a fork of the `Setuptools` project. Distribute is intended to replace Setuptools as the standard method for working with Python module distributions. The fork has two goals: - Providing a backward compatible version to replace Setuptools and make all distributions that depend on Setuptools work as before, but with less bugs and behaviorial issues. This work is done in the 0.6.x series. Starting with version 0.6.2, Distribute supports Python 3. Installing and using distribute for Python 3 code works exactly the same as for Python 2 code, but Distribute also helps you to support Python 2 and Python 3 from the same source code by letting you run 2to3 on the code as a part of the build process, by setting the keyword parameter ``use_2to3`` to True. See http://packages.python.org/distribute for more information. - Refactoring the code, and releasing it in several distributions. This work is being done in the 0.7.x series but not yet released. The roadmap is still evolving, and the page that is up-to-date is located at : `http://packages.python.org/distribute/roadmap`. If you install `Distribute` and want to switch back for any reason to `Setuptools`, get to the `Uninstallation instructions`_ section. More documentation ================== You can get more information in the Sphinx-based documentation, located at http://packages.python.org/distribute. This documentation includes the old Setuptools documentation that is slowly replaced, and brand new content. About the installation process ============================== The `Distribute` installer modifies your installation by de-activating an existing installation of `Setuptools` in a bootstrap process. This process has been tested in various installation schemes and contexts but in case of a bug during this process your Python installation might be left in a broken state. Since all modified files and directories are copied before the installation starts, you will be able to get back to a normal state by reading the instructions in the `Uninstallation instructions`_ section. In any case, it is recommended to save you `site-packages` directory before you start the installation of `Distribute`. ------------------------- Installation Instructions ------------------------- Distribute is only released as a source distribution. It can be installed using pip, and can be done so with the source tarball, or by using the ``distribute_setup.py`` script provided online. ``distribute_setup.py`` is the simplest and preferred way on all systems. distribute_setup.py =================== Download `distribute_setup.py `_ and execute it, using the Python interpreter of your choice. If your shell has the ``curl`` program you can do:: $ curl -O http://python-distribute.org/distribute_setup.py $ python distribute_setup.py Notice this file is also provided in the source release. pip === Run easy_install or pip:: $ pip install distribute Source installation =================== Download the source tarball, uncompress it, then run the install command:: $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz $ tar -xzvf distribute-0.6.28.tar.gz $ cd distribute-0.6.28 $ python setup.py install --------------------------- Uninstallation Instructions --------------------------- Like other distutils-based distributions, Distribute doesn't provide an uninstaller yet. It's all done manually! We are all waiting for PEP 376 support in Python. Distribute is installed in three steps: 1. it gets out of the way an existing installation of Setuptools 2. it installs a `fake` setuptools installation 3. it installs distribute Distribute can be removed like this: - remove the ``distribute*.egg`` file located in your site-packages directory - remove the ``setuptools.pth`` file located in you site-packages directory - remove the easy_install script located in you ``sys.prefix/bin`` directory - remove the ``setuptools*.egg`` directory located in your site-packages directory, if any. If you want to get back to setuptools: - reinstall setuptools using its instruction. Lastly: - remove the *.OLD.* directory located in your site-packages directory if any, **once you have checked everything was working correctly again**. ------------------------- Quick help for developers ------------------------- To create an egg which is compatible with Distribute, use the same practice as with Setuptools, e.g.:: from setuptools import setup setup(... ) To use `pkg_resources` to access data files in the egg, you should require the Setuptools distribution explicitly:: from setuptools import setup setup(... install_requires=['setuptools'] ) Only if you need Distribute-specific functionality should you depend on it explicitly. In this case, replace the Setuptools dependency:: from setuptools import setup setup(... install_requires=['distribute'] ) ----------- Install FAQ ----------- - **Why is Distribute wrapping my Setuptools installation?** Since Distribute is a fork, and since it provides the same package and modules, it renames the existing Setuptools egg and inserts a new one which merely wraps the Distribute code. This way, full backwards compatibility is kept for packages which rely on the Setuptools modules. At the same time, packages can meet their dependency on Setuptools without actually installing it (which would disable Distribute). - **How does Distribute interact with virtualenv?** Everytime you create a virtualenv it will install setuptools by default. You either need to re-install Distribute in it right after or pass the ``--distribute`` option when creating it. Once installed, your virtualenv will use Distribute transparently. Although, if you have Setuptools installed in your system-wide Python, and if the virtualenv you are in was generated without the `--no-site-packages` option, the Distribute installation will stop. You need in this case to build a virtualenv with the `--no-site-packages` option or to install `Distribute` globally. - **How does Distribute interacts with zc.buildout?** You can use Distribute in your zc.buildout, with the --distribute option, starting at zc.buildout 1.4.2:: $ python bootstrap.py --distribute For previous zc.buildout versions, *the only thing* you need to do is use the bootstrap at `http://python-distribute.org/bootstrap.py`. Run that bootstrap and ``bin/buildout`` (and all other buildout-generated scripts) will transparently use distribute instead of setuptools. You do not need a specific buildout release. A shared eggs directory is no problem (since 0.6.6): the setuptools egg is left in place unmodified. So other buildouts that do not yet use the new bootstrap continue to work just fine. And there is no need to list ``distribute`` somewhere in your eggs: using the bootstrap is enough. The source code for the bootstrap script is located at `http://bitbucket.org/tarek/buildout-distribute`. ----------------------------- Feedback and getting involved ----------------------------- - Mailing list: http://mail.python.org/mailman/listinfo/distutils-sig - Issue tracker: http://bitbucket.org/tarek/distribute/issues/ - Code Repository: http://bitbucket.org/tarek/distribute ======= CHANGES ======= ------ 0.6.28 ------ * Issue 294: setup.py can now be invoked from any directory. * Scripts are now installed honoring the umask. * Added support for .dist-info directories. * Issue #283 bdist_egg issues with python 3.3.0aX. * Test and fix for marshal.load of .pyc files on Python 3.3. ------ 0.6.27 ------ * Support current snapshots of CPython 3.3. * Distribute now recognizes README.rst as a standard, default readme file. * Exclude 'encodings' modules when removing modules from sys.modules. Workaround for #285. * Issue #231: Don't fiddle with system python when used with buildout (bootstrap.py) ------ 0.6.26 ------ * Issue #183: Symlinked files are now extracted from source distributions. * Issue #227: Easy_install fetch parameters are now passed during the installation of a source distribution; now fulfillment of setup_requires dependencies will honor the parameters passed to easy_install. ------ 0.6.25 ------ * Issue #258: Workaround a cache issue * Issue #260: distribute_setup.py now accepts the --user parameter for Python 2.6 and later. * Issue #262: package_index.open_with_auth no longer throws LookupError on Python 3. * Issue #269: AttributeError when an exception occurs reading Manifest.in on late releases of Python. * Issue #272: Prevent TypeError when namespace package names are unicode and single-install-externally-managed is used. Also fixes PIP issue 449. * Issue #273: Legacy script launchers now install with Python2/3 support. ------ 0.6.24 ------ * Issue #249: Added options to exclude 2to3 fixers ------ 0.6.23 ------ * Issue #244: Fixed a test * Issue #243: Fixed a test * Issue #239: Fixed a test * Issue #240: Fixed a test * Issue #241: Fixed a test * Issue #237: Fixed a test * Issue #238: easy_install now uses 64bit executable wrappers on 64bit Python * Issue #208: Fixed parsed_versions, it now honors post-releases as noted in the documentation * Issue #207: Windows cli and gui wrappers pass CTRL-C to child python process * Issue #227: easy_install now passes its arguments to setup.py bdist_egg * Issue #225: Fixed a NameError on Python 2.5, 2.4 ------ 0.6.21 ------ * Issue #225: FIxed a regression on py2.4 ------ 0.6.20 ------ * Issue #135: Include url in warning when processing URLs in package_index. * Issue #212: Fix issue where easy_instal fails on Python 3 on windows installer. * Issue #213: Fix typo in documentation. ------ 0.6.19 ------ * Issue 206: AttributeError: 'HTTPMessage' object has no attribute 'getheaders' ------ 0.6.18 ------ * Issue 210: Fixed a regression introduced by Issue 204 fix. ------ 0.6.17 ------ * Support 'DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT' environment variable to allow to disable installation of easy_install-${version} script. * Support Python >=3.1.4 and >=3.2.1. * Issue 204: Don't try to import the parent of a namespace package in declare_namespace * Issue 196: Tolerate responses with multiple Content-Length headers * Issue 205: Sandboxing doesn't preserve working_set. Leads to setup_requires problems. ------ 0.6.16 ------ * Builds sdist gztar even on Windows (avoiding Issue 193). * Issue 192: Fixed metadata omitted on Windows when package_dir specified with forward-slash. * Issue 195: Cython build support. * Issue 200: Issues with recognizing 64-bit packages on Windows. ------ 0.6.15 ------ * Fixed typo in bdist_egg * Several issues under Python 3 has been solved. * Issue 146: Fixed missing DLL files after easy_install of windows exe package. ------ 0.6.14 ------ * Issue 170: Fixed unittest failure. Thanks to Toshio. * Issue 171: Fixed race condition in unittests cause deadlocks in test suite. * Issue 143: Fixed a lookup issue with easy_install. Thanks to David and Zooko. * Issue 174: Fixed the edit mode when its used with setuptools itself ------ 0.6.13 ------ * Issue 160: 2.7 gives ValueError("Invalid IPv6 URL") * Issue 150: Fixed using ~/.local even in a --no-site-packages virtualenv * Issue 163: scan index links before external links, and don't use the md5 when comparing two distributions ------ 0.6.12 ------ * Issue 149: Fixed various failures on 2.3/2.4 ------ 0.6.11 ------ * Found another case of SandboxViolation - fixed * Issue 15 and 48: Introduced a socket timeout of 15 seconds on url openings * Added indexsidebar.html into MANIFEST.in * Issue 108: Fixed TypeError with Python3.1 * Issue 121: Fixed --help install command trying to actually install. * Issue 112: Added an os.makedirs so that Tarek's solution will work. * Issue 133: Added --no-find-links to easy_install * Added easy_install --user * Issue 100: Fixed develop --user not taking '.' in PYTHONPATH into account * Issue 134: removed spurious UserWarnings. Patch by VanLindberg * Issue 138: cant_write_to_target error when setup_requires is used. * Issue 147: respect the sys.dont_write_bytecode flag ------ 0.6.10 ------ * Reverted change made for the DistributionNotFound exception because zc.buildout uses the exception message to get the name of the distribution. ----- 0.6.9 ----- * Issue 90: unknown setuptools version can be added in the working set * Issue 87: setupt.py doesn't try to convert distribute_setup.py anymore Initial Patch by arfrever. * Issue 89: added a side bar with a download link to the doc. * Issue 86: fixed missing sentence in pkg_resources doc. * Added a nicer error message when a DistributionNotFound is raised. * Issue 80: test_develop now works with Python 3.1 * Issue 93: upload_docs now works if there is an empty sub-directory. * Issue 70: exec bit on non-exec files * Issue 99: now the standalone easy_install command doesn't uses a "setup.cfg" if any exists in the working directory. It will use it only if triggered by ``install_requires`` from a setup.py call (install, develop, etc). * Issue 101: Allowing ``os.devnull`` in Sandbox * Issue 92: Fixed the "no eggs" found error with MacPort (platform.mac_ver() fails) * Issue 103: test_get_script_header_jython_workaround not run anymore under py3 with C or POSIX local. Contributed by Arfrever. * Issue 104: remvoved the assertion when the installation fails, with a nicer message for the end user. * Issue 100: making sure there's no SandboxViolation when the setup script patches setuptools. ----- 0.6.8 ----- * Added "check_packages" in dist. (added in Setuptools 0.6c11) * Fixed the DONT_PATCH_SETUPTOOLS state. ----- 0.6.7 ----- * Issue 58: Added --user support to the develop command * Issue 11: Generated scripts now wrap their call to the script entry point in the standard "if name == 'main'" * Added the 'DONT_PATCH_SETUPTOOLS' environment variable, so virtualenv can drive an installation that doesn't patch a global setuptools. * Reviewed unladen-swallow specific change from http://code.google.com/p/unladen-swallow/source/detail?spec=svn875&r=719 and determined that it no longer applies. Distribute should work fine with Unladen Swallow 2009Q3. * Issue 21: Allow PackageIndex.open_url to gracefully handle all cases of a httplib.HTTPException instead of just InvalidURL and BadStatusLine. * Removed virtual-python.py from this distribution and updated documentation to point to the actively maintained virtualenv instead. * Issue 64: use_setuptools no longer rebuilds the distribute egg every time it is run * use_setuptools now properly respects the requested version * use_setuptools will no longer try to import a distribute egg for the wrong Python version * Issue 74: no_fake should be True by default. * Issue 72: avoid a bootstrapping issue with easy_install -U ----- 0.6.6 ----- * Unified the bootstrap file so it works on both py2.x and py3k without 2to3 (patch by Holger Krekel) ----- 0.6.5 ----- * Issue 65: cli.exe and gui.exe are now generated at build time, depending on the platform in use. * Issue 67: Fixed doc typo (PEP 381/382) * Distribute no longer shadows setuptools if we require a 0.7-series setuptools. And an error is raised when installing a 0.7 setuptools with distribute. * When run from within buildout, no attempt is made to modify an existing setuptools egg, whether in a shared egg directory or a system setuptools. * Fixed a hole in sandboxing allowing builtin file to write outside of the sandbox. ----- 0.6.4 ----- * Added the generation of `distribute_setup_3k.py` during the release. This close http://bitbucket.org/tarek/distribute/issue/52. * Added an upload_docs command to easily upload project documentation to PyPI's http://packages.python.org. This close http://bitbucket.org/tarek/distribute/issue/56. * Fixed a bootstrap bug on the use_setuptools() API. ----- 0.6.3 ----- setuptools ========== * Fixed a bunch of calls to file() that caused crashes on Python 3. bootstrapping ============= * Fixed a bug in sorting that caused bootstrap to fail on Python 3. ----- 0.6.2 ----- setuptools ========== * Added Python 3 support; see docs/python3.txt. This closes http://bugs.python.org/setuptools/issue39. * Added option to run 2to3 automatically when installing on Python 3. This closes http://bitbucket.org/tarek/distribute/issue/31. * Fixed invalid usage of requirement.parse, that broke develop -d. This closes http://bugs.python.org/setuptools/issue44. * Fixed script launcher for 64-bit Windows. This closes http://bugs.python.org/setuptools/issue2. * KeyError when compiling extensions. This closes http://bugs.python.org/setuptools/issue41. bootstrapping ============= * Fixed bootstrap not working on Windows. This closes http://bitbucket.org/tarek/distribute/issue/49. * Fixed 2.6 dependencies. This closes http://bitbucket.org/tarek/distribute/issue/50. * Make sure setuptools is patched when running through easy_install This closes http://bugs.python.org/setuptools/issue40. ----- 0.6.1 ----- setuptools ========== * package_index.urlopen now catches BadStatusLine and malformed url errors. This closes http://bitbucket.org/tarek/distribute/issue/16 and http://bitbucket.org/tarek/distribute/issue/18. * zip_ok is now False by default. This closes http://bugs.python.org/setuptools/issue33. * Fixed invalid URL error catching. http://bugs.python.org/setuptools/issue20. * Fixed invalid bootstraping with easy_install installation http://bitbucket.org/tarek/distribute/issue/40. Thanks to Florian Schulze for the help. * Removed buildout/bootstrap.py. A new repository will create a specific bootstrap.py script. bootstrapping ============= * The boostrap process leave setuptools alone if detected in the system and --root or --prefix is provided, but is not in the same location. This closes http://bitbucket.org/tarek/distribute/issue/10. --- 0.6 --- setuptools ========== * Packages required at build time where not fully present at install time. This closes http://bitbucket.org/tarek/distribute/issue/12. * Protected against failures in tarfile extraction. This closes http://bitbucket.org/tarek/distribute/issue/10. * Made Jython api_tests.txt doctest compatible. This closes http://bitbucket.org/tarek/distribute/issue/7. * sandbox.py replaced builtin type file with builtin function open. This closes http://bitbucket.org/tarek/distribute/issue/6. * Immediately close all file handles. This closes http://bitbucket.org/tarek/distribute/issue/3. * Added compatibility with Subversion 1.6. This references http://bitbucket.org/tarek/distribute/issue/1. pkg_resources ============= * Avoid a call to /usr/bin/sw_vers on OSX and use the official platform API instead. Based on a patch from ronaldoussoren. This closes http://bitbucket.org/tarek/distribute/issue/5. * Fixed a SandboxViolation for mkdir that could occur in certain cases. This closes http://bitbucket.org/tarek/distribute/issue/13. * Allow to find_on_path on systems with tight permissions to fail gracefully. This closes http://bitbucket.org/tarek/distribute/issue/9. * Corrected inconsistency between documentation and code of add_entry. This closes http://bitbucket.org/tarek/distribute/issue/8. * Immediately close all file handles. This closes http://bitbucket.org/tarek/distribute/issue/3. easy_install ============ * Immediately close all file handles. This closes http://bitbucket.org/tarek/distribute/issue/3. Keywords: CPAN PyPI distutils eggs package management Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Python Software Foundation License Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2.4 Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Archiving :: Packaging Classifier: Topic :: System :: Systems Administration Classifier: Topic :: Utilities 07070100068621000081a4000000000000000000000001513ff56500000001000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/EGG-INFO/dependency_links.txt 0707010006868b000081a4000000000000000000000001513ff56500000701000000b500010002ffffffffffffffff0000005000000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.pyc e?Qc@s&dZedkr"e[ndS(c Csddl}ddl}ddl}ddl}|jjd}|dksd|jdkrm| rmg}n|j|j }t |di}|j t |}|j j t}x|D]}||ks| rqn|j|}|dk r&|jd} | dk r| jdPqqy"|jd|g\} } } Wntk r^qnX| dkrqqnz|jd| | | Wd| jXPqWtdtg|j D]}t|ddf^q} t |dd }d |_x|D]}t|qW|j|7_t|d \}}d}g}x|j D]}t|\}}||kr|dkrt |}n|| ks|dkr|j|qM|j|||d7}qMW||j (dS( Nit PYTHONPATHtwin32tpath_importer_cachetsites$Couldn't find the real 'site' moduleit __egginserti(tsystimptostos.pathtenvirontgettNonetplatformtsplittpathseptgetattrtpathtlentdirnamet__file__t find_modulet load_modulet ImportErrortclosetdicttmakepathRt addsitedirtappendtinsert(RRRRtpictstdpathtmydirtitemtimportertloadertstreamRtdescrt known_pathstoldpostdtndt insert_attnew_pathtptnp((sJ/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.pyt__boots\0"     "    2  RN(R-t__name__(((sJ/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/site.pyts G 07070100068628000081a4000000000000000000000001513ff56500019fa7000000b500010002ffffffffffffffff0000005900000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyc e?QcC@s} dZddlZddlZddlZddlZddlZddlZddlZddlmZm Z ye Wn!e k rddl m Z nXddlmZy&ddlmZmZmZeZWnek reZnXddlmZddlmZmZeZd d ZiZd Zd Zd Z dZ!dZ"dZ#dZ$dZ%Z&dZ'ddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVgCZ(d/e)fdWYZ*d0e*fdXYZ+d1e*fdYYZ,d2e*fdZYZ-iZ.ej/d[ Z0d[Z1d\Z2d]Z3d^Z4dZ5d_Z6d`Z7gdaZ8dbZ9dcZ:ej;ddZ<ej;deZ=e:Z>dfZ?dgZ@e@ZAdhZBdiZCeDdjZEdkZFdEfdlYZGdFeGfdmYZHd*eIfdnYZJd)eIfdoYZKeKZLd3eMfdpYZNd+fdqYZOdrZPdsZQdtZRduZSdvZTdLfdwYZUe6eIeUdMeUfdxYZVdNeVfdyYZWe6eXeDeWyddlYZYWnek rnXe6eYjZeWdJeUfdzYZ[e[Z\dOeVfd{YZ]e6ej^e]dGe[fd|YZ_dHeWfd}YZ`dIe]fd~YZadfdYZbdfdYZcdZdyddlemdZdmfZfWnek rn XefZb[c[feddidZgedZhedZiegej^eidajedZkegeIekedZlegebelyddlYZYWnek r=nXegeYjmeleddieddidZndZodZpeDdZqdZreneberenej^eryddlYZYWnek rnXeneYjmerdZseneIesdZtidZudZvdZwej;djxZyej;djxZzej;djxZ{ej;djxZ|ej;djxZ}ej;djxZ~ej;djxZej;djxZej;dejejBjxZej;dejZidd6dd6dd6dd6dd6jZdZdZd.eIfdYZdZd,eIfdYZdefdYZied6ed6ed6ZdZdZdZd-fdYZidd6dd6dd6dd6dd6dd6ZdZdZdZdZdZdZeOZdZeeedd#eJyddlmZWnek r nXyejeWne+k r% eJgZx0ejeeeKD]Zejeq Wx0ejD]%Zeejkr ejenq Wejej(nXejZejZejZej@Z@e@ZAedge_eejejdS(sYPackage resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipulate resource names being passed into the API. The package resource API is designed to work with normal filesystem packages, .egg files, and unpacked .egg files. It can also work in a limited way with .zip files and with custom PEP 302 loaders that support the ``get_data()`` method. iN(turlparset urlunparse(t ImmutableSet(tutime(tmkdirtrenametunlink(topen(tisdirtspliticCs^tstdnt|\}}|rZ|rZt| rZt|t||ndS(Ns*"os.mkdir" not supported on this platform.(t WRITE_SUPPORTtIOErrorR Rt_bypass_ensure_directoryR(tnametmodetdirnametfilename((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR -s  cKs>t}x.|jD] \}}|||<|t|YscCs{t}tj|}|dk rwtjdkrwy-ddjtd |jdf}Wqwt k rsqwXn|S(sZReturn this platform's maximum compatible version. distutils.util.get_platform() normally reports the minimum version of Mac OS X that would be required to *use* extensions produced by distutils. But what we want when checking compatibility is to know the version of Mac OS X that we are *running*. To allow usage of packages that explicitly require a newer version of Mac OS X, we must also know the current version of the OS. If this condition occurs for any other platform with a version in its platform strings, this function should be extended accordingly. tdarwins macosx-%s-%st.iiN( tget_build_platformtmacosVersionStringtmatchR)tsystplatformtjoint _macosx_verstgroupt ValueError(tplattm((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytget_supported_platform]s - trequiret run_scriptt get_providertget_distributiontload_entry_pointt get_entry_maptget_entry_infotiter_entry_pointstresource_stringtresource_streamtresource_filenametresource_listdirtresource_existstresource_isdirtdeclare_namespacet working_settadd_activation_listenertfind_distributionstset_extraction_pathtcleanup_resourcestget_default_cachet Environmentt WorkingSettResourceManagert Distributiont Requirementt EntryPointtResolutionErrortVersionConflicttDistributionNotFoundt UnknownExtratExtractionErrortparse_requirementst parse_versiont safe_namet safe_versiont get_platformtcompatible_platformst yield_linestsplit_sectionst safe_extrat to_filenametensure_directorytnormalize_pathtEGG_DISTt BINARY_DISTt SOURCE_DISTt CHECKOUT_DISTt DEVELOP_DISTtIMetadataProvidertIResourceProvidert FileMetadatat PathMetadatat EggMetadatat EmptyProvidertempty_providert NullProvidert EggProvidertDefaultProvidert ZipProvidertregister_findertregister_namespace_handlertregister_loader_typetfixup_namespace_packagest get_importertrun_maintAvailableDistributionscBseZdZdZRS(s.Abstract base for dependency resolution errorscCs|jjt|jS(N(t __class__t__name__treprR*(tself((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt__repr__s(R~t __module__t__doc__R(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRUscBseZdZRS(sAAn already-installed version conflicts with the requested version(R~RR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRVscBseZdZRS(s&A requested distribution was not found(R~RR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRWscBseZdZRS(s>Distribution doesn't have an "extra feature" of the given name(R~RR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRXsiiiicCs|t|(RR5R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR>OscCst|j|S(s=Return the entry point map for `group`, or the full entry map(R=R?(RR5((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR?SscCst|j||S(s<Return the EntryPoint object for `group`+`name`, or ``None``(R=R@(RR5R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR@WscBs>eZdZdZdZdZdZdZRS(cCsdS(s;Does the package's distribution contain the named metadata?N((R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt has_metadata^scCsdS(s'The named metadata resource as a stringN((R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt get_metadataascCsdS(sYield named metadata resource as list of non-blank non-comment lines Leading and trailing whitespace is stripped from each line, and lines with ``#`` as the first non-blank character are omitted.N((R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytget_metadata_linesdscCsdS(s>Is the named metadata a directory? (like ``os.path.isdir()``)N((R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytmetadata_isdirjscCsdS(s?List of metadata names in the directory (like ``os.listdir()``)N((R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytmetadata_listdirmscCsdS(s=Execute the named script in the supplied namespace dictionaryN((Rt namespace((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR;ps(R~RRRRRRR;(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRk\s      cBsDeZdZdZdZdZdZdZdZRS(s3An object that provides access to package resourcescCsdS(sdReturn a true filesystem path for `resource_name` `manager` must be an ``IResourceManager``N((tmanagert resource_name((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytget_resource_filenamescCsdS(siReturn a readable file-like object for `resource_name` `manager` must be an ``IResourceManager``N((RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytget_resource_streamscCsdS(smReturn a string containing the contents of `resource_name` `manager` must be an ``IResourceManager``N((RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytget_resource_stringscCsdS(s,Does the package contain the named resource?N((R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt has_resourcescCsdS(s>Is the named resource a directory? (like ``os.path.isdir()``)N((R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRGscCsdS(s?List of resource names in the directory (like ``os.listdir()``)N((R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyREs( R~RRRRRRRGRE(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRl|s     cBseZdZddZdZdZdZddZdZ dZ de dZ dde d Z dde d Zd Zd Zd ZdZdZRS(sDA collection of active distributions on sys.path (or a similar list)cCs^g|_i|_i|_g|_|dkr<tj}nx|D]}|j|qCWdS(s?Create working set from list of path entries (default=sys.path)N(tentriest entry_keystby_keyt callbacksR)R1Rt add_entry(RRtentry((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt__init__s       cCsT|jj|g|jj|x*t|tD]}|j||tq3WdS(sAdd a path item to ``.entries``, finding any distributions on it ``find_distributions(entry,True)`` is used to find distributions corresponding to the path entry, and they are added. `entry` is always appended to ``.entries``, even if it is already present. (This is because ``sys.path`` can contain the same value more than once, and the ``.entries`` of the ``sys.path`` WorkingSet should always equal ``sys.path``.) N(Rt setdefaultRRRKRtaddR(RRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs cCs|jj|j|kS(s9True if `dist` is the active distribution for its project(RRR$(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt __contains__scCsG|jj|j}|dk r?||kr?t||n|SdS(sFind a distribution matching requirement `req` If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by `req`. But, if there is an active distribution for the project and it does *not* meet the `req` requirement, ``VersionConflict`` is raised. If there is no active distribution for the requested project, ``None`` is returned. N(RRR$R)RV(RtreqR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs ccsgx`|D]X}|j|}|dkrGx4|jD] }|Vq5Wq||kr||VqqWdS(sYield entry point objects from `group` matching `name` If `name` is None, yields all entry points in `group` from all distributions in the working set, otherwise only ones matching both `group` and `name` are yielded (in distribution order). N(R?R)tvalues(RR5R RRtep((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRAs    cCsQtjdj}|d}|j||d<|j|dj||dS(s?Locate distribution for `requires` and run `script_name` scriptiR~iN(R1RRR"R:R;(RtrequiresRRR ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR;s    ccspi}xc|jD]X}||jkr+qnx:|j|D]+}||kr9d||<|j|Vq9q9WqWdS(sYield distributions for non-duplicate projects in the working set The yield order is the order in which the items' path entries were added to the working set. iN(RRR(RtseentitemR$((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt__iter__s  cCs|r|j|j|n|dkr4|j}n|jj|g}|jj|jg}|j|jkrwdS||j|j<|j|kr|j|jn|j|kr|j|jn|j |dS(sAdd `dist` to working set, associated with `entry` If `entry` is unspecified, it defaults to the ``.location`` of `dist`. On exit from this routine, `entry` is added to the end of the working set's ``.entries`` (if it wasn't already present). `dist` is only added to the working set if it's for a project that doesn't already have a distribution in the set. If it's added, any callbacks registered with the ``subscribe()`` method will be called. N( t insert_onRR)tlocationRRR$RRt _added_new(RRRtinserttkeystkeys2((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs   c Cszt|ddd}i}i}g}xH|ru|jd}t|rg|rgtjd}n||kryq.n|j|j} | dkr$|jj|j} | dkr|dkrt |j }n|j |||} ||j<| dkrt |qn|j | n| |krBt| |n|j| j|jdddt||scCsdS(N((R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRAsN( R~RRRKRHRGRLR)RDR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRp9s    cBseZdZd ZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd ZRS(s"Resource support for zips and eggscCs@tj||tj|jj|_|jjtj|_ dS(N( RsRt zipimportt_zip_directory_cacheRtarchivetzipinfoRtseptzip_pre(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRNscCs@|j|jr#|t|jStd||jfdS(Ns%s is not a subpath of %s(RRlRQtAssertionError(Rtfspath((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt _zipinfo_nameSscCsd|j|}|j|jtjrG|t|jdjtjStd||jfdS(Nis%s is not a subpath of %s(RlRR`RRkRQR Rm(Rtzip_pathRn((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt_parts\s  !cCs|jstdn|j|}|j}dj|j||kr~x*|D]}|j||j|qXWn|j||S(Ns5resource_filename() only supported for .egg, not .zipRX(R[RWt_resource_to_zipt_get_eager_resourcesR3Rqt_extract_resourcet _eager_to_zip(RRRRpteagersR ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRes     c Cs||jkr^x9|j|D]'}|j|tjj||}q#Wtjj|S|j|}|d|d|d}}}|d?d|d?d@|d@|d@d ?|d?d @|d@d d d d f } tj| } yt st dn|j |j |j |} tjj| rctj| } | j|krc| j| krc| Sntddtjj| \} }tj| |jj|tj| t|| | f|j|| yt|| Wntjk rmtjj| rgtj| } | j|kr:| j| kr:| Stjdkrgt| t|| | SnnXWntjk r|jnX| S(Niiii iiiii i?iiis>"os.rename" and "os.unlink" are not supported on this platforms .$extracttdirR2(t_indexRtRRR3RRjttimetmktimeR R R)R[RqtisfileR+tst_sizetst_mtimet_mkstemptwriteRRZReRR/RterrorR RR$(RRRpR tlasttzip_stattttdtsizet date_timet timestampt real_pathR+toutfttmpnam((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRtrsN  0$    cCsa|jdkrZg}x6dD].}|j|r|j|j|qqW||_n|jS(Nsnative_libs.txtseager_resources.txt(snative_libs.txtseager_resources.txt(RvR)RRR(RRvR ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRss  cCsy |jSWntk ri}x~|jD]s}|jtj}xX|rtjj|d }||kr||j|dPqF|jg||PEP 302 Importer that wraps Python's "normal" import algorithmcCs ||_dS(N(R(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRIscCs|jdd}||kr2|jdkr2dS|jdkrJd}n |jg}ytj||\}}}Wntk rdSXt|||S(NR-i(R RR)timpt find_moduleRt ImpLoader(RtfullnameRtsubnametfileRtetc((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRLs   N(R~RRR)RR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRFs RcBs eZdZdZdZRS(s<PEP 302 Loader that wraps Python's "normal" import algorithmcCs||_||_||_dS(N(RRR(RRRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR^s  cCsFz%tj||j|j|j}Wd|jrA|jjnX|S(N(Rt load_moduleRRRRe(RRtmod((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRcs % (R~RRRR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR[s cCsytj|}WnPtk rcx@tjD]+}y||}Wntk rTq+XPq+Wd}nXtjj|||dkryt|}Wqtk rqXn|S(sRetrieve a PEP 302 "importer" for the given path item If there is no importer, this returns a wrapper around the builtin import machinery. The returned importer is only cached if it was created by a path hook. N(R1tpath_importer_cacheRt path_hooksRR)RR(t path_itemRthook((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRzos"     (Rzt ImpImporterRt_distribution_finderscCs|t|=?|==|!=)\s*((\w|[-.])+)s\s*,s\s*\[s\s*\]s \w+(\.\w+)*$sL(?P[^-]+)( -(?P[^-]+) (-py(?P[^-]+) (-(?P.+))? )? )?s(\d+ | [a-z]+ | \.| -)tctpretpreviewsfinal-R?trct@tdevccsnxbtj|D]Q}t||}|dkr7qn|d dkrX|jdVqd|VqWdVdS( NRR-it 0123456789it*s*final(RR-(t component_reR Rtzfill(Rtpart((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt_parse_version_partss  cCssg}x`t|jD]L}|jdrXx'|rT|ddkrT|jq1Wn|j|qWt|S(sConvert a version string to a chronologically-sortable key This is a rough cross between distutils' StrictVersion and LooseVersion; if you give it versions that would work with StrictVersion, then it behaves the same; otherwise it acts like a slightly-smarter LooseVersion. It is *possible* to create pathological version coding schemes that will fool this parser, but they should be very rare in practice. The returned value will be a tuple of strings. Numeric portions of the version are padded to 8 digits so they will compare numerically, but without relying on how numbers compare relative to strings. Dots are dropped, but dashes are retained. Trailing zeros between alpha segments or dashes are suppressed, so that e.g. "2.4.0" is considered the same as "2.4". Alphanumeric parts are lower-cased. The algorithm assumes that strings like "-" and any alpha string that alphabetically follows "final" represents a "patch level". So, "2.4-1" is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is considered newer than "2.4-1", which in turn is newer than "2.4". Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that come before "final" alphabetically) are assumed to be pre-release versions, so that the version "2.4" is considered newer than "2.4a1". Finally, to handle miscellaneous cases, the strings "pre", "preview", and "rc" are treated as if they were "c", i.e. as though they were release candidates, and therefore are not as new as a version string that does not contain them, and "dev" is replaced with an '@' so that it sorts lower than than any other pre-release tag. Rit00000000(RRRRRttuple(RRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR[scBseZdZd d d dZdZdZed d dZd d dZ d dZ e e Z d dZ e e Z d dZ e e Z RS( s3Object representing an advertised importable objectcCsnt|std|n||_||_t||_tjddj|j |_ ||_ dS(NsInvalid module namesx[%s]t,( tMODULER6R t module_nameRtattrsRSRR3RR(RR RRRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs   "cCsfd|j|jf}|jr<|ddj|j7}n|jrb|ddj|j7}n|S(Ns%s = %st:R-s [%s]R(R RRR3R(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt__str__s   cCsdt|S(NsEntryPoint.parse(%r)(R(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRscCs|r|j||nt|jttdg}xN|jD]C}yt||}WqDtk rtd||fqDXqDW|S(NR~s%r has no %r attribute(R:RRRRRRR(RR:RRRtattr((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytloads! cCsW|jr%|j r%td|nttjtj|jj|j||dS(Ns&Can't require() without a distribution(RRRXRRIRRR(RRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR:s cCsyd }}|jdd\}}d|krz|jdd\}}tjd|}|jrntn|j}nd|kr|jdd\}}t|jstn|jjd}nWn tk rtd|n#X||j|j|||SdS( sParse a single entry point from string `src` Entry point syntax follows the form:: name = some.module:some.attr [extra1,extra2] The entry name and module name are required, but the ``:attrs`` and ``[extras]`` parts are optional t=it[sx[RR-s9EntryPoint must be in 'name=module:attrs [extras]' formatN(( R RSRtspecsR6RRRR(tclstsrcRRRR tvalueR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs&         cCst|std|ni}xZt|D]L}|j||}|j|krptd||jn|||jEnsure distribution is importable on `path` (default=sys.path)snamespace_packages.txtN( R)R1RRRyRRRHR(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytactivates    cCsOdt|jt|j|jp'tf}|jrK|d|j7}n|S(s@Return what this distribution's standard .egg filename should bes %s-%s-py%sR?(RcRRR RR2(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR[s  cCs(|jrd||jfSt|SdS(Ns%s (%s)(RR(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs cCsMyt|dd}Wntk r/d}nX|p9d}d|j|fS(NRs[unknown version]s%s %s(RR)R6R(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRs   cCs+|jdrt|nt|j|S(sADelegate all unrecognized public attributes to .metadata providerR(RRRR(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt __getattr__s cKs(|jt|tjj|||S(N(RRRRR_(RRRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRscCstjd|j|jfS(s?Return a ``Requirement`` that matches this distribution exactlys%s==%s(RSRRR(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRscCsD|j||}|dkr:td||ffn|jS(s=Return the `name` entry point of `group` or raise ImportErrorsEntry point %r not foundN(R@R)RR(RR5R R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR> s cCscy |j}Wn3tk rBtj|jd|}|_nX|dk r_|j|iS|S(s=Return the entry point map for `group`, or the full entry mapsentry_points.txtN(t_ep_mapRRTRRR)R(RR5tep_map((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR? s    cCs|j|j|S(s<Return the EntryPoint object for `group`+`name`, or ``None``(R?R(RR5R ((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR@ sc Cs|p |j}|jdkrpy |j}Wntk rDd}nXd|krptdt|jqpn|szdS|tjkr|jnt|}t jj |}t t|}d}xzt |D][\}} | |krPq| |kr|jtkr|j|||j||PqqW|j|dSxFy|j||d} Wntk rwPqIX|| =|| =| }qIdS(s@Insert self.location in path before its nearest parent directoryt setuptoolsRs0.7sLA 0.7-series setuptools cannot be installed with distribute. Found one at %sNi(RRRR6RR1Rtcheck_version_conflictRRRRR)t enumerateRRfRRtindex( RRtlocRtnloctbdirtnpathtbptpRtnp((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR+ sF          c Cs|jdkrdStj|jd}t|j}x|jdD]}|tjksJ||ksJ|tkr}qJn|d krqJnt tj|dd}|rt|j |sJ|j |jrqJnt d|||jfqJWdS( NRsnamespace_packages.txts top_level.txtt pkg_resourcesRtsiteRCsIModule %s was already imported from %s, but %s is being added to sys.path(s pkg_resourcess setuptoolsssite( R$RRRReRR1RRRR)Rt issue_warning(RtnspRtmodnametfn((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR_ s"  cCs8y |jWn&tk r3tdt|tSXtS(NsUnbuilt egg for (RR6R'RRR(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRu s   cKsMx*dD]"}|j|t||d qW|jd|j|j|S( s@Copy this distribution, substituting in any changed keyword argsRRR R2RRR(s project_namesversions py_versionsplatformslocations precedenceN(RRR)RR}(RRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytclone} s   cCs g|jD]}|r |^q S(N(R(Rtdep((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR sN(((R~RRRR)RRfRRRtpropertyRRRRRR R R R$RRRRRRR[RRRRRR>R?R@RRRR+R(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRRHsT                           4    tDistInfoDistributioncBsSeZdZdZejdZedZedZ dZ dZ RS(sGWrap an actual or potential sys.path entry w/metadata, .dist-info styletMETADATAs([\(,])\s*(\d.*?)\s*([,\)])cCsXy |jSWnFtk rSddlm}|j|j|j|_|jSXdS(sParse and cache metadatai(tParserN(t _pkg_infoRt email.parserR0tparsestrRR(RR0((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt_parsed_pkg_info s   !cCs6y |jSWn$tk r1|j|_|jSXdS(N(t_DistInfoDistribution__dep_mapRt_compute_dependencies(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR s   cCsy|jdddg}|dj}|dj}tj|jd|}|jddjdd}||fS(sConvert 'Foobar (1); baz' to ('Foobar ==1', 'baz') Split environment marker, add == prefix to version specifiers as necessary, and remove parenthesis. t;iRis\1==\2\3t(t)(R RR@RAtEQEQR(Rt requires_distRtdistverstmark((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt_preparse_requirement s c sBd}yddlm}Wntk r6|}nXigd6}|_gxc|jjdpigD]I}|j|\}}t|j }|||_ j |qjWfd}t |d} |dj | xR|jjdpgD]8} t| j} tt || | || RZtnextRARtsetRRbRR( RRCRDRRR<R=RREtcommonRB((RsS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR6 s&   $( R~RRRR@RRR:R-R4RR>R6(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR. s  s.eggs .egg-infos .dist-infocOs{d}t}y-x&tj|j|kr:|d7}qWWntk rOnXddlm}|d|d||dS(Nii(twarnt stacklevel(RR1RRR6twarningsRK(R*RtlevelRRK((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR' s  c #s#tt|fd}xD]}t|}|sRtd|n|jd}|j}g}t||}|r|j}|tt||dd\}}}n|tt ||d d\}}}g|D]\}} |t | f^q}t |||Vq(WdS( sYield ``Requirement`` objects for each specification in `strs` `strs` must be an instance of ``basestring``, or a (possibly-nested) iterable thereof. cs?g}x|||s t||r`yj}d}Wq`tk r\tdq`Xn|||}|std|d|d||n|j|j||j}t||}|r|j}q |||s td|d||q q W|||}|r2|j}n|||fS(Nis+\ must not appear on the last nonblank lines Expected s intatsExpected ',' or end-of-list in(tCONTINUERHt StopIterationR6RR5tendtCOMMA(tITEMt TERMINATORRR#tgroupst item_nameRR0(R(sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt scan_list s0  $ sMissing distribution specis 'extra' nameis version specN(i(ii( titerR`tDISTROR6R5RRtOBRACKETtCBRACKETtVERSIONtLINE_ENDR]RS( RRXRR0RR#RRtopR((RsS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRZ s"    $$+cCs\g|D]}|j|f^q}|jg|D]\}}|^q3|dddDO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!N(R\t unsafe_nameRRR$R[t state_machineRRRRRbRRt frozensetthashCmpRt_Requirement__hash( RRRRR_RRRttransR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRR s5 ."4cCsgdjg|jD]}dj|^q}dj|j}|rSd|}nd|j||fS(NRRs[%s]s%s%s%s(R3RRR(RRRR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR` s . cCst|to|j|jkS(N(RRSRe(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR f sc Cs t|tr=|j|jkr%tS|jr[|j}q[nt|tr[t|}nd}d}x|jD]{\}}}}||||}|dkrtS|dkrt S|dkrt }qt|dks|dkrtt}qtqtW|dkrt }n|S(NcSs||k||kS(N((tatb((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR+p stFtTt+R?( RRRR$RRRRR[R)R( RRRtcompareRRgR_Rtaction((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRi s,       cCs|jS(N(Rf(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR{ scCsdt|S(NsRequirement.parse(%r)(R(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR~ scCstt|}|rt|dkr}|d}t|rv|rvttd}t|dkrr|dS|S|Sntd|ntd|dS(NiiRsExpected only one requirementsNo requirements found(RRZRQRR6(RRRt founded_reqR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR s ( R~RRRR RRRRRt staticmethod(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRSQ s       s--TtsT+Fs>=sT..s==sF++s!=cCsc|jdkr_t|js"tSx6|jD]+\}}|dkr,d|krWtSq,q,WtStS(sReturn True when distribute wants to override a setuptools dependency. We want to override when the requirement is setuptools and the version is a variant of 0.6. Rs==s>=Rrs0.7(s==s>=Rr(RRQRRR(Rt comparatorR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR s   cCs:t|ts3d|tfdY}|jdS|jS(s&Get an mro for a type or classic classRcBseZRS((R~R(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR si(Rttypetobjectt__mro__(R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyt_get_mro s cCsAx:tt|dt|D]}||kr||SqWdS(s2Return an adapter factory for `ob` from `registry`R}N(RwRRt(tregistryR%R((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR s% cCs8tjj|}tjj|s4tj|ndS(s1Ensure that the parent directory of `path` existsN(RRRRtmakedirs(RR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRd sccsd}g}xt|D]y}|jdr|jdrs|sI|rW||fVn|dd!j}g}qtd|q|j|qW||fVdS(srSplit a string or iterable thereof into (section,content) pairs Each ``section`` is a stripped version of the section header ("[section]") and each ``content`` is a list of stripped lines excluding blank lines and comment-only lines. If there are any such lines before the first section header, they're returned in a first ``section`` of ``None``. Rt]iisInvalid section headingN(R)R`RR^RR6R(RtsectiontcontentR((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyRa s  cOsDddlm}tj}ztt_|||SWd|t_XdS(Ni(tmkstemp(ttempfileR}RRtos_open(R*RR}told_open((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pyR~ s   cCs@x9ttD]+}|jds tt|||R)R?R@RkRlRuRPROR|R;RYRQRNR\R]RbRcRrRsRtRtt_frozen_importlibtSourceFileLoaderRpRqRuRRmRnRoRRRztpkgutilRRvRKRRFRRt FileFinderRwRRHRyRRReRRR`R0R^RPRZR]RSR[R\RtVERBOSEt IGNORECASERRRRRR[RTRRRR.RR'RZRRSRcRRwRRdRaR~RRRt__main__RRIR:RRRRRRRRARRJR(((sS/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.pytsT               +                     3      )0 )  d   ,       #            , (w IG   # = E                   07070100068629000041ed000000000000000000000004513ff7e600000000000000b500010002ffffffffffffffff0000005200000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools07070100068631000041ed000000000000000000000002513ff7e600000000000000b500010002ffffffffffffffff0000005a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command07070100068649000081a4000000000000000000000001513ff5660000138f000000b500010002ffffffffffffffff0000006f00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyc e?Qc@stddlmZddlmZddlmZmZddlZddlZddl Z defdYZ dS(i(tCommand(tunpack_archive(tlogtdir_utilNtinstall_egg_infocBs\eZdZdZd gZdZdZdZdZdZ d Z d Z RS( s.Install an .egg-info directory for the packages install-dir=tdsdirectory to install tocCs d|_dS(N(tNonet install_dir(tself((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pytinitialize_optionsscCs|jdd|jd}tjdd|j|jjd}|j|_t j j |j ||_ |j g|_dS(Nt install_libRtegg_infos .egg-info(s install_dirs install_dir(tset_undefined_optionstget_finalized_commandt pkg_resourcest DistributionRtegg_namet egg_versionR tsourcetostpathtjoinRttargettoutputs(Rtei_cmdtbasename((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pytfinalize_optionss cCs|jd|j}tjj|jr]tjj|j r]tj|jd|jn;tjj |jr|j tj |jfd|jn|jst j |jn|j |jdd|j|jf|jdS(NR tdry_runs Removing sCopying %s to %s((t run_commandRRRtisdirtislinkRt remove_treeRtexiststexecutetunlinkRtensure_directorytcopytreeRtinstall_namespaces(RR((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pytruns  +& cCs|jS(N(R(R((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyt get_outputs*scs)fd}tjj|dS(Ncs[x1dD])}|j|s,d||krdSqWjj|tjd|||S(Ns.svn/sCVS/t/sCopying %s to %s(s.svn/sCVS/(t startswithRRtappendRtdebug(tsrctdsttskip(R(si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pytskimmer/s  (RRR(RR/((Rsi/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyR$-s cCs|j}|sdStjj|j\}}|d7}|jj|tjd||j st |d}xy|D]q}t |}t |j d}d}d|krddj|d |df}n|jdtqzW|jndS( Ns -nspkg.pths Installing %stwtt.s s(; m and setattr(sys.modules[%r], %r, m) is7import sys,types,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *%(pth)r); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault(%(pkg)r,types.ModuleType(%(pkg)r)); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p)%(trailer)s(t_get_all_ns_packagesRRtsplitextRRR*RtinfoRtopentstrttupletsplitRtwritetlocalstclose(Rtnsptfilenametexttftpkgtpthttrailer((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyR%Ss(      !cCsvi}xS|jjpgD]?}|jd}x'|rWd|dj|<|jq1WqWt|}|j|S(NR1i(t distributiontnamespace_packagesR8Rtpoptlisttsort(RR<R@((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyR2rs   (s install-dir=Rsdirectory to install to( t__name__t __module__t__doc__t descriptiont user_optionsR RR&R'R$R%R2(((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyRs     & ( t setuptoolsRtsetuptools.archive_utilRt distutilsRRRtshutilRR(((si/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyts$0707010006864a000081ed000000000000000000000001513ff565000009b6000000b500010002ffffffffffffffff0000006900000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyfrom distutils.command.install_lib import install_lib as _install_lib import os class install_lib(_install_lib): """Don't add compiled flags to filenames of non-Python files""" def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: if not py_file.endswith('.py'): continue if self.compile: bytecode_files.append(py_file + "c") if self.optimize > 0: bytecode_files.append(py_file + "o") return bytecode_files def run(self): self.build() outfiles = self.install() if outfiles is not None: # always compile, in case we have any extension stubs to deal with self.byte_compile(outfiles) def get_exclusions(self): exclude = {} nsp = self.distribution.namespace_packages if (nsp and self.get_finalized_command('install') .single_version_externally_managed ): for pkg in nsp: parts = pkg.split('.') while parts: pkgdir = os.path.join(self.install_dir, *parts) for f in '__init__.py', '__init__.pyc', '__init__.pyo': exclude[os.path.join(pkgdir,f)] = 1 parts.pop() return exclude def copy_tree( self, infile, outfile, preserve_mode=1, preserve_times=1, preserve_symlinks=0, level=1 ): assert preserve_mode and preserve_times and not preserve_symlinks exclude = self.get_exclusions() if not exclude: return _install_lib.copy_tree(self, infile, outfile) # Exclude namespace package __init__.py* files from the output from setuptools.archive_util import unpack_directory from distutils import log outfiles = [] def pf(src, dst): if dst in exclude: log.warn("Skipping installation of %s (namespace package)",dst) return False log.info("copying %s -> %s", src, os.path.dirname(dst)) outfiles.append(dst) return dst unpack_directory(infile, outfile, pf) return outfiles def get_outputs(self): outputs = _install_lib.get_outputs(self) exclude = self.get_exclusions() if exclude: return [f for f in outputs if f not in exclude] return outputs 07070100068659000081a4000000000000000000000001513ff56600001672000000b500010002ffffffffffffffff0000006300000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyc e?Qc@s|ddlmZddlmZddlZddlTddlmZmZdefdYZ defd YZ dS( i(tCommand(tDistutilsOptionErrorN(t*(t TestLoadertmaintScanningLoadercBseZdZRS(cCs&g}|jdkr1|jtj||nt|drV|j|jnt|drxt|jdD]|}|jdr|dkr|jd|d }n-t|j|d rx|jd|}nqx|j|j |qxWnt |d kr|j |S|d Sd S( sReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. ssetuptools.tests.doctesttadditional_testst__path__ts.pys __init__.pyt.is /__init__.pyiiN( t__name__tappendRtloadTestsFromModulethasattrRtresource_listdirtendswithtresource_existstloadTestsFromNametlent suiteClass(tselftmoduletteststfilet submodule((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyR s" (R t __module__R (((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyRsttestcBsMeZdZdZd dgZdZd Zd Zd Zd Z RS(s.Command to run unit tests after in-place builds#run unit tests after in-place builds test-module=tms$Run 'test_suite' in specified modules test-suite=tss1Test suite to run (e.g. 'some_module.test_suite')cCsd|_d|_d|_dS(N(tNonet test_suitet test_modulet test_loader(R((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pytinitialize_options6s  cCs|jdkrC|jdkr0|jj|_q[|jd|_n|jr[tdn|jg|_|jr|jjddn|jdkrt |jdd|_n|jdkrd|_ndS(Ns .test_suites1You may specify a module or a suite, but not bothis --verboseR s&setuptools.command.test:ScanningLoader( RRRt distributionRt test_argstverbosetinsertR tgetattr(R((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pytfinalize_options<s   cCs|t|jdtr|jddd|jd|jd}t|j}|jdd||jd|jddd|jdn-|jd|jddd|jd|jd}tj }tj j }zXtj j dt|j tjtd td |j|jf|Wd|tj (tj jtj j|tjXdS( Ntuse_2to3tbuild_pytinplaceitegg_infotegg_baset build_exticSs |jS(N(tactivate(tdist((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pytsss%s==%s(R&R"tFalsetreinitialize_commandt run_commandtget_finalized_commandtnormalize_patht build_libtsystpathtmodulestcopyR%R,t working_sett__init__tadd_activation_listenertrequiretegg_namet egg_versiontcleartupdate(Rtfunctbpy_cmdt build_pathtei_cmdtold_patht old_modules((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pytwith_project_on_sys_pathSs2          cCs|jjr%|jj|jjn|jjrJ|jj|jjn|jrdj|j}|jr|jd|q|jd||j |j ndS(Nt s skipping "unittest %s" (dry run)srunning "unittest %s"( R"tinstall_requirestfetch_build_eggst tests_requireRtjoinR#tdry_runtannounceRIt run_tests(Rtcmd((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pytrun}s    cCsaddl}tjd|j}|jdt}|jdd|jg|j d|dS(Nisx=R>t testLoader( tunittestt EntryPointtparseR tloadR1RRt__file__R#(RRUt loader_ept loader_class((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyRQs  (s test-module=Rs$Run 'test_suite' in specified module(s test-suite=Rs1Test suite to run (e.g. 'some_module.test_suite')( R Rt__doc__t descriptiont user_optionsR!R'RIRSRQ(((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyR*s    * ( t setuptoolsRtdistutils.errorsRR7t pkg_resourcesRURRRR(((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyts   #07070100068651000081a4000000000000000000000001513ff56600000bfa000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pyc e?Qc@slddlZddlZddlmZddlmZddlmZddlTdefdYZdS(iN(tCommand(t convert_path(tlog(t*trotatecBsDeZdZdZdddgZgZd Zd Zd ZRS(sDelete older distributionss2delete older distributions, keeping N newest filessmatch=tmspatterns to match (required)s dist-dir=tds%directory where the distributions areskeep=tks(number of matching distributions to keepcCsd|_d|_d|_dS(N(tNonetmatchtdist_dirtkeep(tself((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pytinitialize_optionss  cCs|jdkrtdn|jdkr<tdnyt|j|_Wntk rqtdnXt|jtrg|jjdD]}t |j ^q|_n|j dddS(NsQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')s$Must specify number of files to keeps--keep must be an integert,tbdistR (sdist_dirsdist_dir( R RtDistutilsOptionErrorR tintt ValueErrort isinstancet basestringtsplitRtstriptset_undefined_options(R tp((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pytfinalize_optionss  7cCs|jdddlm}x|jD]}|jjd|}|tjj|j|}g|D]}tjj ||f^qi}|j |j t j dt||||j}x=|D]5\}}t j d||jstj|qqWq'WdS(Ntegg_infoi(tglobRs%d file(s) matching %ss Deleting %s(t run_commandRR t distributiontget_nametostpathtjoinR tgetmtimetsorttreverseRtinfotlenR tdry_runtunlink(R Rtpatterntfilestftt((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pytrun*s +    (smatch=Rspatterns to match (required)(s dist-dir=Rs%directory where the distributions are(skeep=Rs(number of matching distributions to keep( t__name__t __module__t__doc__t descriptiont user_optionstboolean_optionsR RR-(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pyRs   ( t distutilsRt setuptoolsRtdistutils.utilRRtdistutils.errorsR(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pyts  07070100068657000081a4000000000000000000000001513ff566000018dd000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyc e?Qc@sddlZddlZddlmZddlmZddlmZddlTdddd gZd d Z e d Z defd YZ d e fdYZ dS(iN(tCommand(t convert_path(tlog(t*t config_filet edit_configt option_basetsetopttlocalcCs|dkrdS|dkr>tjjtjjtjdS|dkrtjdkr_dpbd}tjjtd |St d |d S( sGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" Rs setup.cfgtglobals distutils.cfgtusertposixt.ts~/%spydistutils.cfgs7config_file() type must be 'local', 'global', or 'user'N( tostpathtjointdirnamet distutilst__file__tnamet expanduserRt ValueError(tkindtdot((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyR s    c Csddlm}tjd||}|j|gx+|jD]\}}|d krtjd|||j|qF|j |stjd|||j |nx|jD]\}}|d kr3tjd||||j |||j |s_tjd|||j|q_qtjd|||||j |||qWqFWtjd ||st|d } |j| | jnd S( sYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. i(tRawConfigParsersReading configuration from %ssDeleting section [%s] from %ssAdding new section [%s] to %ssDeleting %s.%s from %ss#Deleting empty [%s] section from %ssSetting %s.%s to %r in %ss Writing %stwN(t ConfigParserRRtdebugtreadtitemstNonetinfotremove_sectiont has_sectiont add_sectiont remove_optiontoptionstsettopentwritetclose( tfilenametsettingstdry_runRtoptstsectionR%toptiontvaluetf((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyR*s:        cBs;eZdZd d dgZddgZd Zd ZRS(s<Abstract base class for commands that mess with config filess global-configtgs0save options to the site-wide distutils.cfg files user-configtus7save options to the current user's pydistutils.cfg files filename=R1s-configuration file to use (default=setup.cfg)cCsd|_d|_d|_dS(N(Rt global_configt user_configR*(tself((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pytinitialize_optionscs  cCsg}|jr%|jtdn|jrD|jtdn|jdk rf|j|jn|s|jtdnt|dkrtd|n|\|_dS(NR R Ris/Must specify only one configuration file option(R4tappendRR5R*RtlentDistutilsOptionError(R6t filenames((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pytfinalize_optionshs   (s global-configR2s0save options to the site-wide distutils.cfg file(s user-configR3s7save options to the current user's pydistutils.cfg file(s filename=R1s-configuration file to use (default=setup.cfg)(t__name__t __module__t__doc__t user_optionstboolean_optionsR7R<(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyRSs   cBsXeZdZdZddddgejZejd gZdZdZdZ RS(s#Save command-line options to a files1set an option in setup.cfg or another config filescommand=tcscommand to set an option forsoption=tos option to sets set-value=tssvalue of the optiontremovetrsremove (unset) the valuecCs5tj|d|_d|_d|_d|_dS(N(RR7RtcommandR/t set_valueRE(R6((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyR7s     cCsftj||jdks+|jdkr:tdn|jdkrb|j rbtdndS(Ns%Must specify --command *and* --options$Must specify --set-value or --remove(RR<RGRR/R:RHRE(R6((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyR<s  cCs=t|jii|j|jjdd6|j6|jdS(Nt-t_(RR*RHR/treplaceRGR,(R6((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pytruns #(scommand=RBscommand to set an option for(soption=RCs option to set(s set-value=RDsvalue of the option(sremoveRFsremove (unset) the value( R=R>R?t descriptionRR@RAR7R<RL(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyR|s   (RRt setuptoolsRtdistutils.utilRRtdistutils.errorst__all__RtFalseRRR(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyts  ))07070100068634000081ed000000000000000000000001513ff565000009ad000000b500010002ffffffffffffffff0000006300000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyimport distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in '"', "'", "\\", "#": if c in arg: return repr(arg) if arg.split()<>[arg]: return repr(arg) return arg class alias(option_base): """Define a shortcut that invokes one or more commands""" description = "define a shortcut to invoke one or more commands" command_consumes_arguments = True user_options = [ ('remove', 'r', 'remove (unset) the alias'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] def initialize_options(self): option_base.initialize_options(self) self.args = None self.remove = None def finalize_options(self): option_base.finalize_options(self) if self.remove and len(self.args)<>1: raise DistutilsOptionError( "Must specify exactly one argument (the alias name) when " "using --remove" ) def run(self): aliases = self.distribution.get_option_dict('aliases') if not self.args: print "Command Aliases" print "---------------" for alias in aliases: print "setup.py alias", format_alias(alias, aliases) return elif len(self.args)==1: alias, = self.args if self.remove: command = None elif alias in aliases: print "setup.py alias", format_alias(alias, aliases) return else: print "No alias definition found for %r" % alias return else: alias = self.args[0] command = ' '.join(map(shquote,self.args[1:])) edit_config(self.filename, {'aliases': {alias:command}}, self.dry_run) def format_alias(name, aliases): source, command = aliases[name] if source == config_file('global'): source = '--global-config ' elif source == config_file('user'): source = '--user-config ' elif source == config_file('local'): source = '' else: source = '--filename=%r' % source return source+name+' '+command 0707010006864c000081ed000000000000000000000001513ff5650000080b000000b500010002ffffffffffffffff0000006d00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyfrom distutils.command.install_scripts import install_scripts \ as _install_scripts from pkg_resources import Distribution, PathMetadata, ensure_directory import os from distutils import log class install_scripts(_install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): _install_scripts.initialize_options(self) self.no_ep = False def run(self): from setuptools.command.easy_install import get_script_args from setuptools.command.easy_install import sys_executable self.run_command("egg_info") if self.distribution.scripts: _install_scripts.run(self) # run first to set up self.outfiles else: self.outfiles = [] if self.no_ep: # don't install entry point scripts into .egg file! return ei_cmd = self.get_finalized_command("egg_info") dist = Distribution( ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), ei_cmd.egg_name, ei_cmd.egg_version, ) bs_cmd = self.get_finalized_command('build_scripts') executable = getattr(bs_cmd,'executable',sys_executable) is_wininst = getattr( self.get_finalized_command("bdist_wininst"), '_is_running', False ) for args in get_script_args(dist, executable, is_wininst): self.write_script(*args) def write_script(self, script_name, contents, mode="t", *ignored): """Write an executable file to the scripts directory""" from setuptools.command.easy_install import chmod, current_umask log.info("Installing %s script to %s", script_name, self.install_dir) target = os.path.join(self.install_dir, script_name) self.outfiles.append(target) mask = current_umask() if not self.dry_run: ensure_directory(target) f = open(target,"w"+mode) f.write(contents) f.close() chmod(target, 0777-mask) 07070100068656000081ed000000000000000000000001513ff565000013bd000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/setopt.pyimport distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" """ if kind=='local': return 'setup.cfg' if kind=='global': return os.path.join( os.path.dirname(distutils.__file__),'distutils.cfg' ) if kind=='user': dot = os.name=='posix' and '.' or '' return os.path.expanduser(convert_path("~/%spydistutils.cfg" % dot)) raise ValueError( "config_file() type must be 'local', 'global', or 'user'", kind ) def edit_config(filename, settings, dry_run=False): """Edit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. """ from ConfigParser import RawConfigParser log.debug("Reading configuration from %s", filename) opts = RawConfigParser() opts.read([filename]) for section, options in settings.items(): if options is None: log.info("Deleting section [%s] from %s", section, filename) opts.remove_section(section) else: if not opts.has_section(section): log.debug("Adding new section [%s] to %s", section, filename) opts.add_section(section) for option,value in options.items(): if value is None: log.debug("Deleting %s.%s from %s", section, option, filename ) opts.remove_option(section,option) if not opts.options(section): log.info("Deleting empty [%s] section from %s", section, filename) opts.remove_section(section) else: log.debug( "Setting %s.%s to %r in %s", section, option, value, filename ) opts.set(section,option,value) log.info("Writing %s", filename) if not dry_run: f = open(filename,'w'); opts.write(f); f.close() class option_base(Command): """Abstract base class for commands that mess with config files""" user_options = [ ('global-config', 'g', "save options to the site-wide distutils.cfg file"), ('user-config', 'u', "save options to the current user's pydistutils.cfg file"), ('filename=', 'f', "configuration file to use (default=setup.cfg)"), ] boolean_options = [ 'global-config', 'user-config', ] def initialize_options(self): self.global_config = None self.user_config = None self.filename = None def finalize_options(self): filenames = [] if self.global_config: filenames.append(config_file('global')) if self.user_config: filenames.append(config_file('user')) if self.filename is not None: filenames.append(self.filename) if not filenames: filenames.append(config_file('local')) if len(filenames)>1: raise DistutilsOptionError( "Must specify only one configuration file option", filenames ) self.filename, = filenames class setopt(option_base): """Save command-line options to a file""" description = "set an option in setup.cfg or another config file" user_options = [ ('command=', 'c', 'command to set an option for'), ('option=', 'o', 'option to set'), ('set-value=', 's', 'value of the option'), ('remove', 'r', 'remove (unset) the value'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] def initialize_options(self): option_base.initialize_options(self) self.command = None self.option = None self.set_value = None self.remove = None def finalize_options(self): option_base.finalize_options(self) if self.command is None or self.option is None: raise DistutilsOptionError("Must specify --command *and* --option") if self.set_value is None and not self.remove: raise DistutilsOptionError("Must specify --set-value or --remove") def run(self): edit_config( self.filename, { self.command: {self.option.replace('-','_'):self.set_value} }, self.dry_run ) 0707010006863d000081a4000000000000000000000001513ff56600002a33000000b500010002ffffffffffffffff0000006800000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyc e?Qc @sddlmZyddlmZWnek r=eZnXddlZddlZddlm Z ddl m Z ddl m Z ddlmZmZedddlmZdd lmZdd lTeZeZd Zejd kreZnFejd kr@y ddlmZeZeZWq@ek r<q@XndZdefdYZestejd krddddddddddd Z n-dZddddddddddd Z dS(i(t build_extN(t copy_file(tLibrary(t new_compiler(tcustomize_compilertget_config_vartLDSHARED(t _config_vars(tlog(t*tsharedtdarwintnt(tRTLD_NOWcCstr |SdS(Nt(t have_rtld(ts((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pytif_dl sRcBseZdZdZeek r@eed r@dZndZdZ dZ dZ dZ d Z d Zd Zed ZRS( cCs@|jd}|_tj|||_|r<|jndS(s;Build extensions in build directory, then copy if --inplaceiN(tinplacet _build_exttruntcopy_extensions_to_source(tselft old_inplace((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyR+s   c Cs|jd}x|jD]}|j|j}|j|}|jd}dj|d }|j|}tj j|tj j |}tj j|j |} t | |d|j d|j|jr|j|ptj|tqqWdS(Ntbuild_pyt.itverbosetdry_run(tget_finalized_commandt extensionstget_ext_fullnametnametget_ext_filenametsplittjointget_package_dirtostpathtbasenamet build_libRRRt _needs_stubt write_stubtcurdirtTrue( RRtexttfullnametfilenametmodpathtpackaget package_dirt dest_filenamet src_filename((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyR3s!  t pyrex_sourcescGs+tj||p|}tj|||S(N(Rt swig_sourcest _du_build_ext(Rtsourcest otherargs((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyR5KscCstj||}||jkr%|S|j|}t|trltjj|\}}|jj |t St r|j rtjj |\}}tjj|d|S|SdS(Nsdl-(RR text_mapt isinstanceRR$R%tsplitexttshlib_compilertlibrary_filenametlibtypet use_stubst_links_to_dynamicR!R"(RR-R.R,tfntd((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyR Ss cCs,tj|d|_g|_i|_dS(N(Rtinitialize_optionstNoneR<tshlibsR9(R((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyRCas   c Cstj||jpg|_|j|jg|jD]}t|tr9|^q9|_|jrs|jnx&|jD]}|j|j |_ q}Wx|jD]}|j }||j |<||j |j dd<|jr|j |pt}|_|otot|t |_|j|}|_tjjtjj|j|}|r||jkr|jj|n|rtrtj|jkr|jjtjqqWdS(NRi(Rtfinalize_optionsRtcheck_extensions_listR:RREtsetup_shlib_compilerRRt _full_nameR9R!tlinks_to_dynamictFalseR@R?R(R t _file_nameR$R%tdirnameR"R't library_dirstappendR*truntime_library_dirs(RR,R-tltdR.tlibdir((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyRFgs*     %$cCstd|jd|jd|j}|_tjdkrtj}z,dtdRXR+RtdlR RRDRi(((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pytsJ             07070100068636000081ed000000000000000000000001513ff565000048a2000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.py"""setuptools.command.bdist_egg Build .egg distributions""" # This module should be kept compatible with Python 2.3 import sys, os, marshal from setuptools import Command from distutils.dir_util import remove_tree, mkpath try: from distutils.sysconfig import get_python_version, get_python_lib except ImportError: from sysconfig import get_python_version from distutils.sysconfig import get_python_lib from distutils import log from distutils.errors import DistutilsSetupError from pkg_resources import get_build_platform, Distribution, ensure_directory from pkg_resources import EntryPoint from types import CodeType from setuptools.extension import Library def strip_module(filename): if '.' in filename: filename = os.path.splitext(filename)[0] if filename.endswith('module'): filename = filename[:-6] return filename def write_stub(resource, pyfile): f = open(pyfile,'w') f.write('\n'.join([ "def __bootstrap__():", " global __bootstrap__, __loader__, __file__", " import sys, pkg_resources, imp", " __file__ = pkg_resources.resource_filename(__name__,%r)" % resource, " __loader__ = None; del __bootstrap__, __loader__", " imp.load_dynamic(__name__,__file__)", "__bootstrap__()", "" # terminal \n ])) f.close() # stub __init__.py for packages distributed without one NS_PKG_STUB = '__import__("pkg_resources").declare_namespace(__name__)' class bdist_egg(Command): description = "create an \"egg\" distribution" user_options = [ ('bdist-dir=', 'b', "temporary directory for creating the distribution"), ('plat-name=', 'p', "platform name to embed in generated filenames " "(default: %s)" % get_build_platform()), ('exclude-source-files', None, "remove all .py files from the generated egg"), ('keep-temp', 'k', "keep the pseudo-installation tree around after " + "creating the distribution archive"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ] boolean_options = [ 'keep-temp', 'skip-build', 'exclude-source-files' ] def initialize_options (self): self.bdist_dir = None self.plat_name = None self.keep_temp = 0 self.dist_dir = None self.skip_build = 0 self.egg_output = None self.exclude_source_files = None def finalize_options(self): ei_cmd = self.ei_cmd = self.get_finalized_command("egg_info") self.egg_info = ei_cmd.egg_info if self.bdist_dir is None: bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'egg') if self.plat_name is None: self.plat_name = get_build_platform() self.set_undefined_options('bdist',('dist_dir', 'dist_dir')) if self.egg_output is None: # Compute filename of the output egg basename = Distribution( None, None, ei_cmd.egg_name, ei_cmd.egg_version, get_python_version(), self.distribution.has_ext_modules() and self.plat_name ).egg_name() self.egg_output = os.path.join(self.dist_dir, basename+'.egg') def do_install_data(self): # Hack for packages that install data to install's --install-lib self.get_finalized_command('install').install_lib = self.bdist_dir site_packages = os.path.normcase(os.path.realpath(get_python_lib())) old, self.distribution.data_files = self.distribution.data_files,[] for item in old: if isinstance(item,tuple) and len(item)==2: if os.path.isabs(item[0]): realpath = os.path.realpath(item[0]) normalized = os.path.normcase(realpath) if normalized==site_packages or normalized.startswith( site_packages+os.sep ): item = realpath[len(site_packages)+1:], item[1] # XXX else: raise ??? self.distribution.data_files.append(item) try: log.info("installing package data to %s" % self.bdist_dir) self.call_command('install_data', force=0, root=None) finally: self.distribution.data_files = old def get_outputs(self): return [self.egg_output] def call_command(self,cmdname,**kw): """Invoke reinitialized command `cmdname` with keyword args""" for dirname in INSTALL_DIRECTORY_ATTRS: kw.setdefault(dirname,self.bdist_dir) kw.setdefault('skip_build',self.skip_build) kw.setdefault('dry_run', self.dry_run) cmd = self.reinitialize_command(cmdname, **kw) self.run_command(cmdname) return cmd def run(self): # Generate metadata first self.run_command("egg_info") # We run install_lib before install_data, because some data hacks # pull their data path from the install_lib command. log.info("installing library code to %s" % self.bdist_dir) instcmd = self.get_finalized_command('install') old_root = instcmd.root; instcmd.root = None cmd = self.call_command('install_lib', warn_dir=0) instcmd.root = old_root all_outputs, ext_outputs = self.get_ext_outputs() self.stubs = [] to_compile = [] for (p,ext_name) in enumerate(ext_outputs): filename,ext = os.path.splitext(ext_name) pyfile = os.path.join(self.bdist_dir, strip_module(filename)+'.py') self.stubs.append(pyfile) log.info("creating stub loader for %s" % ext_name) if not self.dry_run: write_stub(os.path.basename(ext_name), pyfile) to_compile.append(pyfile) ext_outputs[p] = ext_name.replace(os.sep,'/') to_compile.extend(self.make_init_files()) if to_compile: cmd.byte_compile(to_compile) if self.distribution.data_files: self.do_install_data() # Make the EGG-INFO directory archive_root = self.bdist_dir egg_info = os.path.join(archive_root,'EGG-INFO') self.mkpath(egg_info) if self.distribution.scripts: script_dir = os.path.join(egg_info, 'scripts') log.info("installing scripts to %s" % script_dir) self.call_command('install_scripts',install_dir=script_dir,no_ep=1) self.copy_metadata_to(egg_info) native_libs = os.path.join(egg_info, "native_libs.txt") if all_outputs: log.info("writing %s" % native_libs) if not self.dry_run: ensure_directory(native_libs) libs_file = open(native_libs, 'wt') libs_file.write('\n'.join(all_outputs)) libs_file.write('\n') libs_file.close() elif os.path.isfile(native_libs): log.info("removing %s" % native_libs) if not self.dry_run: os.unlink(native_libs) write_safety_flag( os.path.join(archive_root,'EGG-INFO'), self.zip_safe() ) if os.path.exists(os.path.join(self.egg_info,'depends.txt')): log.warn( "WARNING: 'depends.txt' will not be used by setuptools 0.6!\n" "Use the install_requires/extras_require setup() args instead." ) if self.exclude_source_files: self.zap_pyfiles() # Make the archive make_zipfile(self.egg_output, archive_root, verbose=self.verbose, dry_run=self.dry_run, mode=self.gen_header()) if not self.keep_temp: remove_tree(self.bdist_dir, dry_run=self.dry_run) # Add to 'Distribution.dist_files' so that the "upload" command works getattr(self.distribution,'dist_files',[]).append( ('bdist_egg',get_python_version(),self.egg_output)) def zap_pyfiles(self): log.info("Removing .py files from temporary directory") for base,dirs,files in walk_egg(self.bdist_dir): for name in files: if name.endswith('.py'): path = os.path.join(base,name) log.debug("Deleting %s", path) os.unlink(path) def zip_safe(self): safe = getattr(self.distribution,'zip_safe',None) if safe is not None: return safe log.warn("zip_safe flag not set; analyzing archive contents...") return analyze_egg(self.bdist_dir, self.stubs) def make_init_files(self): """Create missing package __init__ files""" init_files = [] for base,dirs,files in walk_egg(self.bdist_dir): if base==self.bdist_dir: # don't put an __init__ in the root continue for name in files: if name.endswith('.py'): if '__init__.py' not in files: pkg = base[len(self.bdist_dir)+1:].replace(os.sep,'.') if self.distribution.has_contents_for(pkg): log.warn("Creating missing __init__.py for %s",pkg) filename = os.path.join(base,'__init__.py') if not self.dry_run: f = open(filename,'w'); f.write(NS_PKG_STUB) f.close() init_files.append(filename) break else: # not a package, don't traverse to subdirectories dirs[:] = [] return init_files def gen_header(self): epm = EntryPoint.parse_map(self.distribution.entry_points or '') ep = epm.get('setuptools.installation',{}).get('eggsecutable') if ep is None: return 'w' # not an eggsecutable, do it the usual way. if not ep.attrs or ep.extras: raise DistutilsSetupError( "eggsecutable entry point (%r) cannot have 'extras' " "or refer to a module" % (ep,) ) pyver = sys.version[:3] pkg = ep.module_name full = '.'.join(ep.attrs) base = ep.attrs[0] basename = os.path.basename(self.egg_output) header = ( "#!/bin/sh\n" 'if [ `basename $0` = "%(basename)s" ]\n' 'then exec python%(pyver)s -c "' "import sys, os; sys.path.insert(0, os.path.abspath('$0')); " "from %(pkg)s import %(base)s; sys.exit(%(full)s())" '" "$@"\n' 'else\n' ' echo $0 is not the correct name for this egg file.\n' ' echo Please rename it back to %(basename)s and try again.\n' ' exec false\n' 'fi\n' ) % locals() if not self.dry_run: mkpath(os.path.dirname(self.egg_output), dry_run=self.dry_run) f = open(self.egg_output, 'w') f.write(header) f.close() return 'a' def copy_metadata_to(self, target_dir): "Copy metadata (egg info) to the target_dir" # normalize the path (so that a forward-slash in egg_info will # match using startswith below) norm_egg_info = os.path.normpath(self.egg_info) prefix = os.path.join(norm_egg_info,'') for path in self.ei_cmd.filelist.files: if path.startswith(prefix): target = os.path.join(target_dir, path[len(prefix):]) ensure_directory(target) self.copy_file(path, target) def get_ext_outputs(self): """Get a list of relative paths to C extensions in the output distro""" all_outputs = [] ext_outputs = [] paths = {self.bdist_dir:''} for base, dirs, files in os.walk(self.bdist_dir): for filename in files: if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS: all_outputs.append(paths[base]+filename) for filename in dirs: paths[os.path.join(base,filename)] = paths[base]+filename+'/' if self.distribution.has_ext_modules(): build_cmd = self.get_finalized_command('build_ext') for ext in build_cmd.extensions: if isinstance(ext,Library): continue fullname = build_cmd.get_ext_fullname(ext.name) filename = build_cmd.get_ext_filename(fullname) if not os.path.basename(filename).startswith('dl-'): if os.path.exists(os.path.join(self.bdist_dir,filename)): ext_outputs.append(filename) return all_outputs, ext_outputs NATIVE_EXTENSIONS = dict.fromkeys('.dll .so .dylib .pyd'.split()) def walk_egg(egg_dir): """Walk an unpacked egg's contents, skipping the metadata directory""" walker = os.walk(egg_dir) base,dirs,files = walker.next() if 'EGG-INFO' in dirs: dirs.remove('EGG-INFO') yield base,dirs,files for bdf in walker: yield bdf def analyze_egg(egg_dir, stubs): # check for existing flag in EGG-INFO for flag,fn in safety_flags.items(): if os.path.exists(os.path.join(egg_dir,'EGG-INFO',fn)): return flag if not can_scan(): return False safe = True for base, dirs, files in walk_egg(egg_dir): for name in files: if name.endswith('.py') or name.endswith('.pyw'): continue elif name.endswith('.pyc') or name.endswith('.pyo'): # always scan, even if we already know we're not safe safe = scan_module(egg_dir, base, name, stubs) and safe return safe def write_safety_flag(egg_dir, safe): # Write or remove zip safety flag file(s) for flag,fn in safety_flags.items(): fn = os.path.join(egg_dir, fn) if os.path.exists(fn): if safe is None or bool(safe)<>flag: os.unlink(fn) elif safe is not None and bool(safe)==flag: f=open(fn,'wt'); f.write('\n'); f.close() safety_flags = { True: 'zip-safe', False: 'not-zip-safe', } def scan_module(egg_dir, base, name, stubs): """Check whether module possibly uses unsafe-for-zipfile stuff""" filename = os.path.join(base,name) if filename[:-1] in stubs: return True # Extension module pkg = base[len(egg_dir)+1:].replace(os.sep,'.') module = pkg+(pkg and '.' or '')+os.path.splitext(name)[0] f = open(filename,'rb'); f.read(8) # skip magic & date try: code = marshal.load(f); f.close() except ValueError: f.seek(0); f.read(12) # skip magic & date & file size; file size added in Python 3.3 code = marshal.load(f); f.close() safe = True symbols = dict.fromkeys(iter_symbols(code)) for bad in ['__file__', '__path__']: if bad in symbols: log.warn("%s: module references %s", module, bad) safe = False if 'inspect' in symbols: for bad in [ 'getsource', 'getabsfile', 'getsourcefile', 'getfile' 'getsourcelines', 'findsource', 'getcomments', 'getframeinfo', 'getinnerframes', 'getouterframes', 'stack', 'trace' ]: if bad in symbols: log.warn("%s: module MAY be using inspect.%s", module, bad) safe = False if '__name__' in symbols and '__main__' in symbols and '.' not in module: if sys.version[:3]=="2.4": # -m works w/zipfiles in 2.5 log.warn("%s: top-level module may be 'python -m' script", module) safe = False return safe def iter_symbols(code): """Yield names and strings used by `code` and its nested code objects""" for name in code.co_names: yield name for const in code.co_consts: if isinstance(const,basestring): yield const elif isinstance(const,CodeType): for name in iter_symbols(const): yield name def can_scan(): if sys.version_info > (3, 3): return False # Can't scan recent formats if not sys.platform.startswith('java') and sys.platform != 'cli': # CPython, PyPy, etc. return True log.warn("Unable to analyze compiled code on this platform.") log.warn("Please ask the author to include a 'zip_safe'" " setting (either True or False) in the package's setup.py") # Attribute names of options for commands that might need to be convinced to # install to the egg build directory INSTALL_DIRECTORY_ATTRS = [ 'install_lib', 'install_dir', 'install_data', 'install_base' ] def make_zipfile(zip_filename, base_dir, verbose=0, dry_run=0, compress=None, mode='w' ): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. """ import zipfile mkpath(os.path.dirname(zip_filename), dry_run=dry_run) log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) def visit(z, dirname, names): for name in names: path = os.path.normpath(os.path.join(dirname, name)) if os.path.isfile(path): p = path[len(base_dir)+1:] if not dry_run: z.write(path, p) log.debug("adding '%s'" % p) if compress is None: compress = (sys.version>="2.4") # avoid 2.3 zipimport bug when 64 bits compression = [zipfile.ZIP_STORED, zipfile.ZIP_DEFLATED][bool(compress)] if not dry_run: z = zipfile.ZipFile(zip_filename, mode, compression=compression) for dirname, dirs, files in os.walk(base_dir): visit(z, dirname, files) z.close() else: for dirname, dirs, files in os.walk(base_dir): visit(None, dirname, files) return zip_filename # 07070100068644000081ed000000000000000000000001513ff56500003814000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.py"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" # This module should be kept compatible with Python 2.3 import os, re, sys from setuptools import Command from distutils.errors import * from distutils import log from setuptools.command.sdist import sdist from distutils.util import convert_path from distutils.filelist import FileList from pkg_resources import parse_requirements, safe_name, parse_version, \ safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename from sdist import walk_revctrl class egg_info(Command): description = "create a distribution's .egg-info directory" user_options = [ ('egg-base=', 'e', "directory containing .egg-info directories" " (default: top of the source tree)"), ('tag-svn-revision', 'r', "Add subversion revision ID to version number"), ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"), ('tag-build=', 'b', "Specify explicit tag to add to version number"), ('no-svn-revision', 'R', "Don't add subversion revision ID [default]"), ('no-date', 'D', "Don't include date stamp [default]"), ] boolean_options = ['tag-date', 'tag-svn-revision'] negative_opt = {'no-svn-revision': 'tag-svn-revision', 'no-date': 'tag-date'} def initialize_options(self): self.egg_name = None self.egg_version = None self.egg_base = None self.egg_info = None self.tag_build = None self.tag_svn_revision = 0 self.tag_date = 0 self.broken_egg_info = False self.vtags = None def save_version_info(self, filename): from setopt import edit_config edit_config( filename, {'egg_info': {'tag_svn_revision':0, 'tag_date': 0, 'tag_build': self.tags()} } ) def finalize_options (self): self.egg_name = safe_name(self.distribution.get_name()) self.vtags = self.tags() self.egg_version = self.tagged_version() try: list( parse_requirements('%s==%s' % (self.egg_name,self.egg_version)) ) except ValueError: raise DistutilsOptionError( "Invalid distribution name or version syntax: %s-%s" % (self.egg_name,self.egg_version) ) if self.egg_base is None: dirs = self.distribution.package_dir self.egg_base = (dirs or {}).get('',os.curdir) self.ensure_dirname('egg_base') self.egg_info = to_filename(self.egg_name)+'.egg-info' if self.egg_base != os.curdir: self.egg_info = os.path.join(self.egg_base, self.egg_info) if '-' in self.egg_name: self.check_broken_egg_info() # Set package version for the benefit of dumber commands # (e.g. sdist, bdist_wininst, etc.) # self.distribution.metadata.version = self.egg_version # If we bootstrapped around the lack of a PKG-INFO, as might be the # case in a fresh checkout, make sure that any special tags get added # to the version info # pd = self.distribution._patched_dist if pd is not None and pd.key==self.egg_name.lower(): pd._version = self.egg_version pd._parsed_version = parse_version(self.egg_version) self.distribution._patched_dist = None def write_or_delete_file(self, what, filename, data, force=False): """Write `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). """ if data: self.write_file(what, filename, data) elif os.path.exists(filename): if data is None and not force: log.warn( "%s not set in setup(), but %s exists", what, filename ) return else: self.delete_file(filename) def write_file(self, what, filename, data): """Write `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. """ log.info("writing %s to %s", what, filename) if sys.version_info >= (3,): data = data.encode("utf-8") if not self.dry_run: f = open(filename, 'wb') f.write(data) f.close() def delete_file(self, filename): """Delete `filename` (if not a dry run) after announcing it""" log.info("deleting %s", filename) if not self.dry_run: os.unlink(filename) def tagged_version(self): return safe_version(self.distribution.get_version() + self.vtags) def run(self): self.mkpath(self.egg_info) installer = self.distribution.fetch_build_egg for ep in iter_entry_points('egg_info.writers'): writer = ep.load(installer=installer) writer(self, ep.name, os.path.join(self.egg_info,ep.name)) # Get rid of native_libs.txt if it was put there by older bdist_egg nl = os.path.join(self.egg_info, "native_libs.txt") if os.path.exists(nl): self.delete_file(nl) self.find_sources() def tags(self): version = '' if self.tag_build: version+=self.tag_build if self.tag_svn_revision and ( os.path.exists('.svn') or os.path.exists('PKG-INFO') ): version += '-r%s' % self.get_svn_revision() if self.tag_date: import time; version += time.strftime("-%Y%m%d") return version def get_svn_revision(self): revision = 0 urlre = re.compile('url="([^"]+)"') revre = re.compile('committed-rev="(\d+)"') for base,dirs,files in os.walk(os.curdir): if '.svn' not in dirs: dirs[:] = [] continue # no sense walking uncontrolled subdirs dirs.remove('.svn') f = open(os.path.join(base,'.svn','entries')) data = f.read() f.close() if data.startswith('10') or data.startswith('9') or data.startswith('8'): data = map(str.splitlines,data.split('\n\x0c\n')) del data[0][0] # get rid of the '8' or '9' or '10' dirurl = data[0][3] localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0]) elif data.startswith('= (3,): contents = contents.encode("utf-8") f = open(filename, "wb") # always write POSIX-style manifest f.write(contents) f.close() def write_pkg_info(cmd, basename, filename): log.info("writing %s", filename) if not cmd.dry_run: metadata = cmd.distribution.metadata metadata.version, oldver = cmd.egg_version, metadata.version metadata.name, oldname = cmd.egg_name, metadata.name try: # write unescaped data to PKG-INFO, so older pkg_resources # can still parse it metadata.write_pkg_info(cmd.egg_info) finally: metadata.name, metadata.version = oldname, oldver safe = getattr(cmd.distribution,'zip_safe',None) import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe) def warn_depends_obsolete(cmd, basename, filename): if os.path.exists(filename): log.warn( "WARNING: 'depends.txt' is not used by setuptools 0.6!\n" "Use the install_requires/extras_require setup() args instead." ) def write_requirements(cmd, basename, filename): dist = cmd.distribution data = ['\n'.join(yield_lines(dist.install_requires or ()))] for extra,reqs in (dist.extras_require or {}).items(): data.append('\n\n[%s]\n%s' % (extra, '\n'.join(yield_lines(reqs)))) cmd.write_or_delete_file("requirements", filename, ''.join(data)) def write_toplevel_names(cmd, basename, filename): pkgs = dict.fromkeys( [k.split('.',1)[0] for k in cmd.distribution.iter_distribution_names() ] ) cmd.write_file("top-level names", filename, '\n'.join(pkgs)+'\n') def overwrite_arg(cmd, basename, filename): write_arg(cmd, basename, filename, True) def write_arg(cmd, basename, filename, force=False): argname = os.path.splitext(basename)[0] value = getattr(cmd.distribution, argname, None) if value is not None: value = '\n'.join(value)+'\n' cmd.write_or_delete_file(argname, filename, value, force) def write_entries(cmd, basename, filename): ep = cmd.distribution.entry_points if isinstance(ep,basestring) or ep is None: data = ep elif ep is not None: data = [] for section, contents in ep.items(): if not isinstance(contents,basestring): contents = EntryPoint.parse_group(section, contents) contents = '\n'.join(map(str,contents.values())) data.append('[%s]\n%s\n\n' % (section,contents)) data = ''.join(data) cmd.write_or_delete_file('entry points', filename, data, True) def get_pkg_info_revision(): # See if we can get a -r### off of PKG-INFO, in case this is an sdist of # a subversion revision # if os.path.exists('PKG-INFO'): f = open('PKG-INFO','rU') for line in f: match = re.match(r"Version:.*-r(\d+)\s*$", line) if match: return int(match.group(1)) f.close() return 0 # 07070100068645000081a4000000000000000000000001513ff56600004641000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyc e?Qc@shdZddlZddlZddlZddlmZddlTddlmZddl m Z ddl m Z ddl mZdd lmZmZmZmZmZmZmZmZdd l mZd efd YZd efdYZde fdYZdZdZdZdZdZdZ e!dZ"dZ#dZ$dS(sUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsiN(tCommand(t*(tlog(tsdist(t convert_path(tFileList(tparse_requirementst safe_namet parse_versiont safe_versiont yield_linest EntryPointtiter_entry_pointst to_filename(t walk_revctrltegg_infocBseZdZdd d!d"d#d$gZddgZidd 6dd6ZdZdZdZe dZ dZ dZ dZ dZdZdZdZdZRS(%s+create a distribution's .egg-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)stag-svn-revisiontrs,Add subversion revision ID to version numberstag-datetds0Add date stamp (e.g. 20050528) to version numbers tag-build=tbs-Specify explicit tag to add to version numbersno-svn-revisiontRs*Don't add subversion revision ID [default]sno-datetDs"Don't include date stamp [default]cCsUd|_d|_d|_d|_d|_d|_d|_t|_ d|_ dS(Ni( tNonetegg_namet egg_versiontegg_baseRt tag_buildttag_svn_revisionttag_datetFalsetbroken_egg_infotvtags(tself((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytinitialize_options*s        cCsCddlm}||iidd6dd6|jd6d6dS(Ni(t edit_configiRRRR(tsetoptR"ttags(R tfilenameR"((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytsave_version_info5s cCst|jj|_|j|_|j|_y$tt d|j|jfWn-t k rt d|j|jfnX|j dkr|jj}|pijdtj|_ n|jdt|jd|_|j tjkrtjj|j |j|_nd|jkr8|jn|j|jj_|jj}|dk r|j|jjkr|j|_t|j|_d|j_ndS(Ns%s==%ss2Invalid distribution name or version syntax: %s-%stRs .egg-infot-( Rt distributiontget_nameRR$Rttagged_versionRtlistRt ValueErrortDistutilsOptionErrorRRt package_dirtgettostcurdirtensure_dirnameR Rtpathtjointcheck_broken_egg_infotmetadatatversiont _patched_disttkeytlowert_versionRt_parsed_version(R tdirstpd((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytfinalize_optionsSs2!  ! !  $ cCsl|r|j|||nLtjj|rh|dkrX| rXtjd||dS|j|ndS(sWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). s$%s not set in setup(), but %s existsN(t write_fileR1R4texistsRRtwarnt delete_file(R twhatR%tdatatforce((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytwrite_or_delete_file|s  cCsjtjd||tjdkr4|jd}n|jsft|d}|j||jndS(sWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. swriting %s to %sisutf-8twbN(i( Rtinfotsyst version_infotencodetdry_runtopentwritetclose(R RER%RFtf((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRAs  cCs-tjd||js)tj|ndS(s8Delete `filename` (if not a dry run) after announcing its deleting %sN(RRJRNR1tunlink(R R%((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRDs cCst|jj|jS(N(R R)t get_versionR(R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR+scCs|j|j|jj}xNtdD]@}|jd|}|||jtjj |j|jq)Wtjj |jd}tjj |r|j |n|j dS(Nsegg_info.writerst installersnative_libs.txt( tmkpathRR)tfetch_build_eggR tloadtnameR1R4R5RBRDt find_sources(R RUteptwritertnl((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytruns ,cCsd}|jr||j7}n|jrctjjdsLtjjdrc|d|j7}n|jrddl}||jd7}n|S(NR's.svnsPKG-INFOs-r%sis-%Y%m%d( RRR1R4RBtget_svn_revisionRttimetstrftime(R R8R`((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR$s  $  c Cs0d}tjd}tjd}xtjtjD]\}}}d|kr_g|(q7n|jdttjj|dd}|j }|j |j ds|j ds|j drPt t j|jd }|dd=|dd } tg|D]2} t| d kr | d r t| d ^q dg} n|j d r|j|jd } tg|j|D]} t| jd ^qdg} ntjd|g|(q7|tjkr| d} n| j | s g|(q7nt|| }q7Wt |p,tS(Nis url="([^"]+)"scommitted-rev="(\d+)"s.svntentriest10t9t8s ii stfilesRRRFtdirurlRtlocalrevtmtbase_url((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR_s:"    - OA cCsJtjj|jd}t|j}||_|j|j|_dS(s"Generate SOURCES.txt manifest files SOURCES.txtN( R1R4R5Rtmanifest_makerR)tmanifestR^tfilelist(R tmanifest_filenametmm((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRZs   cCs|jd}|jtjkr:tjj|j|}ntjj|rtjddddd||j |j |_ ||_ ndS(Ns .egg-infoR(iNs Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ( RRR1R2R4R5RBRRCRR(R tbei((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR6s   (s egg-base=RsLdirectory containing .egg-info directories (default: top of the source tree)(stag-svn-revisionRs,Add subversion revision ID to version number(stag-dateRs0Add date stamp (e.g. 20050528) to version number(s tag-build=Rs-Specify explicit tag to add to version number(sno-svn-revisionRs*Don't add subversion revision ID [default](sno-dateRs"Don't include date stamp [default](t__name__t __module__t descriptiont user_optionstboolean_optionst negative_optR!R&R@RRHRARDR+R^R$R_RZR6(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRs0      )       ) RcBseZdZdZRS(s@File list that accepts only existing, platform-independent pathscCsQ|jdr|d }nt|}tjj|rM|jj|ndS(Ns i(tendswithRR1R4RBR|tappend(R titemR4((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRs   (RRt__doc__R(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRsRcBsMeZdZdZdZdZdZdZdZdZ RS(s MANIFEST.incCs(d|_d|_d|_d|_dS(Ni(t use_defaultstprunet manifest_onlytforce_manifest(R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR!&s   cCsdS(N((R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR@,scCst|_tjj|js.|jn|jj|jtjj|j rg|j n|j |jj |jj |jdS(N(RRR1R4RBRtwrite_manifesttfindallt add_defaultsttemplatet read_templatetprune_file_listtsorttremove_duplicates(R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR^/s        cCsm|jj}tjdkrFg|D]}|jtjd^q"}n|jt|j|fd|jdS(sWrite the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. Rfswriting manifest file '%s'N(RR|R1tseptreplacetexecuteRAR(R R|RR((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR<s  +cCs&|jds"tj||ndS(Nsstandard file not found:(RlRRC(R tmsg((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRCGscCstj||jj|j|jj|jtt}|r[|jj|n"t j j |jr}|j n|j d}|jjdd|jdS(NRRtprefix(RRRRRRR,RtextendR1R4RBt read_manifesttget_finalized_commandtinclude_patternR(R trcfilestei_cmd((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRKs  cCs|jd}|jj}|jjdd|j|jjdd|tjt j }|jj|d|dddS(NtbuildRs(RCS|CVS|\.svn)tis_regexi( RR)t get_fullnameRtexclude_patternRt build_baseRgtescapeR1R(R Rtbase_dirR((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRWs ( RRRR!R@R^RRCRR(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyR"s    cCsZdj|}tjdkr0|jd}nt|d}|j||jdS(s{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. s isutf-8RIN(i(R5RKRLRMRORPRQ(R%tcontentsRR((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRA`s  cCstjd||js|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}ddl }|j|j |ndS(Ns writing %stzip_safei(RRJRNR)R7RR8RRYtwrite_pkg_infoRtgetattrRt bdist_eggtwrite_safety_flag(tcmdtbasenameR%R7toldvertoldnametsafeR((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRws   cCs&tjj|r"tjdndS(NssWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.(R1R4RBRRC(RRR%((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytwarn_depends_obsoletesc Cs|j}djt|jpdg}xI|jp9ijD]2\}}|jd|djt|fq@W|jd|dj|dS(Ns s [%s] %st requirementsR'((R)R5R tinstall_requirestextras_requiretitemsRRH(RRR%tdistRFtextratreqs((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytwrite_requirementss  !"*cCs_tjg|jjD]}|jddd^q}|jd|dj|ddS(Nt.iistop-level namess (tdicttfromkeysR)titer_distribution_namesRpRAR5(RRR%tktpkgs((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pytwrite_toplevel_namess2cCst|||tdS(N(t write_argtTrue(RRR%((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyt overwrite_argscCsgtjj|d}t|j|d}|dk rMdj|d}n|j||||dS(Nis (R1R4tsplitextRR)RR5RH(RRR%RGtargnametvalue((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRs  cCs|jj}t|ts'|dkr0|}n|dk rg}xs|jD]e\}}t|tstj||}djt t |j }n|j d||fqOWdj|}n|j d||tdS(Ns s [%s] %s R's entry points(R)t entry_pointst isinstancet basestringRRR t parse_groupR5RmRntvaluesRRHR(RRR%R[RFtsectionR((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyt write_entriess   !cCsntjjdrjtdd}x9|D]1}tjd|}|r(t|jdSq(W|jndS(NsPKG-INFOtrUsVersion:.*-r(\d+)\s*$ii( R1R4RBRORgtmatchRsRuRQ(RRtlineR((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyRws  (%RR1RgRKt setuptoolsRtdistutils.errorst distutilsRtsetuptools.command.sdistRtdistutils.utilRtdistutils.filelistRt pkg_resourcesRRRR R R R R RRRRARRRRRRRRRw(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/egg_info.pyts*$ :>       0707010006863c000081ed000000000000000000000001513ff56500002db8000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_ext.pyfrom distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from setuptools.extension import Library from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var get_config_var("LDSHARED") # make sure _config_vars is initialized from distutils.sysconfig import _config_vars from distutils import log from distutils.errors import * have_rtld = False use_stubs = False libtype = 'shared' if sys.platform == "darwin": use_stubs = True elif os.name != 'nt': try: from dl import RTLD_NOW have_rtld = True use_stubs = True except ImportError: pass def if_dl(s): if have_rtld: return s return '' class build_ext(_build_ext): def run(self): """Build extensions in build directory, then copy if --inplace""" old_inplace, self.inplace = self.inplace, 0 _build_ext.run(self) self.inplace = old_inplace if old_inplace: self.copy_extensions_to_source() def copy_extensions_to_source(self): build_py = self.get_finalized_command('build_py') for ext in self.extensions: fullname = self.get_ext_fullname(ext.name) filename = self.get_ext_filename(fullname) modpath = fullname.split('.') package = '.'.join(modpath[:-1]) package_dir = build_py.get_package_dir(package) dest_filename = os.path.join(package_dir,os.path.basename(filename)) src_filename = os.path.join(self.build_lib,filename) # Always copy, even if source is older than destination, to ensure # that the right extensions for the current Python/platform are # used. copy_file( src_filename, dest_filename, verbose=self.verbose, dry_run=self.dry_run ) if ext._needs_stub: self.write_stub(package_dir or os.curdir, ext, True) if _build_ext is not _du_build_ext and not hasattr(_build_ext,'pyrex_sources'): # Workaround for problems using some Pyrex versions w/SWIG and/or 2.4 def swig_sources(self, sources, *otherargs): # first do any Pyrex processing sources = _build_ext.swig_sources(self, sources) or sources # Then do any actual SWIG stuff on the remainder return _du_build_ext.swig_sources(self, sources, *otherargs) def get_ext_filename(self, fullname): filename = _build_ext.get_ext_filename(self,fullname) if fullname not in self.ext_map: return filename ext = self.ext_map[fullname] if isinstance(ext,Library): fn, ext = os.path.splitext(filename) return self.shlib_compiler.library_filename(fn,libtype) elif use_stubs and ext._links_to_dynamic: d,fn = os.path.split(filename) return os.path.join(d,'dl-'+fn) else: return filename def initialize_options(self): _build_ext.initialize_options(self) self.shlib_compiler = None self.shlibs = [] self.ext_map = {} def finalize_options(self): _build_ext.finalize_options(self) self.extensions = self.extensions or [] self.check_extensions_list(self.extensions) self.shlibs = [ext for ext in self.extensions if isinstance(ext,Library)] if self.shlibs: self.setup_shlib_compiler() for ext in self.extensions: ext._full_name = self.get_ext_fullname(ext.name) for ext in self.extensions: fullname = ext._full_name self.ext_map[fullname] = ext # distutils 3.1 will also ask for module names # XXX what to do with conflicts? self.ext_map[fullname.split('.')[-1]] = ext ltd = ext._links_to_dynamic = \ self.shlibs and self.links_to_dynamic(ext) or False ext._needs_stub = ltd and use_stubs and not isinstance(ext,Library) filename = ext._file_name = self.get_ext_filename(fullname) libdir = os.path.dirname(os.path.join(self.build_lib,filename)) if ltd and libdir not in ext.library_dirs: ext.library_dirs.append(libdir) if ltd and use_stubs and os.curdir not in ext.runtime_library_dirs: ext.runtime_library_dirs.append(os.curdir) def setup_shlib_compiler(self): compiler = self.shlib_compiler = new_compiler( compiler=self.compiler, dry_run=self.dry_run, force=self.force ) if sys.platform == "darwin": tmp = _config_vars.copy() try: # XXX Help! I don't have any idea whether these are right... _config_vars['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup" _config_vars['CCSHARED'] = " -dynamiclib" _config_vars['SO'] = ".dylib" customize_compiler(compiler) finally: _config_vars.clear() _config_vars.update(tmp) else: customize_compiler(compiler) if self.include_dirs is not None: compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name,value) in self.define: compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: compiler.undefine_macro(macro) if self.libraries is not None: compiler.set_libraries(self.libraries) if self.library_dirs is not None: compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: compiler.set_link_objects(self.link_objects) # hack so distutils' build_extension() builds a library instead compiler.link_shared_object = link_shared_object.__get__(compiler) def get_export_symbols(self, ext): if isinstance(ext,Library): return ext.export_symbols return _build_ext.get_export_symbols(self,ext) def build_extension(self, ext): _compiler = self.compiler try: if isinstance(ext,Library): self.compiler = self.shlib_compiler _build_ext.build_extension(self,ext) if ext._needs_stub: self.write_stub( self.get_finalized_command('build_py').build_lib, ext ) finally: self.compiler = _compiler def links_to_dynamic(self, ext): """Return true if 'ext' links to a dynamic lib in the same package""" # XXX this should check to ensure the lib is actually being built # XXX as dynamic, and not just using a locally-found version or a # XXX static-compiled version libnames = dict.fromkeys([lib._full_name for lib in self.shlibs]) pkg = '.'.join(ext._full_name.split('.')[:-1]+['']) for libname in ext.libraries: if pkg+libname in libnames: return True return False def get_outputs(self): outputs = _build_ext.get_outputs(self) optimize = self.get_finalized_command('build_py').optimize for ext in self.extensions: if ext._needs_stub: base = os.path.join(self.build_lib, *ext._full_name.split('.')) outputs.append(base+'.py') outputs.append(base+'.pyc') if optimize: outputs.append(base+'.pyo') return outputs def write_stub(self, output_dir, ext, compile=False): log.info("writing stub loader for %s to %s",ext._full_name, output_dir) stub_file = os.path.join(output_dir, *ext._full_name.split('.'))+'.py' if compile and os.path.exists(stub_file): raise DistutilsError(stub_file+" already exists! Please delete.") if not self.dry_run: f = open(stub_file,'w') f.write('\n'.join([ "def __bootstrap__():", " global __bootstrap__, __file__, __loader__", " import sys, os, pkg_resources, imp"+if_dl(", dl"), " __file__ = pkg_resources.resource_filename(__name__,%r)" % os.path.basename(ext._file_name), " del __bootstrap__", " if '__loader__' in globals():", " del __loader__", if_dl(" old_flags = sys.getdlopenflags()"), " old_dir = os.getcwd()", " try:", " os.chdir(os.path.dirname(__file__))", if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"), " imp.load_dynamic(__name__,__file__)", " finally:", if_dl(" sys.setdlopenflags(old_flags)"), " os.chdir(old_dir)", "__bootstrap__()", "" # terminal \n ])) f.close() if compile: from distutils.util import byte_compile byte_compile([stub_file], optimize=0, force=True, dry_run=self.dry_run) optimize = self.get_finalized_command('install_lib').optimize if optimize > 0: byte_compile([stub_file], optimize=optimize, force=True, dry_run=self.dry_run) if os.path.exists(stub_file) and not self.dry_run: os.unlink(stub_file) if use_stubs or os.name=='nt': # Build shared libraries # def link_shared_object(self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None ): self.link( self.SHARED_LIBRARY, objects, output_libname, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang ) else: # Build static libraries everywhere else libtype = 'static' def link_shared_object(self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None ): # XXX we need to either disallow these attrs on Library instances, # or warn/abort here if set, or something... #libraries=None, library_dirs=None, runtime_library_dirs=None, #export_symbols=None, extra_preargs=None, extra_postargs=None, #build_temp=None assert output_dir is None # distutils build_ext doesn't pass this output_dir,filename = os.path.split(output_libname) basename, ext = os.path.splitext(filename) if self.library_filename("x").startswith('lib'): # strip 'lib' prefix; this is kludgy if some platform uses # a different prefix basename = basename[3:] self.create_static_lib( objects, basename, output_dir, debug, target_lang ) 07070100068635000081a4000000000000000000000001513ff56600000d89000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyc e?Qc@sddlZddlZddlmZddlmZddlmZddlTddlm Z m Z m Z dZ de fd YZ d ZdS( iN(tCommand(t convert_path(tlog(t*(t edit_configt option_baset config_filecCsJx$dD]}||krt|SqW|j|gkrFt|S|S(s4Quote an argument for later parsing by shlex.split()t"t's\t#(RRs\R (treprtsplit(targtc((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pytshquotes    taliascBsUeZdZdZeZdgejZejdgZdZ dZ dZ RS( s3Define a shortcut that invokes one or more commandss0define a shortcut to invoke one or more commandstremovetrsremove (unset) the aliascCs#tj|d|_d|_dS(N(Rtinitialize_optionstNonetargsR(tself((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyRs  cCs>tj||jr:t|jdkr:tdndS(NisFMust specify exactly one argument (the alias name) when using --remove(Rtfinalize_optionsRtlenRtDistutilsOptionError(R((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyR"s cCs|jjd}|jsLdGHdGHx |D]}dGt||GHq,WdSt|jdkr|j\}|jrd}q||krdGt||GHdSd|GHdSn,|jd}djtt |jd}t |j ii||6d6|j dS( NtaliasessCommand Aliasess---------------ssetup.py aliasis No alias definition found for %rit ( t distributiontget_option_dictRt format_aliasRRRtjointmapRRtfilenametdry_run(RRRtcommand((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pytrun*s&        (sremoveRsremove (unset) the alias( t__name__t __module__t__doc__t descriptiontTruetcommand_consumes_argumentsRt user_optionstboolean_optionsRRR#(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyRs   cCs{||\}}|tdkr+d}n@|tdkrFd}n%|tdkrad}n d|}||d|S( Ntglobals--global-config tusers--user-config tlocalts --filename=%rR(R(tnameRtsourceR"((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyREs    (t distutilstost setuptoolsRtdistutils.utilRRtdistutils.errorstsetuptools.command.setoptRRRRRR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/alias.pyts  40707010006863f000081a4000000000000000000000001513ff5650000313c000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyc e?Qc@sddlZddlZddlZddlmZddlmZddl m Z yrddlm Z ddl m Z ddlmZmZddlZdefd YZd e fd YZ Wn$ek rd dd YZ nXd ee fdYZdZdS(iN(tbuild_py(t convert_path(tglob(t Mixin2to3(tlog(tRefactoringTooltget_fixers_from_packagetDistutilsRefactoringToolcBs#eZdZdZdZRS(cOstj||dS(N(Rterror(tselftmsgtargstkw((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyt log_error scGstj||dS(N(Rtinfo(R R R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyt log_messagescGstj||dS(N(Rtdebug(R R R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyt log_debugs(t__name__t __module__R RR(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyR s  RcBs&eZedZdZdZRS(cCs|jjtk rdS|s dStjddj||j|j|rtj rt |j }|j |dtdtqnt j||dS(NsFixing t twritet doctests_only(t distributiontuse_2to3tTrueRRtjoint_Mixin2to3__build_fixer_namest_Mixin2to3__exclude_fixerst setuptoolstrun_2to3_on_doctestsRt fixer_namestrefactort _Mixin2to3trun_2to3(R tfilestdocteststr((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyR"s   cCs|jr dSg|_x'tjD]}|jjt|q W|jjdk rx-|jjD]}|jjt|q_WndS(N(RRtlib2to3_fixer_packagestextendRRtuse_2to3_fixerstNone(R tp((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyt__build_fixer_names(s  cCst|dg}|jjdk r:|j|jjnxC|D];}||jkrltjd|qAn|jj|qAWdS(Ntexclude_fixerssExcluded fixer %s not found( tgetattrRtuse_2to3_exclude_fixersR)R'RRtwarntremove(R texcluded_fixerst fixer_name((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyt__exclude_fixers1s (RRtFalseR"RR(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyRs  cBseZedZRS(cCsdS(N((R R#R$((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyR"=s(RRRR"(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyR<sRcBseZdZdZdZdZdZdZdZdZ dZ d Z e j d kr{d d Znd ZdZdZdZRS(sXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsctj||jj|_|jjp+i|_d|jkrM|jd=ng|_g|_dS(Nt data_files(t _build_pytfinalize_optionsRt package_datatexclude_package_datat__dict__t_build_py__updated_filest_build_py__doctests_2to3(R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyR7Js   cCs|j r|j rdS|jr.|jn|jrN|j|jn|j|jt|j|jt|j|j t|j t j |dddS(s?Build modules, packages, and copy data files to build directoryNtinclude_bytecodei( t py_modulestpackagest build_modulestbuild_packagestbuild_package_dataR"R;R4RR<t byte_compileR6t get_outputs(R ((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pytrunRs     cCs3|dkr#|j|_}|Stj||S(NR5(t_get_data_filesR5R6t __getattr__(R tattrR#((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyRGfs cCsAtj||||\}}|r7|jj|n||fS(N(R6t build_moduleR;tappend(R tmodulet module_filetpackagetoutfiletcopied((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyRIkscCs|jg}x|jpdD]}|j|}tjj|jg|jd}t|d}g|j ||D]}||^q}}|j ||||fq W|S(s?Generate list of '(package,src_dir,build_dir,filenames)' tuplest.i(( tanalyze_manifestR?tget_package_dirtostpathRt build_libtsplittlentfind_data_filesRJ(R tdataRMtsrc_dirt build_dirtplentfilet filenames((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyRFqs %)cCs|jjdg|jj|g}|jj|g}x6|D].}|jttjj|t|qEW|j |||S(s6Return filenames for package's data files in 'src_dir't( R8tgettmanifest_filesR'RRSRTRRtexclude_data_files(R RMRZtglobsR#tpattern((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyRXs  ,c Csd}x|jD]\}}}}x|D]}tjj||}|jtjj|tjj||}|j||\} } tjj|}| r)||j j kr)|j j | q)q)WqWdS(s$Copy data files into build directoryN( R)R5RSRTRtmkpathtdirnamet copy_filetabspathRtconvert_2to3_doctestsR<RJ( R tlastdirRMRZR[R^tfilenamettargettsrcfiletoutfRO((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyRBs c Cs\i|_}|jjsdSi}x0|jp2dD]}||t|j|s$  % 0707010006865a000081ed000000000000000000000001513ff56500001a1b000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.py"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" from distutils.errors import * from distutils.core import Command from distutils.spawn import spawn from distutils import log try: from hashlib import md5 except ImportError: from md5 import md5 import os import socket import platform import ConfigParser import httplib import base64 import urlparse import cStringIO as StringIO class upload(Command): description = "upload binary package to PyPI" DEFAULT_REPOSITORY = 'http://pypi.python.org/pypi' user_options = [ ('repository=', 'r', "url of repository [default: %s]" % DEFAULT_REPOSITORY), ('show-response', None, 'display full response text from server'), ('sign', 's', 'sign files to upload using gpg'), ('identity=', 'i', 'GPG identity used to sign files'), ] boolean_options = ['show-response', 'sign'] def initialize_options(self): self.username = '' self.password = '' self.repository = '' self.show_response = 0 self.sign = False self.identity = None def finalize_options(self): if self.identity and not self.sign: raise DistutilsOptionError( "Must use --sign for --identity to have meaning" ) if os.environ.has_key('HOME'): rc = os.path.join(os.environ['HOME'], '.pypirc') if os.path.exists(rc): self.announce('Using PyPI login from %s' % rc) config = ConfigParser.ConfigParser({ 'username':'', 'password':'', 'repository':''}) config.read(rc) if not self.repository: self.repository = config.get('server-login', 'repository') if not self.username: self.username = config.get('server-login', 'username') if not self.password: self.password = config.get('server-login', 'password') if not self.repository: self.repository = self.DEFAULT_REPOSITORY def run(self): if not self.distribution.dist_files: raise DistutilsOptionError("No dist file created in earlier command") for command, pyversion, filename in self.distribution.dist_files: self.upload_file(command, pyversion, filename) def upload_file(self, command, pyversion, filename): # Sign if requested if self.sign: gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args, dry_run=self.dry_run) # Fill in the data f = open(filename,'rb') content = f.read() f.close() basename = os.path.basename(filename) comment = '' if command=='bdist_egg' and self.distribution.has_ext_modules(): comment = "built on %s" % platform.platform(terse=1) data = { ':action':'file_upload', 'protocol_version':'1', 'name':self.distribution.get_name(), 'version':self.distribution.get_version(), 'content':(basename,content), 'filetype':command, 'pyversion':pyversion, 'md5_digest':md5(content).hexdigest(), } if command == 'bdist_rpm': dist, version, id = platform.dist() if dist: comment = 'built for %s %s' % (dist, version) elif command == 'bdist_dumb': comment = 'built for %s' % platform.platform(terse=1) data['comment'] = comment if self.sign: data['gpg_signature'] = (os.path.basename(filename) + ".asc", open(filename+".asc").read()) # set up the authentication auth = "Basic " + base64.encodestring(self.username + ":" + self.password).strip() # Build up the MIME payload for the POST data boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = '\n--' + boundary end_boundary = sep_boundary + '--' body = StringIO.StringIO() for key, value in data.items(): # handle multiple entries for the same name if type(value) != type([]): value = [value] for value in value: if type(value) is tuple: fn = ';filename="%s"' % value[0] value = value[1] else: fn = "" value = str(value) body.write(sep_boundary) body.write('\nContent-Disposition: form-data; name="%s"'%key) body.write(fn) body.write("\n\n") body.write(value) if value and value[-1] == '\r': body.write('\n') # write an extra newline (lurve Macs) body.write(end_boundary) body.write("\n") body = body.getvalue() self.announce("Submitting %s to %s" % (filename, self.repository), log.INFO) # build the Request # We can't use urllib2 since we need to send the Basic # auth right with the first request schema, netloc, url, params, query, fragments = \ urlparse.urlparse(self.repository) assert not params and not query and not fragments if schema == 'http': http = httplib.HTTPConnection(netloc) elif schema == 'https': http = httplib.HTTPSConnection(netloc) else: raise AssertionError, "unsupported schema "+schema data = '' loglevel = log.INFO try: http.connect() http.putrequest("POST", url) http.putheader('Content-type', 'multipart/form-data; boundary=%s'%boundary) http.putheader('Content-length', str(len(body))) http.putheader('Authorization', auth) http.endheaders() http.send(body) except socket.error, e: self.announce(str(e), log.ERROR) return r = http.getresponse() if r.status == 200: self.announce('Server response (%s): %s' % (r.status, r.reason), log.INFO) else: self.announce('Upload failed (%s): %s' % (r.status, r.reason), log.ERROR) if self.show_response: print '-'*75, r.read(), '-'*75 07070100068654000081ed000000000000000000000001513ff56500001daf000000b500010002ffffffffffffffff0000006300000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyfrom 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(' '3' try: bytes except NameError: bytes = str def b(str_or_bytes): """Return bytes by either encoding the argument as ASCII or simply return the argument as-is.""" if not isinstance(str_or_bytes, bytes): return str_or_bytes.encode('ascii') else: return str_or_bytes class upload_docs(upload): description = 'Upload documentation to PyPI' user_options = [ ('repository=', 'r', "url of repository [default: %s]" % upload.DEFAULT_REPOSITORY), ('show-response', None, 'display full response text from server'), ('upload-dir=', None, 'directory to upload'), ] boolean_options = upload.boolean_options def initialize_options(self): upload.initialize_options(self) self.upload_dir = None def finalize_options(self): upload.finalize_options(self) if self.upload_dir is None: build = self.get_finalized_command('build') self.upload_dir = os.path.join(build.build_base, 'docs') self.mkpath(self.upload_dir) self.ensure_dirname('upload_dir') self.announce('Using upload directory %s' % self.upload_dir) def create_zipfile(self): name = self.distribution.metadata.get_name() tmp_dir = tempfile.mkdtemp() tmp_file = os.path.join(tmp_dir, "%s.zip" % name) zip_file = zipfile.ZipFile(tmp_file, "w") for root, dirs, files in os.walk(self.upload_dir): if root == self.upload_dir and not files: raise DistutilsOptionError( "no files found in upload directory '%s'" % self.upload_dir) for name in files: full = os.path.join(root, name) relative = root[len(self.upload_dir):].lstrip(os.path.sep) dest = os.path.join(relative, name) zip_file.write(full, dest) zip_file.close() return tmp_file def run(self): zip_file = self.create_zipfile() self.upload_file(zip_file) def upload_file(self, filename): content = open(filename, 'rb').read() meta = self.distribution.metadata data = { ':action': 'doc_upload', 'name': meta.get_name(), 'content': (os.path.basename(filename), content), } # set up the authentication credentials = self.username + ':' + self.password if _IS_PYTHON3: # base64 only works with bytes in Python 3. encoded_creds = base64.encodebytes(credentials.encode('utf8')) auth = bytes("Basic ") else: encoded_creds = base64.encodestring(credentials) auth = "Basic " auth += encoded_creds.strip() # Build up the MIME payload for the POST data boundary = b('--------------GHSKFJDLGDS7543FJKLFHRE75642756743254') sep_boundary = b('\n--') + boundary end_boundary = sep_boundary + b('--') body = [] for key, values in data.items(): # handle multiple entries for the same name if type(values) != type([]): values = [values] for value in values: if type(value) is tuple: fn = b(';filename="%s"' % value[0]) value = value[1] else: fn = b("") body.append(sep_boundary) body.append(b('\nContent-Disposition: form-data; name="%s"'%key)) body.append(fn) body.append(b("\n\n")) body.append(b(value)) if value and value[-1] == b('\r'): body.append(b('\n')) # write an extra newline (lurve Macs) body.append(end_boundary) body.append(b("\n")) body = b('').join(body) self.announce("Submitting documentation to %s" % (self.repository), log.INFO) # build the Request # We can't use urllib2 since we need to send the Basic # auth right with the first request schema, netloc, url, params, query, fragments = \ urlparse.urlparse(self.repository) assert not params and not query and not fragments if schema == 'http': conn = httplib.HTTPConnection(netloc) elif schema == 'https': conn = httplib.HTTPSConnection(netloc) else: raise AssertionError("unsupported schema "+schema) data = '' loglevel = log.INFO try: conn.connect() conn.putrequest("POST", url) conn.putheader('Content-type', 'multipart/form-data; boundary=%s'%boundary) conn.putheader('Content-length', str(len(body))) conn.putheader('Authorization', auth) conn.endheaders() conn.send(body) except socket.error, e: self.announce(str(e), log.ERROR) return r = conn.getresponse() if r.status == 200: self.announce('Server response (%s): %s' % (r.status, r.reason), log.INFO) elif r.status == 301: location = r.getheader('Location') if location is None: location = 'http://packages.python.org/%s/' % meta.get_name() self.announce('Upload successful. Visit %s' % location, log.INFO) else: self.announce('Upload failed (%s): %s' % (r.status, r.reason), log.ERROR) if self.show_response: print '-'*75, r.read(), '-'*75 07070100068642000081ed000000000000000000000001513ff56500011aed000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.py#!python """\ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ http://packages.python.org/distribute/easy_install.html """ import sys import os import zipimport import shutil import tempfile import zipfile import re import stat import random from glob import glob from setuptools import Command, _dont_write_bytecode from setuptools.sandbox import run_setup from distutils import log, dir_util from distutils.util import get_platform from distutils.util import convert_path, subst_vars from distutils.sysconfig import get_python_lib, get_config_vars from distutils.errors import DistutilsArgError, DistutilsOptionError, \ DistutilsError, DistutilsPlatformError from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS from setuptools.command import setopt from setuptools.archive_util import unpack_archive from setuptools.package_index import PackageIndex from setuptools.package_index import URL_SCHEME from setuptools.command import bdist_egg, egg_info from pkg_resources import yield_lines, normalize_path, resource_string, \ ensure_directory, get_distribution, find_distributions, \ Environment, Requirement, Distribution, \ PathMetadata, EggMetadata, WorkingSet, \ DistributionNotFound, VersionConflict, \ DEVELOP_DIST sys_executable = os.path.normpath(sys.executable) __all__ = [ 'samefile', 'easy_install', 'PthDistributions', 'extract_wininst_cfg', 'main', 'get_exe_prefixes', ] import site HAS_USER_SITE = not sys.version < "2.6" and site.ENABLE_USER_SITE import struct def is_64bit(): return struct.calcsize("P") == 8 def samefile(p1,p2): if hasattr(os.path,'samefile') and ( os.path.exists(p1) and os.path.exists(p2) ): return os.path.samefile(p1,p2) return ( os.path.normpath(os.path.normcase(p1)) == os.path.normpath(os.path.normcase(p2)) ) if sys.version_info <= (3,): def _to_ascii(s): return s def isascii(s): try: unicode(s, 'ascii') return True except UnicodeError: return False else: def _to_ascii(s): return s.encode('ascii') def isascii(s): try: s.encode('ascii') return True except UnicodeError: return False class easy_install(Command): """Manage a download/build/install process""" description = "Find/get/install Python packages" command_consumes_arguments = True user_options = [ ('prefix=', None, "installation prefix"), ("zip-ok", "z", "install package as a zipfile"), ("multi-version", "m", "make apps have to require() a version"), ("upgrade", "U", "force upgrade (searches PyPI for latest versions)"), ("install-dir=", "d", "install package to DIR"), ("script-dir=", "s", "install scripts to DIR"), ("exclude-scripts", "x", "Don't install scripts"), ("always-copy", "a", "Copy all needed packages to install dir"), ("index-url=", "i", "base URL of Python Package Index"), ("find-links=", "f", "additional URL(s) to search for packages"), ("delete-conflicting", "D", "no longer needed; don't use this"), ("ignore-conflicts-at-my-risk", None, "no longer needed; don't use this"), ("build-directory=", "b", "download/extract/build in DIR; keep the results"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('record=', None, "filename in which to record list of installed files"), ('always-unzip', 'Z', "don't install as a zipfile, no matter what"), ('site-dirs=','S',"list of directories where .pth files work"), ('editable', 'e', "Install specified packages in editable form"), ('no-deps', 'N', "don't install dependencies"), ('allow-hosts=', 'H', "pattern(s) that hostnames must match"), ('local-snapshots-ok', 'l', "allow building eggs from local checkouts"), ('version', None, "print version information and exit"), ('no-find-links', None, "Don't load find-links defined in packages being installed") ] boolean_options = [ 'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy', 'delete-conflicting', 'ignore-conflicts-at-my-risk', 'editable', 'no-deps', 'local-snapshots-ok', 'version' ] if HAS_USER_SITE: user_options.append(('user', None, "install in user site-package '%s'" % site.USER_SITE)) boolean_options.append('user') negative_opt = {'always-unzip': 'zip-ok'} create_index = PackageIndex def initialize_options(self): if HAS_USER_SITE: whereami = os.path.abspath(__file__) self.user = whereami.startswith(site.USER_SITE) else: self.user = 0 self.zip_ok = self.local_snapshots_ok = None self.install_dir = self.script_dir = self.exclude_scripts = None self.index_url = None self.find_links = None self.build_directory = None self.args = None self.optimize = self.record = None self.upgrade = self.always_copy = self.multi_version = None self.editable = self.no_deps = self.allow_hosts = None self.root = self.prefix = self.no_report = None self.version = None self.install_purelib = None # for pure module distributions self.install_platlib = None # non-pure (dists w/ extensions) self.install_headers = None # for C/C++ headers self.install_lib = None # set to either purelib or platlib self.install_scripts = None self.install_data = None self.install_base = None self.install_platbase = None if HAS_USER_SITE: self.install_userbase = site.USER_BASE self.install_usersite = site.USER_SITE else: self.install_userbase = None self.install_usersite = None self.no_find_links = None # Options not specifiable via command line self.package_index = None self.pth_file = self.always_copy_from = None self.delete_conflicting = None self.ignore_conflicts_at_my_risk = None self.site_dirs = None self.installed_projects = {} self.sitepy_installed = False # Always read easy_install options, even if we are subclassed, or have # an independent instance created. This ensures that defaults will # always come from the standard configuration file(s)' "easy_install" # section, even if this is a "develop" or "install" command, or some # other embedding. self._dry_run = None self.verbose = self.distribution.verbose self.distribution._set_command_options( self, self.distribution.get_option_dict('easy_install') ) def delete_blockers(self, blockers): for filename in blockers: if os.path.exists(filename) or os.path.islink(filename): log.info("Deleting %s", filename) if not self.dry_run: if os.path.isdir(filename) and not os.path.islink(filename): rmtree(filename) else: os.unlink(filename) def finalize_options(self): if self.version: print 'distribute %s' % get_distribution('distribute').version sys.exit() py_version = sys.version.split()[0] prefix, exec_prefix = get_config_vars('prefix', 'exec_prefix') self.config_vars = {'dist_name': self.distribution.get_name(), 'dist_version': self.distribution.get_version(), 'dist_fullname': self.distribution.get_fullname(), 'py_version': py_version, 'py_version_short': py_version[0:3], 'py_version_nodot': py_version[0] + py_version[2], 'sys_prefix': prefix, 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, # Only python 3.2+ has abiflags 'abiflags': getattr(sys, 'abiflags', ''), } if HAS_USER_SITE: self.config_vars['userbase'] = self.install_userbase self.config_vars['usersite'] = self.install_usersite # fix the install_dir if "--user" was used #XXX: duplicate of the code in the setup command if self.user and HAS_USER_SITE: self.create_home_path() if self.install_userbase is None: raise DistutilsPlatformError( "User base directory is not specified") self.install_base = self.install_platbase = self.install_userbase if os.name == 'posix': self.select_scheme("unix_user") else: self.select_scheme(os.name + "_user") self.expand_basedirs() self.expand_dirs() self._expand('install_dir','script_dir','build_directory','site_dirs') # If a non-default installation directory was specified, default the # script directory to match it. if self.script_dir is None: self.script_dir = self.install_dir if self.no_find_links is None: self.no_find_links = False # Let install_dir get set by install_lib command, which in turn # gets its info from the install command, and takes into account # --prefix and --home and all that other crud. self.set_undefined_options('install_lib', ('install_dir','install_dir') ) # Likewise, set default script_dir from 'install_scripts.install_dir' self.set_undefined_options('install_scripts', ('install_dir', 'script_dir') ) if self.user and self.install_purelib: self.install_dir = self.install_purelib self.script_dir = self.install_scripts # default --record from the install command self.set_undefined_options('install', ('record', 'record')) normpath = map(normalize_path, sys.path) self.all_site_dirs = get_site_dirs() if self.site_dirs is not None: site_dirs = [ os.path.expanduser(s.strip()) for s in self.site_dirs.split(',') ] for d in site_dirs: if not os.path.isdir(d): log.warn("%s (in --site-dirs) does not exist", d) elif normalize_path(d) not in normpath: raise DistutilsOptionError( d+" (in --site-dirs) is not on sys.path" ) else: self.all_site_dirs.append(normalize_path(d)) if not self.editable: self.check_site_dir() self.index_url = self.index_url or "http://pypi.python.org/simple" self.shadow_path = self.all_site_dirs[:] for path_item in self.install_dir, normalize_path(self.script_dir): if path_item not in self.shadow_path: self.shadow_path.insert(0, path_item) if self.allow_hosts is not None: hosts = [s.strip() for s in self.allow_hosts.split(',')] else: hosts = ['*'] if self.package_index is None: self.package_index = self.create_index( self.index_url, search_path = self.shadow_path, hosts=hosts, ) self.local_index = Environment(self.shadow_path+sys.path) if self.find_links is not None: if isinstance(self.find_links, basestring): self.find_links = self.find_links.split() else: self.find_links = [] if self.local_snapshots_ok: self.package_index.scan_egg_links(self.shadow_path+sys.path) if not self.no_find_links: self.package_index.add_find_links(self.find_links) self.set_undefined_options('install_lib', ('optimize','optimize')) if not isinstance(self.optimize,int): try: self.optimize = int(self.optimize) if not (0 <= self.optimize <= 2): raise ValueError except ValueError: raise DistutilsOptionError("--optimize must be 0, 1, or 2") if self.delete_conflicting and self.ignore_conflicts_at_my_risk: raise DistutilsOptionError( "Can't use both --delete-conflicting and " "--ignore-conflicts-at-my-risk at the same time" ) if self.editable and not self.build_directory: raise DistutilsArgError( "Must specify a build directory (-b) when using --editable" ) if not self.args: raise DistutilsArgError( "No urls, filenames, or requirements specified (see --help)") self.outputs = [] def _expand_attrs(self, attrs): for attr in attrs: val = getattr(self, attr) if val is not None: if os.name == 'posix' or os.name == 'nt': val = os.path.expanduser(val) val = subst_vars(val, self.config_vars) setattr(self, attr, val) def expand_basedirs(self): """Calls `os.path.expanduser` on install_base, install_platbase and root.""" self._expand_attrs(['install_base', 'install_platbase', 'root']) def expand_dirs(self): """Calls `os.path.expanduser` on install dirs.""" self._expand_attrs(['install_purelib', 'install_platlib', 'install_lib', 'install_headers', 'install_scripts', 'install_data',]) def run(self): if self.verbose != self.distribution.verbose: log.set_verbosity(self.verbose) try: for spec in self.args: self.easy_install(spec, not self.no_deps) if self.record: outputs = self.outputs if self.root: # strip any package prefix root_len = len(self.root) for counter in xrange(len(outputs)): outputs[counter] = outputs[counter][root_len:] from distutils import file_util self.execute( file_util.write_file, (self.record, outputs), "writing list of installed files to '%s'" % self.record ) self.warn_deprecated_options() finally: log.set_verbosity(self.distribution.verbose) def pseudo_tempname(self): """Return a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. """ try: pid = os.getpid() except: pid = random.randint(0,sys.maxint) return os.path.join(self.install_dir, "test-easy-install-%s" % pid) def warn_deprecated_options(self): if self.delete_conflicting or self.ignore_conflicts_at_my_risk: log.warn( "Note: The -D, --delete-conflicting and" " --ignore-conflicts-at-my-risk no longer have any purpose" " and should not be used." ) def check_site_dir(self): """Verify that self.install_dir is .pth-capable dir, if needed""" instdir = normalize_path(self.install_dir) pth_file = os.path.join(instdir,'easy-install.pth') # Is it a configured, PYTHONPATH, implicit, or explicit site dir? is_site_dir = instdir in self.all_site_dirs if not is_site_dir: # No? Then directly test whether it does .pth file processing is_site_dir = self.check_pth_processing() else: # make sure we can write to target dir testfile = self.pseudo_tempname()+'.write-test' test_exists = os.path.exists(testfile) try: if test_exists: os.unlink(testfile) open(testfile,'w').close() os.unlink(testfile) except (OSError,IOError): self.cant_write_to_target() if not is_site_dir and not self.multi_version: # Can't install non-multi to non-site dir raise DistutilsError(self.no_default_version_msg()) if is_site_dir: if self.pth_file is None: self.pth_file = PthDistributions(pth_file, self.all_site_dirs) else: self.pth_file = None PYTHONPATH = os.environ.get('PYTHONPATH','').split(os.pathsep) if instdir not in map(normalize_path, filter(None,PYTHONPATH)): # only PYTHONPATH dirs need a site.py, so pretend it's there self.sitepy_installed = True elif self.multi_version and not os.path.exists(pth_file): self.sitepy_installed = True # don't need site.py in this case self.pth_file = None # and don't create a .pth file self.install_dir = instdir def cant_write_to_target(self): msg = """can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s """ % (sys.exc_info()[1], self.install_dir,) if not os.path.exists(self.install_dir): msg += """ This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). """ else: msg += """ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: http://packages.python.org/distribute/easy_install.html Please make the appropriate changes for your system and try again. """ raise DistutilsError(msg) def check_pth_processing(self): """Empirically verify whether .pth files are supported in inst. dir""" instdir = self.install_dir log.info("Checking .pth file support in %s", instdir) pth_file = self.pseudo_tempname()+".pth" ok_file = pth_file+'.ok' ok_exists = os.path.exists(ok_file) try: if ok_exists: os.unlink(ok_file) dirname = os.path.dirname(ok_file) if not os.path.exists(dirname): os.makedirs(dirname) f = open(pth_file,'w') except (OSError,IOError): self.cant_write_to_target() else: try: f.write("import os;open(%r,'w').write('OK')\n" % (ok_file,)) f.close(); f=None executable = sys.executable if os.name=='nt': dirname,basename = os.path.split(executable) alt = os.path.join(dirname,'pythonw.exe') if basename.lower()=='python.exe' and os.path.exists(alt): # use pythonw.exe to avoid opening a console window executable = alt from distutils.spawn import spawn spawn([executable,'-E','-c','pass'],0) if os.path.exists(ok_file): log.info( "TEST PASSED: %s appears to support .pth files", instdir ) return True finally: if f: f.close() if os.path.exists(ok_file): os.unlink(ok_file) if os.path.exists(pth_file): os.unlink(pth_file) if not self.multi_version: log.warn("TEST FAILED: %s does NOT support .pth files", instdir) return False def install_egg_scripts(self, dist): """Write all the scripts for `dist`, unless scripts are excluded""" if not self.exclude_scripts and dist.metadata_isdir('scripts'): for script_name in dist.metadata_listdir('scripts'): self.install_script( dist, script_name, dist.get_metadata('scripts/'+script_name) ) self.install_wrapper_scripts(dist) def add_output(self, path): if os.path.isdir(path): for base, dirs, files in os.walk(path): for filename in files: self.outputs.append(os.path.join(base,filename)) else: self.outputs.append(path) def not_editable(self, spec): if self.editable: raise DistutilsArgError( "Invalid argument %r: you can't use filenames or URLs " "with --editable (except via the --find-links option)." % (spec,) ) def check_editable(self,spec): if not self.editable: return if os.path.exists(os.path.join(self.build_directory, spec.key)): raise DistutilsArgError( "%r already exists in %s; can't do a checkout there" % (spec.key, self.build_directory) ) def easy_install(self, spec, deps=False): tmpdir = tempfile.mkdtemp(prefix="easy_install-") download = None if not self.editable: self.install_site_py() try: if not isinstance(spec,Requirement): if URL_SCHEME(spec): # It's a url, download it to tmpdir and process self.not_editable(spec) download = self.package_index.download(spec, tmpdir) return self.install_item(None, download, tmpdir, deps, True) elif os.path.exists(spec): # Existing file or directory, just process it directly self.not_editable(spec) return self.install_item(None, spec, tmpdir, deps, True) else: spec = parse_requirement_arg(spec) self.check_editable(spec) dist = self.package_index.fetch_distribution( spec, tmpdir, self.upgrade, self.editable, not self.always_copy, self.local_index ) if dist is None: msg = "Could not find suitable distribution for %r" % spec if self.always_copy: msg+=" (--always-copy skips system and development eggs)" raise DistutilsError(msg) elif dist.precedence==DEVELOP_DIST: # .egg-info dists don't need installing, just process deps self.process_distribution(spec, dist, deps, "Using") return dist else: return self.install_item(spec, dist.location, tmpdir, deps) finally: if os.path.exists(tmpdir): rmtree(tmpdir) def install_item(self, spec, download, tmpdir, deps, install_needed=False): # Installation is also needed if file in tmpdir or is not an egg install_needed = install_needed or self.always_copy install_needed = install_needed or os.path.dirname(download) == tmpdir install_needed = install_needed or not download.endswith('.egg') install_needed = install_needed or ( self.always_copy_from is not None and os.path.dirname(normalize_path(download)) == normalize_path(self.always_copy_from) ) if spec and not install_needed: # at this point, we know it's a local .egg, we just don't know if # it's already installed. for dist in self.local_index[spec.project_name]: if dist.location==download: break else: install_needed = True # it's not in the local index log.info("Processing %s", os.path.basename(download)) if install_needed: dists = self.install_eggs(spec, download, tmpdir) for dist in dists: self.process_distribution(spec, dist, deps) else: dists = [self.check_conflicts(self.egg_distribution(download))] self.process_distribution(spec, dists[0], deps, "Using") if spec is not None: for dist in dists: if dist in spec: return dist def select_scheme(self, name): """Sets the install directories by applying the install schemes.""" # it's the caller's problem if they supply a bad name! scheme = INSTALL_SCHEMES[name] for key in SCHEME_KEYS: attrname = 'install_' + key if getattr(self, attrname) is None: setattr(self, attrname, scheme[key]) def process_distribution(self, requirement, dist, deps=True, *info): self.update_pth(dist) self.package_index.add(dist) self.local_index.add(dist) if not self.editable: self.install_egg_scripts(dist) self.installed_projects[dist.key] = dist log.info(self.installation_report(requirement, dist, *info)) if (dist.has_metadata('dependency_links.txt') and not self.no_find_links): self.package_index.add_find_links( dist.get_metadata_lines('dependency_links.txt') ) if not deps and not self.always_copy: return elif requirement is not None and dist.key != requirement.key: log.warn("Skipping dependencies for %s", dist) return # XXX this is not the distribution we were looking for elif requirement is None or dist not in requirement: # if we wound up with a different version, resolve what we've got distreq = dist.as_requirement() requirement = requirement or distreq requirement = Requirement( distreq.project_name, distreq.specs, requirement.extras ) log.info("Processing dependencies for %s", requirement) try: distros = WorkingSet([]).resolve( [requirement], self.local_index, self.easy_install ) except DistributionNotFound, e: raise DistutilsError( "Could not find required distribution %s" % e.args ) except VersionConflict, e: raise DistutilsError( "Installed distribution %s conflicts with requirement %s" % e.args ) if self.always_copy or self.always_copy_from: # Force all the relevant distros to be copied or activated for dist in distros: if dist.key not in self.installed_projects: self.easy_install(dist.as_requirement()) log.info("Finished processing dependencies for %s", requirement) def should_unzip(self, dist): if self.zip_ok is not None: return not self.zip_ok if dist.has_metadata('not-zip-safe'): return True if not dist.has_metadata('zip-safe'): return True return True def maybe_move(self, spec, dist_filename, setup_base): dst = os.path.join(self.build_directory, spec.key) if os.path.exists(dst): log.warn( "%r already exists in %s; build directory %s will not be kept", spec.key, self.build_directory, setup_base ) return setup_base if os.path.isdir(dist_filename): setup_base = dist_filename else: if os.path.dirname(dist_filename)==setup_base: os.unlink(dist_filename) # get it out of the tmp dir contents = os.listdir(setup_base) if len(contents)==1: dist_filename = os.path.join(setup_base,contents[0]) if os.path.isdir(dist_filename): # if the only thing there is a directory, move it instead setup_base = dist_filename ensure_directory(dst); shutil.move(setup_base, dst) return dst def install_wrapper_scripts(self, dist): if not self.exclude_scripts: for args in get_script_args(dist): self.write_script(*args) def install_script(self, dist, script_name, script_text, dev_path=None): """Generate a legacy script wrapper and install it""" spec = str(dist.as_requirement()) is_script = is_python_script(script_text, script_name) def get_template(filename): """ There are a couple of template scripts in the package. This function loads one of them and prepares it for use. These templates use triple-quotes to escape variable substitutions so the scripts get the 2to3 treatment when build on Python 3. The templates cannot use triple-quotes naturally. """ raw_bytes = resource_string('setuptools', template_name) template_str = raw_bytes.decode('utf-8') clean_template = template_str.replace('"""', '') return clean_template if is_script: template_name = 'script_template.py' if dev_path: template_name = template_name.replace('.py', '_dev.py') script_text = (get_script_header(script_text) + get_template(template_name) % locals()) self.write_script(script_name, _to_ascii(script_text), 'b') def write_script(self, script_name, contents, mode="t", blockers=()): """Write an executable file to the scripts directory""" self.delete_blockers( # clean up old .py/.pyw w/o a script [os.path.join(self.script_dir,x) for x in blockers]) log.info("Installing %s script to %s", script_name, self.script_dir) target = os.path.join(self.script_dir, script_name) self.add_output(target) mask = current_umask() if not self.dry_run: ensure_directory(target) f = open(target,"w"+mode) f.write(contents) f.close() chmod(target, 0777-mask) def install_eggs(self, spec, dist_filename, tmpdir): # .egg dirs or files are already built, so just return them if dist_filename.lower().endswith('.egg'): return [self.install_egg(dist_filename, tmpdir)] elif dist_filename.lower().endswith('.exe'): return [self.install_exe(dist_filename, tmpdir)] # Anything else, try to extract and build setup_base = tmpdir if os.path.isfile(dist_filename) and not dist_filename.endswith('.py'): unpack_archive(dist_filename, tmpdir, self.unpack_progress) elif os.path.isdir(dist_filename): setup_base = os.path.abspath(dist_filename) if (setup_base.startswith(tmpdir) # something we downloaded and self.build_directory and spec is not None ): setup_base = self.maybe_move(spec, dist_filename, setup_base) # Find the setup.py file setup_script = os.path.join(setup_base, 'setup.py') if not os.path.exists(setup_script): setups = glob(os.path.join(setup_base, '*', 'setup.py')) if not setups: raise DistutilsError( "Couldn't find a setup script in %s" % os.path.abspath(dist_filename) ) if len(setups)>1: raise DistutilsError( "Multiple setup scripts in %s" % os.path.abspath(dist_filename) ) setup_script = setups[0] # Now run it, and return the result if self.editable: log.info(self.report_editable(spec, setup_script)) return [] else: return self.build_and_install(setup_script, setup_base) def egg_distribution(self, egg_path): if os.path.isdir(egg_path): metadata = PathMetadata(egg_path,os.path.join(egg_path,'EGG-INFO')) else: metadata = EggMetadata(zipimport.zipimporter(egg_path)) return Distribution.from_filename(egg_path,metadata=metadata) def install_egg(self, egg_path, tmpdir): destination = os.path.join(self.install_dir,os.path.basename(egg_path)) destination = os.path.abspath(destination) if not self.dry_run: ensure_directory(destination) dist = self.egg_distribution(egg_path) self.check_conflicts(dist) if not samefile(egg_path, destination): if os.path.isdir(destination) and not os.path.islink(destination): dir_util.remove_tree(destination, dry_run=self.dry_run) elif os.path.exists(destination): self.execute(os.unlink,(destination,),"Removing "+destination) uncache_zipdir(destination) if os.path.isdir(egg_path): if egg_path.startswith(tmpdir): f,m = shutil.move, "Moving" else: f,m = shutil.copytree, "Copying" elif self.should_unzip(dist): self.mkpath(destination) f,m = self.unpack_and_compile, "Extracting" elif egg_path.startswith(tmpdir): f,m = shutil.move, "Moving" else: f,m = shutil.copy2, "Copying" self.execute(f, (egg_path, destination), (m+" %s to %s") % (os.path.basename(egg_path),os.path.dirname(destination))) self.add_output(destination) return self.egg_distribution(destination) def install_exe(self, dist_filename, tmpdir): # See if it's valid, get data cfg = extract_wininst_cfg(dist_filename) if cfg is None: raise DistutilsError( "%s is not a valid distutils Windows .exe" % dist_filename ) # Create a dummy distribution object until we build the real distro dist = Distribution(None, project_name=cfg.get('metadata','name'), version=cfg.get('metadata','version'), platform=get_platform() ) # Convert the .exe to an unpacked egg egg_path = dist.location = os.path.join(tmpdir, dist.egg_name()+'.egg') egg_tmp = egg_path+'.tmp' egg_info = os.path.join(egg_tmp, 'EGG-INFO') pkg_inf = os.path.join(egg_info, 'PKG-INFO') ensure_directory(pkg_inf) # make sure EGG-INFO dir exists dist._provider = PathMetadata(egg_tmp, egg_info) # XXX self.exe_to_egg(dist_filename, egg_tmp) # Write EGG-INFO/PKG-INFO if not os.path.exists(pkg_inf): f = open(pkg_inf,'w') f.write('Metadata-Version: 1.0\n') for k,v in cfg.items('metadata'): if k<>'target_version': f.write('%s: %s\n' % (k.replace('_','-').title(), v)) f.close() script_dir = os.path.join(egg_info,'scripts') self.delete_blockers( # delete entry-point scripts to avoid duping [os.path.join(script_dir,args[0]) for args in get_script_args(dist)] ) # Build .egg file from tmpdir bdist_egg.make_zipfile( egg_path, egg_tmp, verbose=self.verbose, dry_run=self.dry_run ) # install the .egg return self.install_egg(egg_path, tmpdir) def exe_to_egg(self, dist_filename, egg_tmp): """Extract a bdist_wininst to the directories an egg would use""" # Check for .pth file and set up prefix translations prefixes = get_exe_prefixes(dist_filename) to_compile = [] native_libs = [] top_level = {} def process(src,dst): s = src.lower() for old,new in prefixes: if s.startswith(old): src = new+src[len(old):] parts = src.split('/') dst = os.path.join(egg_tmp, *parts) dl = dst.lower() if dl.endswith('.pyd') or dl.endswith('.dll'): parts[-1] = bdist_egg.strip_module(parts[-1]) top_level[os.path.splitext(parts[0])[0]] = 1 native_libs.append(src) elif dl.endswith('.py') and old!='SCRIPTS/': top_level[os.path.splitext(parts[0])[0]] = 1 to_compile.append(dst) return dst if not src.endswith('.pth'): log.warn("WARNING: can't process %s", src) return None # extract, tracking .pyd/.dll->native_libs and .py -> to_compile unpack_archive(dist_filename, egg_tmp, process) stubs = [] for res in native_libs: if res.lower().endswith('.pyd'): # create stubs for .pyd's parts = res.split('/') resource = parts[-1] parts[-1] = bdist_egg.strip_module(parts[-1])+'.py' pyfile = os.path.join(egg_tmp, *parts) to_compile.append(pyfile); stubs.append(pyfile) bdist_egg.write_stub(resource, pyfile) self.byte_compile(to_compile) # compile .py's bdist_egg.write_safety_flag(os.path.join(egg_tmp,'EGG-INFO'), bdist_egg.analyze_egg(egg_tmp, stubs)) # write zip-safety flag for name in 'top_level','native_libs': if locals()[name]: txt = os.path.join(egg_tmp, 'EGG-INFO', name+'.txt') if not os.path.exists(txt): f = open(txt,'w') f.write('\n'.join(locals()[name])+'\n') f.close() def check_conflicts(self, dist): """Verify that there are no conflicting "old-style" packages""" return dist # XXX temporarily disable until new strategy is stable from imp import find_module, get_suffixes from glob import glob blockers = [] names = dict.fromkeys(dist._get_metadata('top_level.txt')) # XXX private attr exts = {'.pyc':1, '.pyo':1} # get_suffixes() might leave one out for ext,mode,typ in get_suffixes(): exts[ext] = 1 for path,files in expand_paths([self.install_dir]+self.all_site_dirs): for filename in files: base,ext = os.path.splitext(filename) if base in names: if not ext: # no extension, check for package try: f, filename, descr = find_module(base, [path]) except ImportError: continue else: if f: f.close() if filename not in blockers: blockers.append(filename) elif ext in exts and base!='site': # XXX ugh blockers.append(os.path.join(path,filename)) if blockers: self.found_conflicts(dist, blockers) return dist def found_conflicts(self, dist, blockers): if self.delete_conflicting: log.warn("Attempting to delete conflicting packages:") return self.delete_blockers(blockers) msg = """\ ------------------------------------------------------------------------- CONFLICT WARNING: The following modules or packages have the same names as modules or packages being installed, and will be *before* the installed packages in Python's search path. You MUST remove all of the relevant files and directories before you will be able to use the package(s) you are installing: %s """ % '\n '.join(blockers) if self.ignore_conflicts_at_my_risk: msg += """\ (Note: you can run EasyInstall on '%s' with the --delete-conflicting option to attempt deletion of the above files and/or directories.) """ % dist.project_name else: msg += """\ Note: you can attempt this installation again with EasyInstall, and use either the --delete-conflicting (-D) option or the --ignore-conflicts-at-my-risk option, to either delete the above files and directories, or to ignore the conflicts, respectively. Note that if you ignore the conflicts, the installed package(s) may not work. """ msg += """\ ------------------------------------------------------------------------- """ sys.stderr.write(msg) sys.stderr.flush() if not self.ignore_conflicts_at_my_risk: raise DistutilsError("Installation aborted due to conflicts") def installation_report(self, req, dist, what="Installed"): """Helpful installation message for display to package users""" msg = "\n%(what)s %(eggloc)s%(extras)s" if self.multi_version and not self.no_report: msg += """ Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher """ if self.install_dir not in map(normalize_path,sys.path): msg += """ Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) """ eggloc = dist.location name = dist.project_name version = dist.version extras = '' # TODO: self.report_extras(req, dist) return msg % locals() def report_editable(self, spec, setup_script): dirname = os.path.dirname(setup_script) python = sys.executable return """\nExtracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. """ % locals() def run_setup(self, setup_script, setup_base, args): sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg) sys.modules.setdefault('distutils.command.egg_info', egg_info) args = list(args) if self.verbose>2: v = 'v' * (self.verbose - 1) args.insert(0,'-'+v) elif self.verbose<2: args.insert(0,'-q') if self.dry_run: args.insert(0,'-n') log.info( "Running %s %s", setup_script[len(setup_base)+1:], ' '.join(args) ) try: run_setup(setup_script, args) except SystemExit, v: raise DistutilsError("Setup script exited with %s" % (v.args[0],)) def build_and_install(self, setup_script, setup_base): args = ['bdist_egg', '--dist-dir'] dist_dir = tempfile.mkdtemp( prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script) ) try: self._set_fetcher_options(os.path.dirname(setup_script)) args.append(dist_dir) self.run_setup(setup_script, setup_base, args) all_eggs = Environment([dist_dir]) eggs = [] for key in all_eggs: for dist in all_eggs[key]: eggs.append(self.install_egg(dist.location, setup_base)) if not eggs and not self.dry_run: log.warn("No eggs found in %s (setup script problem?)", dist_dir) return eggs finally: rmtree(dist_dir) log.set_verbosity(self.verbose) # restore our log verbosity def _set_fetcher_options(self, base): """ When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. """ # find the fetch options from easy_install and write them out # to the setup.cfg file. ei_opts = self.distribution.get_option_dict('easy_install').copy() fetch_directives = ( 'find_links', 'site_dirs', 'index_url', 'optimize', 'site_dirs', 'allow_hosts', ) fetch_options = {} for key, val in ei_opts.iteritems(): if key not in fetch_directives: continue fetch_options[key.replace('_', '-')] = val[1] # create a settings dictionary suitable for `edit_config` settings = dict(easy_install=fetch_options) cfg_filename = os.path.join(base, 'setup.cfg') setopt.edit_config(cfg_filename, settings) def update_pth(self,dist): if self.pth_file is None: return for d in self.pth_file[dist.key]: # drop old entries if self.multi_version or d.location != dist.location: log.info("Removing %s from easy-install.pth file", d) self.pth_file.remove(d) if d.location in self.shadow_path: self.shadow_path.remove(d.location) if not self.multi_version: if dist.location in self.pth_file.paths: log.info( "%s is already the active version in easy-install.pth", dist ) else: log.info("Adding %s to easy-install.pth file", dist) self.pth_file.add(dist) # add new entry if dist.location not in self.shadow_path: self.shadow_path.append(dist.location) if not self.dry_run: self.pth_file.save() if dist.key=='distribute': # Ensure that setuptools itself never becomes unavailable! # XXX should this check for latest version? filename = os.path.join(self.install_dir,'setuptools.pth') if os.path.islink(filename): os.unlink(filename) f = open(filename, 'wt') f.write(self.pth_file.make_relative(dist.location)+'\n') f.close() def unpack_progress(self, src, dst): # Progress filter for unpacking log.debug("Unpacking %s to %s", src, dst) return dst # only unpack-and-compile skips files for dry run def unpack_and_compile(self, egg_path, destination): to_compile = []; to_chmod = [] def pf(src,dst): if dst.endswith('.py') and not src.startswith('EGG-INFO/'): to_compile.append(dst) to_chmod.append(dst) elif dst.endswith('.dll') or dst.endswith('.so'): to_chmod.append(dst) self.unpack_progress(src,dst) return not self.dry_run and dst or None unpack_archive(egg_path, destination, pf) self.byte_compile(to_compile) if not self.dry_run: for f in to_chmod: mode = ((os.stat(f)[stat.ST_MODE]) | 0555) & 07755 chmod(f, mode) def byte_compile(self, to_compile): if _dont_write_bytecode: self.warn('byte-compiling is disabled, skipping.') return from distutils.util import byte_compile try: # try to make the byte compile messages quieter log.set_verbosity(self.verbose - 1) byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run) if self.optimize: byte_compile( to_compile, optimize=self.optimize, force=1, dry_run=self.dry_run ) finally: log.set_verbosity(self.verbose) # restore original verbosity def no_default_version_msg(self): return """bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: http://packages.python.org/distribute/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.""" % ( self.install_dir, os.environ.get('PYTHONPATH','') ) def install_site_py(self): """Make sure there's a site.py in the target dir, if needed""" if self.sitepy_installed: return # already did it, or don't need to sitepy = os.path.join(self.install_dir, "site.py") source = resource_string(Requirement.parse("distribute"), "site.py") current = "" if os.path.exists(sitepy): log.debug("Checking existing site.py in %s", self.install_dir) f = open(sitepy,'rb') current = f.read() # we want str, not bytes if sys.version_info >= (3,): current = current.decode() f.close() if not current.startswith('def __boot():'): raise DistutilsError( "%s is not a setuptools-generated site.py; please" " remove it." % sitepy ) if current != source: log.info("Creating %s", sitepy) if not self.dry_run: ensure_directory(sitepy) f = open(sitepy,'wb') f.write(source) f.close() self.byte_compile([sitepy]) self.sitepy_installed = True def create_home_path(self): """Create directories under ~.""" if not self.user: return home = convert_path(os.path.expanduser("~")) for name, path in self.config_vars.iteritems(): if path.startswith(home) and not os.path.isdir(path): self.debug_print("os.makedirs('%s', 0700)" % path) os.makedirs(path, 0700) INSTALL_SCHEMES = dict( posix = dict( install_dir = '$base/lib/python$py_version_short/site-packages', script_dir = '$base/bin', ), ) DEFAULT_SCHEME = dict( install_dir = '$base/Lib/site-packages', script_dir = '$base/Scripts', ) def _expand(self, *attrs): config_vars = self.get_finalized_command('install').config_vars if self.prefix: # Set default install_dir/scripts from --prefix config_vars = config_vars.copy() config_vars['base'] = self.prefix scheme = self.INSTALL_SCHEMES.get(os.name,self.DEFAULT_SCHEME) for attr,val in scheme.items(): if getattr(self,attr,None) is None: setattr(self,attr,val) from distutils.util import subst_vars for attr in attrs: val = getattr(self, attr) if val is not None: val = subst_vars(val, config_vars) if os.name == 'posix': val = os.path.expanduser(val) setattr(self, attr, val) def get_site_dirs(): # return a list of 'site' dirs sitedirs = filter(None,os.environ.get('PYTHONPATH','').split(os.pathsep)) prefixes = [sys.prefix] if sys.exec_prefix != sys.prefix: prefixes.append(sys.exec_prefix) for prefix in prefixes: if prefix: if sys.platform in ('os2emx', 'riscos'): sitedirs.append(os.path.join(prefix, "Lib", "site-packages")) elif os.sep == '/': sitedirs.extend([os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"), os.path.join(prefix, "lib", "site-python")]) else: sitedirs.extend( [prefix, os.path.join(prefix, "lib", "site-packages")] ) if sys.platform == 'darwin': # for framework builds *only* we add the standard Apple # locations. Currently only per-user, but /Library and # /Network/Library could be added too if 'Python.framework' in prefix: home = os.environ.get('HOME') if home: sitedirs.append( os.path.join(home, 'Library', 'Python', sys.version[:3], 'site-packages')) for plat_specific in (0,1): site_lib = get_python_lib(plat_specific) if site_lib not in sitedirs: sitedirs.append(site_lib) if HAS_USER_SITE: sitedirs.append(site.USER_SITE) sitedirs = map(normalize_path, sitedirs) return sitedirs def expand_paths(inputs): """Yield sys.path directories that might contain "old-style" packages""" seen = {} for dirname in inputs: dirname = normalize_path(dirname) if dirname in seen: continue seen[dirname] = 1 if not os.path.isdir(dirname): continue files = os.listdir(dirname) yield dirname, files for name in files: if not name.endswith('.pth'): # We only care about the .pth files continue if name in ('easy-install.pth','setuptools.pth'): # Ignore .pth files that we control continue # Read the .pth file f = open(os.path.join(dirname,name)) lines = list(yield_lines(f)) f.close() # Yield existing non-dupe, non-import directory lines from it for line in lines: if not line.startswith("import"): line = normalize_path(line.rstrip()) if line not in seen: seen[line] = 1 if not os.path.isdir(line): continue yield line, os.listdir(line) def extract_wininst_cfg(dist_filename): """Extract configuration data from a bdist_wininst .exe Returns a ConfigParser.RawConfigParser, or None """ f = open(dist_filename,'rb') try: endrec = zipfile._EndRecData(f) if endrec is None: return None prepended = (endrec[9] - endrec[5]) - endrec[6] if prepended < 12: # no wininst data here return None f.seek(prepended-12) import struct, StringIO, ConfigParser tag, cfglen, bmlen = struct.unpack("= (2,6): null_byte = bytes([0]) else: null_byte = chr(0) config = part.split(null_byte, 1)[0] # Now the config is in bytes, but on Python 3, it must be # unicode for the RawConfigParser, so decode it. Is this the # right encoding? config = config.decode('ascii') cfg.readfp(StringIO.StringIO(config)) except ConfigParser.Error: return None if not cfg.has_section('metadata') or not cfg.has_section('Setup'): return None return cfg finally: f.close() def get_exe_prefixes(exe_filename): """Get exe->egg path translations for a given .exe file""" prefixes = [ ('PURELIB/', ''), ('PLATLIB/pywin32_system32', ''), ('PLATLIB/', ''), ('SCRIPTS/', 'EGG-INFO/scripts/'), ('DATA/LIB/site-packages', ''), ] z = zipfile.ZipFile(exe_filename) try: for info in z.infolist(): name = info.filename parts = name.split('/') if len(parts)==3 and parts[2]=='PKG-INFO': if parts[1].endswith('.egg-info'): prefixes.insert(0,('/'.join(parts[:2]), 'EGG-INFO/')) break if len(parts)<>2 or not name.endswith('.pth'): continue if name.endswith('-nspkg.pth'): continue if parts[0].upper() in ('PURELIB','PLATLIB'): for pth in yield_lines(z.read(name)): pth = pth.strip().replace('\\','/') if not pth.startswith('import'): prefixes.append((('%s/%s/' % (parts[0],pth)), '')) finally: z.close() prefixes = [(x.lower(),y) for x, y in prefixes] prefixes.sort(); prefixes.reverse() return prefixes def parse_requirement_arg(spec): try: return Requirement.parse(spec) except ValueError: raise DistutilsError( "Not a URL, existing file, or requirement spec: %r" % (spec,) ) class PthDistributions(Environment): """A .pth file with Distribution paths in it""" dirty = False def __init__(self, filename, sitedirs=()): self.filename = filename; self.sitedirs=map(normalize_path, sitedirs) self.basedir = normalize_path(os.path.dirname(self.filename)) self._load(); Environment.__init__(self, [], None, None) for path in yield_lines(self.paths): map(self.add, find_distributions(path, True)) def _load(self): self.paths = [] saw_import = False seen = dict.fromkeys(self.sitedirs) if os.path.isfile(self.filename): f = open(self.filename,'rt') for line in f: if line.startswith('import'): saw_import = True continue path = line.rstrip() self.paths.append(path) if not path.strip() or path.strip().startswith('#'): continue # skip non-existent paths, in case somebody deleted a package # manually, and duplicate paths as well path = self.paths[-1] = normalize_path( os.path.join(self.basedir,path) ) if not os.path.exists(path) or path in seen: self.paths.pop() # skip it self.dirty = True # we cleaned up, so we're dirty now :) continue seen[path] = 1 f.close() if self.paths and not saw_import: self.dirty = True # ensure anything we touch has import wrappers while self.paths and not self.paths[-1].strip(): self.paths.pop() def save(self): """Write changed .pth file back to disk""" if not self.dirty: return data = '\n'.join(map(self.make_relative,self.paths)) if data: log.debug("Saving %s", self.filename) data = ( "import sys; sys.__plen = len(sys.path)\n" "%s\n" "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)\n" ) % data if os.path.islink(self.filename): os.unlink(self.filename) f = open(self.filename,'wt') f.write(data); f.close() elif os.path.exists(self.filename): log.debug("Deleting empty %s", self.filename) os.unlink(self.filename) self.dirty = False def add(self,dist): """Add `dist` to the distribution map""" if (dist.location not in self.paths and ( dist.location not in self.sitedirs or dist.location == os.getcwd() #account for '.' being in PYTHONPATH )): self.paths.append(dist.location) self.dirty = True Environment.add(self,dist) def remove(self,dist): """Remove `dist` from the distribution map""" while dist.location in self.paths: self.paths.remove(dist.location); self.dirty = True Environment.remove(self,dist) def make_relative(self,path): npath, last = os.path.split(normalize_path(path)) baselen = len(self.basedir) parts = [last] sep = os.altsep=='/' and '/' or os.sep while len(npath)>=baselen: if npath==self.basedir: parts.append(os.curdir) parts.reverse() return sep.join(parts) npath, last = os.path.split(npath) parts.append(last) else: return path def get_script_header(script_text, executable=sys_executable, wininst=False): """Create a #! line, getting options (if any) from script_text""" from distutils.command.build_scripts import first_line_re # first_line_re in Python >=3.1.4 and >=3.2.1 is a bytes pattern. if not isinstance(first_line_re.pattern, str): first_line_re = re.compile(first_line_re.pattern.decode()) first = (script_text+'\n').splitlines()[0] match = first_line_re.match(first) options = '' if match: options = match.group(1) or '' if options: options = ' '+options if wininst: executable = "python.exe" else: executable = nt_quote_arg(executable) hdr = "#!%(executable)s%(options)s\n" % locals() if not isascii(hdr): # Non-ascii path to sys.executable, use -x to prevent warnings if options: if options.strip().startswith('-'): options = ' -x'+options.strip()[1:] # else: punt, we can't do it, let the warning happen anyway else: options = ' -x' executable = fix_jython_executable(executable, options) hdr = "#!%(executable)s%(options)s\n" % locals() return hdr def auto_chmod(func, arg, exc): if func is os.remove and os.name=='nt': chmod(arg, stat.S_IWRITE) return func(arg) exc = sys.exc_info() raise exc[0], (exc[1][0], exc[1][1] + (" %s %s" % (func,arg))) def uncache_zipdir(path): """Ensure that the importer caches dont have stale info for `path`""" from zipimport import _zip_directory_cache as zdc _uncache(path, zdc) _uncache(path, sys.path_importer_cache) def _uncache(path, cache): if path in cache: del cache[path] else: path = normalize_path(path) for p in cache: if normalize_path(p)==path: del cache[p] return def is_python(text, filename=''): "Is this string a valid Python script?" try: compile(text, filename, 'exec') except (SyntaxError, TypeError): return False else: return True def is_sh(executable): """Determine if the specified executable is a .sh (contains a #! line)""" try: fp = open(executable) magic = fp.read(2) fp.close() except (OSError,IOError): return executable return magic == '#!' def nt_quote_arg(arg): """Quote a command line argument according to Windows parsing rules""" result = [] needquote = False nb = 0 needquote = (" " in arg) or ("\t" in arg) if needquote: result.append('"') for c in arg: if c == '\\': nb += 1 elif c == '"': # double preceding backslashes, then add a \" result.append('\\' * (nb*2) + '\\"') nb = 0 else: if nb: result.append('\\' * nb) nb = 0 result.append(c) if nb: result.append('\\' * nb) if needquote: result.append('\\' * nb) # double the trailing backslashes result.append('"') return ''.join(result) def is_python_script(script_text, filename): """Is this text, as a whole, a Python script? (as opposed to shell/bat/etc. """ if filename.endswith('.py') or filename.endswith('.pyw'): return True # extension says it's Python if is_python(script_text, filename): return True # it's syntactically valid Python if script_text.startswith('#!'): # It begins with a '#!' line, so check if 'python' is in it somewhere return 'python' in script_text.splitlines()[0].lower() return False # Not any Python I can recognize try: from os import chmod as _chmod except ImportError: # Jython compatibility def _chmod(*args): pass def chmod(path, mode): log.debug("changing mode of %s to %o", path, mode) try: _chmod(path, mode) except os.error, e: log.debug("chmod failed: %s", e) def fix_jython_executable(executable, options): if sys.platform.startswith('java') and is_sh(executable): # Workaround Jython's sys.executable being a .sh (an invalid # shebang line interpreter) if options: # Can't apply the workaround, leave it broken log.warn("WARNING: Unable to adapt shebang line for Jython," " the following script is NOT executable\n" " see http://bugs.jython.org/issue1112 for" " more information.") else: return '/usr/bin/env %s' % executable return executable def get_script_args(dist, executable=sys_executable, wininst=False): """Yield write_script() argument tuples for a distribution's entrypoints""" spec = str(dist.as_requirement()) header = get_script_header("", executable, wininst) for group in 'console_scripts', 'gui_scripts': for name, ep in dist.get_entry_map(group).items(): script_text = ( "# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" "__requires__ = %(spec)r\n" "import sys\n" "from pkg_resources import load_entry_point\n" "\n" "if __name__ == '__main__':" "\n" " sys.exit(\n" " load_entry_point(%(spec)r, %(group)r, %(name)r)()\n" " )\n" ) % locals() if sys.platform=='win32' or wininst: # On Windows/wininst, add a .py extension and an .exe launcher if group=='gui_scripts': ext, launcher = '-script.pyw', 'gui.exe' old = ['.pyw'] new_header = re.sub('(?i)python.exe','pythonw.exe',header) else: ext, launcher = '-script.py', 'cli.exe' old = ['.py','.pyc','.pyo'] new_header = re.sub('(?i)pythonw.exe','python.exe',header) if is_64bit(): launcher = launcher.replace(".", "-64.") else: launcher = launcher.replace(".", "-32.") if os.path.exists(new_header[2:-1]) or sys.platform!='win32': hdr = new_header else: hdr = header yield (name+ext, hdr+script_text, 't', [name+x for x in old]) yield ( name+'.exe', resource_string('setuptools', launcher), 'b' # write in binary mode ) else: # On other platforms, we assume the right thing to do is to # just write the stub with no extension. yield (name, header+script_text) def rmtree(path, ignore_errors=False, onerror=auto_chmod): """Recursively delete a directory tree. This code is taken from the Python 2.4 version of 'shutil', because the 2.3 version doesn't really work right. """ if ignore_errors: def onerror(*args): pass elif onerror is None: def onerror(*args): raise names = [] try: names = os.listdir(path) except os.error, err: onerror(os.listdir, path, sys.exc_info()) for name in names: fullname = os.path.join(path, name) try: mode = os.lstat(fullname).st_mode except os.error: mode = 0 if stat.S_ISDIR(mode): rmtree(fullname, ignore_errors, onerror) else: try: os.remove(fullname) except os.error, err: onerror(os.remove, fullname, sys.exc_info()) try: os.rmdir(path) except os.error: onerror(os.rmdir, path, sys.exc_info()) def current_umask(): tmp = os.umask(022) os.umask(tmp) return tmp def bootstrap(): # This function is called when setuptools*.egg is run using /bin/sh import setuptools; argv0 = os.path.dirname(setuptools.__path__[0]) sys.argv[0] = argv0; sys.argv.append(argv0); main() def main(argv=None, **kw): from setuptools import setup from setuptools.dist import Distribution import distutils.core USAGE = """\ usage: %(script)s [options] requirement_or_url ... or: %(script)s --help """ def gen_usage (script_name): script = os.path.basename(script_name) return USAGE % vars() def with_ei_usage(f): old_gen_usage = distutils.core.gen_usage try: distutils.core.gen_usage = gen_usage return f() finally: distutils.core.gen_usage = old_gen_usage class DistributionWithoutHelpCommands(Distribution): common_usage = "" def _show_help(self,*args,**kw): with_ei_usage(lambda: Distribution._show_help(self,*args,**kw)) def find_config_files(self): files = Distribution.find_config_files(self) if 'setup.cfg' in files: files.remove('setup.cfg') return files if argv is None: argv = sys.argv[1:] with_ei_usage(lambda: setup( script_args = ['-q','easy_install', '-v']+argv, script_name = sys.argv[0] or 'easy_install', distclass=DistributionWithoutHelpCommands, **kw ) ) 07070100068647000081a4000000000000000000000001513ff56600000fe5000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyc e?Qc@sddlZddlZddlZddlmZddlmZdefdYZgejD]Z e dej krde ^qdej e_dS(iN(tinstall(tDistutilsArgErrorRcBseZdZejddgZejddgZddfddfgZeeZ d Z d Z d Z d Z d ZRS(s7Use easy_install to install the package, w/dependenciessold-and-unmanageablesTry not to use this!s!single-version-externally-manageds5used by system package builders to create 'flat' eggstinstall_egg_infocCstS(N(tTrue(tself((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pytstinstall_scriptscCstS(N(R(R((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyRscCs,tj|d|_d|_d|_dS(N(t_installtinitialize_optionstNonetold_and_unmanageablet!single_version_externally_managedt no_compile(R((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyRs   cCsUtj||jr"t|_n/|jrQ|j rQ|j rQtdqQndS(NsAYou must specify --record or --root when building system packages(Rtfinalize_optionstrootRR trecordR(R((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyR s    cCs5|js|jrtj|Sd|_d|_dS(Nt(RR Rthandle_extra_pathR t path_filet extra_dirs(R((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyR's  cCs|js|jrtj|Stjd}|jjdd}|jj }|dksg|dkrwtj|n |j dS(Nit__name__Rsdistutils.distt run_commands( R R Rtruntsyst _getframet f_globalstgettf_codetco_nametdo_egg_install(Rtcallert caller_modulet caller_name((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyR2s  cCs|jjd}||jddd|jd|j}|jd|_|jjtjd|j d|jj dj g}t j r|jd t j n||_|jdt _ dS( Nt easy_installtargstxRRt.s*.eggt bdist_eggi(t distributiontget_command_classRRtensure_finalizedtalways_copy_fromt package_indextscantglobt run_commandtget_command_objt egg_outputt setuptoolstbootstrap_install_fromtinsertR"RR (RR!tcmdR"((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyRPs$      N(sold-and-unmanageableNsTry not to use this!(s!single-version-externally-managedNs5used by system package builders to create 'flat' eggs(Rt __module__t__doc__Rt user_optionsR tboolean_optionst new_commandstdictt_ncRR RRR(((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyRs      i( R0RR,tdistutils.command.installRRtdistutils.errorsRt sub_commandsR3R:R8(((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyts $e,0707010006864b000081a4000000000000000000000001513ff56600000da4000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyc e?Qc@s6ddlmZddlZdefdYZdS(i(t install_libNRcBsGeZdZdZdZdZdddddZdZRS(s9Don't add compiled flags to filenames of non-Python filescCspg}xc|D][}|jds(q n|jrE|j|dn|jdkr |j|dq q W|S(Ns.pytcito(tendswithtcompiletappendtoptimize(tselft py_filenamestbytecode_filestpy_file((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyt_bytecode_filenamess  cCs6|j|j}|dk r2|j|ndS(N(tbuildtinstalltNonet byte_compile(Rtoutfiles((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pytruns   cCsi}|jj}|r|jdjrxy|D]n}|jd}xV|rtjj|j|}x'dD]}d|tjj||tj|||Sddlm}ddlmgfd}||||S(Ni(tunpack_directory(tlogcsP|kr jd|tSjd|tjj|j||S(Ns/Skipping installation of %s (namespace package)scopying %s -> %s(twarntFalsetinfoRRtdirnameR(tsrctdst(R%RR(sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pytpf;s   (tAssertionErrorR#t _install_libt copy_treetsetuptools.archive_utilR$t distutilsR%( Rtinfiletoutfilet preserve_modetpreserve_timestpreserve_symlinkstlevelR$R,((RRR%sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyR/*s  cCsHtj|}|j}|rDg|D]}||kr(|^q(S|S(N(R.t get_outputsR#(RtoutputsRR"((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyR8Gs  #(t__name__t __module__t__doc__R RR#R/R8(((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyRs   (tdistutils.command.install_libRR.R(((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_lib.pyts 0707010006863e000081ed000000000000000000000001513ff56500002934000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/build_py.pyimport os.path, sys, fnmatch from distutils.command.build_py import build_py as _build_py from distutils.util import convert_path from glob import glob try: from distutils.util import Mixin2to3 as _Mixin2to3 # add support for converting doctests that is missing in 3.1 distutils from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactoringTool(RefactoringTool): def log_error(self, msg, *args, **kw): log.error(msg, *args) def log_message(self, msg, *args): log.info(msg, *args) def log_debug(self, msg, *args): log.debug(msg, *args) class Mixin2to3(_Mixin2to3): def run_2to3(self, files, doctests = False): # See of the distribution option has been set, otherwise check the # setuptools default. if self.distribution.use_2to3 is not True: return if not files: return log.info("Fixing "+" ".join(files)) self.__build_fixer_names() self.__exclude_fixers() if doctests: if setuptools.run_2to3_on_doctests: r = DistutilsRefactoringTool(self.fixer_names) r.refactor(files, write=True, doctests_only=True) else: _Mixin2to3.run_2to3(self, files) def __build_fixer_names(self): if self.fixer_names: return self.fixer_names = [] for p in setuptools.lib2to3_fixer_packages: self.fixer_names.extend(get_fixers_from_package(p)) if self.distribution.use_2to3_fixers is not None: for p in self.distribution.use_2to3_fixers: self.fixer_names.extend(get_fixers_from_package(p)) def __exclude_fixers(self): excluded_fixers = getattr(self, 'exclude_fixers', []) if self.distribution.use_2to3_exclude_fixers is not None: excluded_fixers.extend(self.distribution.use_2to3_exclude_fixers) for fixer_name in excluded_fixers: if fixer_name not in self.fixer_names: log.warn("Excluded fixer %s not found", fixer_name) continue self.fixer_names.remove(fixer_name) except ImportError: class Mixin2to3: def run_2to3(self, files, doctests=True): # Nothing done in 2.x pass class build_py(_build_py, Mixin2to3): """Enhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. """ def finalize_options(self): _build_py.finalize_options(self) self.package_data = self.distribution.package_data self.exclude_package_data = self.distribution.exclude_package_data or {} if 'data_files' in self.__dict__: del self.__dict__['data_files'] self.__updated_files = [] self.__doctests_2to3 = [] def run(self): """Build modules, packages, and copy data files to build directory""" if not self.py_modules and not self.packages: return if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() self.run_2to3(self.__updated_files, False) self.run_2to3(self.__updated_files, True) self.run_2to3(self.__doctests_2to3, True) # Only compile actual .py files, using our base class' idea of what our # output files are. self.byte_compile(_build_py.get_outputs(self, include_bytecode=0)) def __getattr__(self,attr): if attr=='data_files': # lazily compute data files self.data_files = files = self._get_data_files(); return files return _build_py.__getattr__(self,attr) def build_module(self, module, module_file, package): outfile, copied = _build_py.build_module(self, module, module_file, package) if copied: self.__updated_files.append(outfile) return outfile, copied def _get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" self.analyze_manifest() data = [] for package in self.packages or (): # Locate package source directory src_dir = self.get_package_dir(package) # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Length of path to strip from found files plen = len(src_dir)+1 # Strip directory from globbed filenames filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ] data.append( (package, src_dir, build_dir, filenames) ) return data def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" globs = (self.package_data.get('', []) + self.package_data.get(package, [])) files = self.manifest_files.get(package, [])[:] for pattern in globs: # Each pattern has to be converted to a platform-specific path files.extend(glob(os.path.join(src_dir, convert_path(pattern)))) return self.exclude_data_files(package, src_dir, files) def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) srcfile = os.path.join(src_dir, filename) outf, copied = self.copy_file(srcfile, target) srcfile = os.path.abspath(srcfile) if copied and srcfile in self.distribution.convert_2to3_doctests: self.__doctests_2to3.append(outf) def analyze_manifest(self): self.manifest_files = mf = {} if not self.distribution.include_package_data: return src_dirs = {} for package in self.packages or (): # Locate package source directory src_dirs[assert_relative(self.get_package_dir(package))] = package self.run_command('egg_info') ei_cmd = self.get_finalized_command('egg_info') for path in ei_cmd.filelist.files: d,f = os.path.split(assert_relative(path)) prev = None oldf = f while d and d!=prev and d not in src_dirs: prev = d d, df = os.path.split(d) f = os.path.join(df, f) if d in src_dirs: if path.endswith('.py') and f==oldf: continue # it's a module, not data mf.setdefault(src_dirs[d],[]).append(path) def get_data_files(self): pass # kludge 2.4 for lazy computation if sys.version<"2.4": # Python 2.4 already has this code def get_outputs(self, include_bytecode=1): """Return complete list of files copied to the build directory This includes both '.py' files and data files, as well as '.pyc' and '.pyo' files if 'include_bytecode' is true. (This method is needed for the 'install_lib' command to do its job properly, and to generate a correct installation manifest.) """ return _build_py.get_outputs(self, include_bytecode) + [ os.path.join(build_dir, filename) for package, src_dir, build_dir,filenames in self.data_files for filename in filenames ] def check_package(self, package, package_dir): """Check namespace packages' __init__ for declare_namespace""" try: return self.packages_checked[package] except KeyError: pass init_py = _build_py.check_package(self, package, package_dir) self.packages_checked[package] = init_py if not init_py or not self.distribution.namespace_packages: return init_py for pkg in self.distribution.namespace_packages: if pkg==package or pkg.startswith(package+'.'): break else: return init_py f = open(init_py,'rU') if 'declare_namespace' not in f.read(): from distutils import log log.warn( "WARNING: %s is a namespace package, but its __init__.py does\n" "not declare_namespace(); setuptools 0.7 will REQUIRE this!\n" '(See the setuptools manual under "Namespace Packages" for ' "details.)\n", package ) f.close() return init_py def initialize_options(self): self.packages_checked={} _build_py.initialize_options(self) def get_package_dir(self, package): res = _build_py.get_package_dir(self, package) if self.distribution.src_root is not None: return os.path.join(self.distribution.src_root, res) return res def exclude_data_files(self, package, src_dir, files): """Filter filenames for package's data files in 'src_dir'""" globs = (self.exclude_package_data.get('', []) + self.exclude_package_data.get(package, [])) bad = [] for pattern in globs: bad.extend( fnmatch.filter( files, os.path.join(src_dir, convert_path(pattern)) ) ) bad = dict.fromkeys(bad) seen = {} return [ f for f in files if f not in bad and f not in seen and seen.setdefault(f,1) # ditch dupes ] def assert_relative(path): if not os.path.isabs(path): return path from distutils.errors import DistutilsSetupError raise DistutilsSetupError( """Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. """ % path ) 07070100068655000081a4000000000000000000000001513ff5660000235f000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyc e?Qc@sSddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl m Z d d!d"d#d$gZ dZ ddZdZddZddZdZejdejZdZedeejdejfedefedefedefgZdefdYZdS(%i(tsdist(t convert_path(tlogN(tglobs<ts"t"s't's&t&cCs-x&tD]\}}|j||}qW|S(N(tentitiestreplace(tdatatoldtnew((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pytunescape scsfd}|S(Nc3sut|d}|j}|jxIj|D]8}|jd}r_|}nt||Vq5WdS(NtrUi(topentreadtclosetfinditertgrouptjoinpath(tdirnametfilenametfR tmatchtpath(tpostproctpattern(s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pytfinds  ((RRR((RRs^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyt re_finders cCs|s |Stjj||S(N(tosRtjoin(tprefixtsuffix((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyRstccs@x9tjdD](}x|j|D] }|Vq)WqWdS(s%Find all files under revision controlssetuptools.file_findersN(t pkg_resourcestiter_entry_pointstload(Rteptitem((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyt walk_revctrl+sccsxtD]\}}t||}tjj|rxe|||D]Q}tjj|rd|VqDtjj|rDxt|D] }|VqWqDqDWqqWdS(N(tfindersRRRtisfiletisdirt_default_revctrl(RRtfinderR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyR-1sc cst}t|d}xt|jdD]}|j}t|dkr(|\}}|jt|}|dkr|dkrt}q|dkr|r|j Pqq(q(W|j dSx;|j D]-}|j}|rt ||dVqqWdS( s$Find any 'svn:externals' directoriestrtR#itKs svn:externalstVNi( tFalseRtitertreadlinetsplittlenRtinttTrueRt splitlinesR( RRtfoundRtlinetpartstkindtlengthR ((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pytexternals_finder<s$       s%name="([^"]+)"(?![^>]+deleted="true")c cst|d}|j}|j|jdsR|jdsR|jdrxttj|jddD]G}| srt|dkr|dd krqrnt ||d VqrWnY|jd r xGt j |D]#}t |t |j dVqWntjd |dS( NRt10t9t8s iiitdeleteis|D]}tjj|r dSq W|jddj|dS(NR]s README.txts,standard file not found: should have one of s, (sREADMEs README.txt(RRReRHR (RYRoR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyRSs  cCstj|||tjj|d}ttdritjj|ritj||jd|n|j dj |dS(Ns setup.cfgtlinkRM( Rutmake_release_treeRRR thasattrRetunlinkt copy_fileRPtsave_version_info(RYtbase_dirRrtdest((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyR~s ! N(sformats=Ns6formats for source distribution (comma-separated list)(s dist-dir=RLsFdirectory to put the source distribution archive(s) in [default: dist](iii(ii(iii(ii(iii(t__name__t __module__t__doc__tNonet user_optionst negative_optR\Rst_sdist__read_template_hackRwt version_infoRvRSR~(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyR~s$   -   (s<R(s>R(s"R(s'R(s&R(tdistutils.command.sdistRRutdistutils.utilRt distutilsRRtreRwR$RR RRRRR)R-R?tcompiletIRGRJtMR*(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/sdist.pyts(0        0707010006865b000081a4000000000000000000000001513ff56600001998000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.pyc e?Qc@sdZddlTddlmZddlmZddlmZyddlm Z Wn!e k rwddl m Z nXddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZdefd YZdS( s`distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).i(t*(tCommand(tspawn(tlog(tmd5NtuploadcBsceZdZdZdddefdddgZddgZd ZdZdZ dZ RS(supload binary package to PyPIshttp://pypi.python.org/pypis repository=trsurl of repository [default: %s]s show-responses&display full response text from servertsigntsssign files to upload using gpgs identity=tisGPG identity used to sign filescCs:d|_d|_d|_d|_t|_d|_dS(Nti(tusernametpasswordt repositoryt show_responsetFalseRtNonetidentity(tself((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.pytinitialize_options's      cCs)|jr"|j r"tdntjjdr tjjtjdd}tjj|r |j d|t j idd6dd6dd6}|j ||j s|j d d|_ n|js|j d d|_n|js |j d d|_q q n|j s%|j|_ ndS( Ns.Must use --sign for --identity to have meaningtHOMEs.pypircsUsing PyPI login from %sR R R R s server-login(RRtDistutilsOptionErrortostenvironthas_keytpathtjointexiststannouncet ConfigParsertreadR tgetR R tDEFAULT_REPOSITORY(Rtrctconfig((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.pytfinalize_options/s(        cCsR|jjstdnx0|jjD]"\}}}|j|||q(WdS(Ns'No dist file created in earlier command(t distributiont dist_filesRt upload_file(Rtcommandt pyversiontfilename((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload.pytrunFs cCs+|jrSddd|g}|jr=d|jg|dd+nt|d|jnt|d}|j}|jtjj |}d}|d kr|j j rd t j d d }nid d6dd6|j j d6|j jd6||fd6|d6|d6t|jd6} |dkrct j\} } } | rd| | f}qn%|dkrdt j d d }n|| d<|jrtjj |dt|djf| ds"          07070100068652000081ed000000000000000000000001513ff565000002e4000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/saveopts.pyimport distutils, os from setuptools import Command from setuptools.command.setopt import edit_config, option_base class saveopts(option_base): """Save command-line options to a file""" description = "save supplied options to setup.cfg or other config file" def run(self): dist = self.distribution commands = dist.command_options.keys() settings = {} for cmd in commands: if cmd=='saveopts': continue # don't save our own options! for opt,(src,val) in dist.get_option_dict(cmd).items(): if src=="command line": settings.setdefault(cmd,{})[opt] = val edit_config(self.filename, settings, self.dry_run) 07070100068637000081a4000000000000000000000001513ff56600004a56000000b500010002ffffffffffffffff0000006800000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyc e?Qc@sdZddlZddlZddlZddlmZddlmZmZyddl m Z m Z Wn1e k rddl m Z ddl m Z nXddlmZdd lmZdd lmZmZmZdd lmZdd lmZdd lmZdZdZdZdefdYZej dj!Z"dZ#dZ$dZ%ide&6de'6Z(dZ)dZ*dZ+ddddgZ,d d e-d!d"Z.dS(#s6setuptools.command.bdist_egg Build .egg distributionsiN(tCommand(t remove_treetmkpath(tget_python_versiontget_python_lib(R(R(tlog(tDistutilsSetupError(tget_build_platformt Distributiontensure_directory(t EntryPoint(tCodeType(tLibrarycCsEd|kr%tjj|d}n|jdrA|d }n|S(Nt.itmodulei(tostpathtsplitexttendswith(tfilename((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyt strip_modules   c CsOt|d}|jdjdddd|ddd d g|jdS( Ntws sdef __bootstrap__():s- global __bootstrap__, __loader__, __file__s! import sys, pkg_resources, imps: __file__ = pkg_resources.resource_filename(__name__,%r)s3 __loader__ = None; del __bootstrap__, __loader__s& imp.load_dynamic(__name__,__file__)s__bootstrap__()t(topentwritetjointclose(tresourcetpyfiletf((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyt write_stubs  s7__import__("pkg_resources").declare_namespace(__name__)t bdist_eggcBseZdZddddefd d d d d fd!d"gZd ddgZdZdZdZ dZ dZ dZ dZ dZdZdZdZdZRS(#screate an "egg" distributions bdist-dir=tbs1temporary directory for creating the distributions plat-name=tps;platform name to embed in generated filenames (default: %s)sexclude-source-filess+remove all .py files from the generated eggs keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archives dist-dir=tds-directory to put final built distributions ins skip-builds2skip rebuilding everything (for testing/debugging)cCsCd|_d|_d|_d|_d|_d|_d|_dS(Ni(tNonet bdist_dirt plat_namet keep_temptdist_dirt skip_buildt egg_outputtexclude_source_files(tself((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pytinitialize_optionsXs      cCs|jd}|_|j|_|jdkr^|jdj}tjj|d|_n|j dkr|t |_ n|j dd|j dkrt dd|j|jt|jjo|j j}tjj|j|d|_ ndS(Ntegg_infotbdistteggR(s.egg(sdist_dirsdist_dir(tget_finalized_commandtei_cmdR.R%R$t bdist_baseRRRR&Rtset_undefined_optionsR*Rtegg_namet egg_versionRt distributionthas_ext_modulesR((R,R2R3tbasename((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pytfinalize_optionsbs !cCs`|j|jd_tjjtjjt}|jj g}|j_ x|D]}t |t rt |dkrtjj |drtjj|d}tjj|}||ks|j|tjr|t |d|df}qqn|jj j|qVWz1tjd|j|jdddddWd||j_ XdS( Ntinstalliiisinstalling package data to %st install_datatforcetroot(R%R1t install_libRRtnormcasetrealpathRR7t data_filest isinstancettupletlentisabst startswithtseptappendRtinfot call_commandR$(R,t site_packagestoldtitemRAt normalized((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pytdo_install_datas ! !'cCs |jgS(N(R*(R,((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyt get_outputsscKsmx!tD]}|j||jqW|jd|j|jd|j|j||}|j||S(s8Invoke reinitialized command `cmdname` with keyword argsR)tdry_run(tINSTALL_DIRECTORY_ATTRSt setdefaultR%R)RRtreinitialize_commandt run_command(R,tcmdnametkwtdirnametcmd((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyRKs  c Cs|jdtjd|j|jd}|j}d|_|jddd}||_|j\}}g|_ g}xt |D]\}}t j j |\} } t j j|jt| d} |j j| tjd||jstt j j|| n|j| |jt jd ||R$RKtget_ext_outputststubst enumerateRRRRRRIRRRR9treplaceRHtextendtmake_init_filest byte_compileR7RBRPRR]tcopy_metadata_toR RRRtisfiletunlinktwrite_safety_flagtzip_safetexistsR.twarnR+t zap_pyfilest make_zipfileR*Rbt gen_headerR'RtgetattrR(R,tinstcmdtold_rootRZt all_outputst ext_outputst to_compileR!text_nameRtextRt archive_rootR.t script_dirt native_libst libs_file((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pytrunst    "            $    cCstjdxut|jD]d\}}}xR|D]J}|jdr3tjj||}tjd|tj |q3q3WqWdS(Ns+Removing .py files from temporary directorys.pys Deleting %s( RRJtwalk_eggR%RRRRtdebugRn(R,tbasetdirstfilestnameR((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyRss  cCsEt|jdd}|dk r%|Stjdt|j|jS(NRps4zip_safe flag not set; analyzing archive contents...(RvR7R$RRrt analyze_eggR%Rf(R,tsafe((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyRps   c Csg}xt|jD]\}}}||jkr:qnx|D]}|jdrAd|kr|t|jdjtjd}|jj|rt j d|tj j |d}|j st|d}|jt|jn|j|qnPqAqAWg|(qW|S(s%Create missing package __init__ filess.pys __init__.pyiR s#Creating missing __init__.py for %sR(RR%RRERhRRHR7thas_contents_forRRrRRRRRRt NS_PKG_STUBRRI( R,t init_filesRRRRtpkgRR((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyRj s&  &    c Cs!tj|jjpd}|jdijd}|dkrFdS|j sY|jrotd|fnt j d }|j }dj |j}|jd}t jj|j}d t}|jstt jj|jd |jt|jd} | j|| jnd S( NRssetuptools.installationt eggsecutableRsGeggsecutable entry point (%r) cannot have 'extras' or refer to a moduleiR isH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi RRta(R t parse_mapR7t entry_pointstgetR$tattrstextrasRtsystversiont module_nameRRRR9R*tlocalsRRRRYRRR( R,tepmteptpyverRtfullRR9theaderR((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyRu%s*      "  cCstjj|j}tjj|d}xb|jjjD]Q}|j|r:tjj||t |}t ||j ||q:q:WdS(s*Copy metadata (egg info) to the target_dirRN( RRtnormpathR.RR2tfilelistRRGRER t copy_file(R,t target_dirt norm_egg_infotprefixRttarget((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_egg.pyRlNs c Csg}g}id|j6}xtj|jD]\}}}xH|D]@}tjj|djtkrE|j|||qEqEWx3|D]+}|||d|tjj||s@$   H    # / 0707010006864e000081ed000000000000000000000001513ff56500000115000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyfrom distutils.command.register import register as _register class register(_register): __doc__ = _register.__doc__ def run(self): # Make sure that we are using valid current name/version info self.run_command('egg_info') _register.run(self) 07070100068632000081ed000000000000000000000001513ff565000002b1000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/__init__.py__all__ = [ 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 'sdist', 'setopt', 'test', 'upload', 'install_egg_info', 'install_scripts', 'register', 'bdist_wininst', 'upload_docs', ] from setuptools.command import install_scripts import sys if sys.version>='2.5': # In Python 2.5 and above, distutils includes its own upload command __all__.remove('upload') from distutils.command.bdist import bdist if 'egg' not in bdist.format_commands: bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") bdist.format_commands.append('egg') del bdist, sys 0707010006864d000081a4000000000000000000000001513ff56600000ad3000000b500010002ffffffffffffffff0000006e00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyc e?Qc@sbddlmZddlmZmZmZddlZddlm Z defdYZdS(i(tinstall_scripts(t Distributiont PathMetadatatensure_directoryN(tlogRcBs,eZdZdZdZddZRS(s;Do normal script install, plus any egg_info wrapper scriptscCstj|t|_dS(N(t_install_scriptstinitialize_optionstFalsetno_ep(tself((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyR s c Csddlm}ddlm}|jd|jjrItj|n g|_|j r_dS|j d}t |j t |j |j|j|j}|j d}t|d|}t|j ddt}x'||||D]}|j|qWdS( Ni(tget_script_args(tsys_executabletegg_infot build_scriptst executablet bdist_wininstt _is_running(tsetuptools.command.easy_installR R t run_commandt distributiontscriptsRtruntoutfilesRtget_finalized_commandRtegg_baseRR tegg_namet egg_versiontgetattrRt write_script( R R R tei_cmdtdisttbs_cmdRt is_wininsttargs((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyRs$    ttc Gsddlm}m}tjd||jtjj|j|}|j j ||}|j st |t |d|} | j|| j||d|ndS(s1Write an executable file to the scripts directoryi(tchmodt current_umasksInstalling %s script to %stwiN(RR#R$Rtinfot install_dirtostpathtjoinRtappendtdry_runRtopentwritetclose( R t script_nametcontentstmodetignoredR#R$ttargettmasktf((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyR(s     (t__name__t __module__t__doc__RRR(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyRs  ( t!distutils.command.install_scriptsRRt pkg_resourcesRRRR(t distutilsR(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.pyts 07070100068658000081ed000000000000000000000001513ff565000013f6000000b500010002ffffffffffffffff0000006200000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/test.pyfrom setuptools import Command from distutils.errors import DistutilsOptionError import sys from pkg_resources import * from unittest import TestLoader, main class ScanningLoader(TestLoader): def loadTestsFromModule(self, module): """Return a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. """ tests = [] if module.__name__!='setuptools.tests.doctest': # ugh tests.append(TestLoader.loadTestsFromModule(self,module)) if hasattr(module, "additional_tests"): tests.append(module.additional_tests()) if hasattr(module, '__path__'): for file in resource_listdir(module.__name__, ''): if file.endswith('.py') and file!='__init__.py': submodule = module.__name__+'.'+file[:-3] else: if resource_exists( module.__name__, file+'/__init__.py' ): submodule = module.__name__+'.'+file else: continue tests.append(self.loadTestsFromName(submodule)) if len(tests)!=1: return self.suiteClass(tests) else: return tests[0] # don't create a nested suite for only one return class test(Command): """Command to run unit tests after in-place build""" description = "run unit tests after in-place build" user_options = [ ('test-module=','m', "Run 'test_suite' in specified module"), ('test-suite=','s', "Test suite to run (e.g. 'some_module.test_suite')"), ] def initialize_options(self): self.test_suite = None self.test_module = None self.test_loader = None def finalize_options(self): if self.test_suite is None: if self.test_module is None: self.test_suite = self.distribution.test_suite else: self.test_suite = self.test_module+".test_suite" elif self.test_module: raise DistutilsOptionError( "You may specify a module or a suite, but not both" ) self.test_args = [self.test_suite] if self.verbose: self.test_args.insert(0,'--verbose') if self.test_loader is None: self.test_loader = getattr(self.distribution,'test_loader',None) if self.test_loader is None: self.test_loader = "setuptools.command.test:ScanningLoader" def with_project_on_sys_path(self, func): if getattr(self.distribution, 'use_2to3', False): # If we run 2to3 we can not do this inplace: # Ensure metadata is up-to-date self.reinitialize_command('build_py', inplace=0) self.run_command('build_py') bpy_cmd = self.get_finalized_command("build_py") build_path = normalize_path(bpy_cmd.build_lib) # Build extensions self.reinitialize_command('egg_info', egg_base=build_path) self.run_command('egg_info') self.reinitialize_command('build_ext', inplace=0) self.run_command('build_ext') else: # Without 2to3 inplace works fine: self.run_command('egg_info') # Build extensions in-place self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') ei_cmd = self.get_finalized_command("egg_info") old_path = sys.path[:] old_modules = sys.modules.copy() try: sys.path.insert(0, normalize_path(ei_cmd.egg_base)) working_set.__init__() add_activation_listener(lambda dist: dist.activate()) require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version)) func() finally: sys.path[:] = old_path sys.modules.clear() sys.modules.update(old_modules) working_set.__init__() def run(self): if self.distribution.install_requires: self.distribution.fetch_build_eggs(self.distribution.install_requires) if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) if self.test_suite: cmd = ' '.join(self.test_args) if self.dry_run: self.announce('skipping "unittest %s" (dry run)' % cmd) else: self.announce('running "unittest %s"' % cmd) self.with_project_on_sys_path(self.run_tests) def run_tests(self): import unittest loader_ep = EntryPoint.parse("x="+self.test_loader) loader_class = loader_ep.load(require=False) unittest.main( None, None, [unittest.__file__]+self.test_args, testLoader = loader_class() ) 07070100068650000081ed000000000000000000000001513ff565000007e5000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/rotate.pyimport distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N newest files" user_options = [ ('match=', 'm', "patterns to match (required)"), ('dist-dir=', 'd', "directory where the distributions are"), ('keep=', 'k', "number of matching distributions to keep"), ] boolean_options = [] def initialize_options(self): self.match = None self.dist_dir = None self.keep = None def finalize_options(self): if self.match is None: raise DistutilsOptionError( "Must specify one or more (comma-separated) match patterns " "(e.g. '.zip' or '.egg')" ) if self.keep is None: raise DistutilsOptionError("Must specify number of files to keep") try: self.keep = int(self.keep) except ValueError: raise DistutilsOptionError("--keep must be an integer") if isinstance(self.match, basestring): self.match = [ convert_path(p.strip()) for p in self.match.split(',') ] self.set_undefined_options('bdist',('dist_dir', 'dist_dir')) def run(self): self.run_command("egg_info") from glob import glob for pattern in self.match: pattern = self.distribution.get_name()+'*'+pattern files = glob(os.path.join(self.dist_dir,pattern)) files = [(os.path.getmtime(f),f) for f in files] files.sort() files.reverse() log.info("%d file(s) matching %s", len(files), pattern) files = files[self.keep:] for (t,f) in files: log.info("Deleting %s", f) if not self.dry_run: os.unlink(f) 07070100068646000081ed000000000000000000000001513ff56500000fe1000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install.pyimport setuptools, sys, glob from distutils.command.install import install as _install from distutils.errors import DistutilsArgError class install(_install): """Use easy_install to install the package, w/dependencies""" user_options = _install.user_options + [ ('old-and-unmanageable', None, "Try not to use this!"), ('single-version-externally-managed', None, "used by system package builders to create 'flat' eggs"), ] boolean_options = _install.boolean_options + [ 'old-and-unmanageable', 'single-version-externally-managed', ] new_commands = [ ('install_egg_info', lambda self: True), ('install_scripts', lambda self: True), ] _nc = dict(new_commands) def initialize_options(self): _install.initialize_options(self) self.old_and_unmanageable = None self.single_version_externally_managed = None self.no_compile = None # make DISTUTILS_DEBUG work right! def finalize_options(self): _install.finalize_options(self) if self.root: self.single_version_externally_managed = True elif self.single_version_externally_managed: if not self.root and not self.record: raise DistutilsArgError( "You must specify --record or --root when building system" " packages" ) def handle_extra_path(self): if self.root or self.single_version_externally_managed: # explicit backward-compatibility mode, allow extra_path to work return _install.handle_extra_path(self) # Ignore extra_path when installing an egg (or being run by another # command without --root or --single-version-externally-managed self.path_file = None self.extra_dirs = '' def run(self): # Explicit request for old-style install? Just do it if self.old_and_unmanageable or self.single_version_externally_managed: return _install.run(self) # Attempt to detect whether we were called from setup() or by another # command. If we were called by setup(), our caller will be the # 'run_command' method in 'distutils.dist', and *its* caller will be # the 'run_commands' method. If we were called any other way, our # immediate caller *might* be 'run_command', but it won't have been # called by 'run_commands'. This is slightly kludgy, but seems to # work. # caller = sys._getframe(2) caller_module = caller.f_globals.get('__name__','') caller_name = caller.f_code.co_name if caller_module != 'distutils.dist' or caller_name!='run_commands': # We weren't called from the command line or setup(), so we # should run in backward-compatibility mode to support bdist_* # commands. _install.run(self) else: self.do_egg_install() def do_egg_install(self): easy_install = self.distribution.get_command_class('easy_install') cmd = easy_install( self.distribution, args="x", root=self.root, record=self.record, ) cmd.ensure_finalized() # finalize before bdist_egg munges install cmd cmd.always_copy_from = '.' # make sure local-dir eggs get installed # pick up setup-dir .egg files only: no .egg-info cmd.package_index.scan(glob.glob('*.egg')) self.run_command('bdist_egg') args = [self.distribution.get_command_obj('bdist_egg').egg_output] if setuptools.bootstrap_install_from: # Bootstrap self-installation of setuptools args.insert(0, setuptools.bootstrap_install_from) cmd.args = args cmd.run() setuptools.bootstrap_install_from = None # XXX Python 3.1 doesn't see _nc if this is inside the class install.sub_commands = [ cmd for cmd in _install.sub_commands if cmd[0] not in install._nc ] + install.new_commands # 07070100068653000081a4000000000000000000000001513ff56500000559000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/saveopts.pyc e?Qc@sXddlZddlZddlmZddlmZmZdefdYZdS(iN(tCommand(t edit_configt option_basetsaveoptscBseZdZdZdZRS(s#Save command-line options to a files7save supplied options to setup.cfg or other config filecCs|j}|jj}i}xq|D]i}|dkr=q%nxN|j|jD]7\}\}}|dkrS||j|i|s07070100068641000081a4000000000000000000000001513ff566000015cf000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyc e?Qc@sddlmZddlmZmZddlmZmZmZddl m Z ddl m Z m Z ddlZddlZddlZdefdYZdS( i(t easy_install(t convert_patht subst_vars(t Distributiont PathMetadatatnormalize_path(tlog(tDistutilsErrortDistutilsOptionErrorNtdevelopcBsseZdZdZejd dgZejdgZeZ dZ dZ d Z d Z d Zd ZRS(sSet up package for developments%install package in 'development mode't uninstalltusUninstall this source packages egg-path=s-Set the path to be used in the .egg-link filecCs7|jrt|_|jn |j|jdS(N(R tTruet multi_versiontuninstall_linktinstall_for_developmenttwarn_deprecated_options(tself((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pytruns     cCs5d|_d|_tj|d|_d|_dS(Nt.(tNoneR tegg_pathRtinitialize_optionst setup_pathtalways_copy_from(R((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyRs     cCs|jd}|jr7td|j|jfn|jg|_tj||j|j |j j t j dt jj|j|jd|_|j|_|jdkrt jj|j|_nt|j}tt jj|j|j|kr!td|nt|t|t jj|jd|j|_|jjt jd}|t jkrd|jdd }n||_tt jj|j|j|}|tt jkrtd |tt jndS( Ntegg_infos-Please rename %r to %r before using 'develop's*.eggs .egg-linksA--egg-path must be a relative path from the install directory to t project_namet/s../isGCan't get a consistent path to setup script from installation directory( tget_finalized_commandtbroken_egg_infoRRtegg_nametargsRtfinalize_optionstexpand_basedirst expand_dirst package_indextscantglobtostpathtjoint install_dirtegg_linktegg_baseRRtabspathRRRRtdisttreplacetseptcurdirtcountR(Rteittargettp((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyR 's@    " '  $cCs|jd|jddd|jd|jtjr\|jtjdt_ntjd|j |j |j st |j d}|j |jd|j|jn|jd|j|j dS(NRt build_exttinplaceisCreating %s (link to %s)tws (t run_commandtreinitialize_commandtinstall_site_pyt setuptoolstbootstrap_install_fromRRRtinfoR*R+tdry_runtopentwriteRRtclosetprocess_distributionR-tno_deps(Rtf((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyRVs       cCstjj|jrtjd|j|jgt|jD]}|j^q>}||j g|j |j gfkrtj d|dS|j stj |jqn|j s|j|jn|jjrtj dndS(NsRemoving %s (link to %s)s$Link points to %s: uninstall aborteds5Note: you must uninstall or replace scripts manually!(R&R'texistsR*RR=R+R?trstripRRtwarnR>tunlinkt update_pthR-t distributiontscripts(Rtlinetcontents((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyRls($   cCs||jk rtj||S|j|x|jjp>gD]k}tjjt |}tjj |}t |d}|j }|j |j||||q?WdS(NtrU(R-Rtinstall_egg_scriptstinstall_wrapper_scriptsRJRKR&R'R,RtbasenameR?treadRAtinstall_script(RR-t script_namet script_pathRDt script_text((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyRO{s   (s uninstallR sUninstall this source packageN(s egg-path=Ns-Set the path to be used in the .egg-link file(t__name__t __module__t__doc__t descriptionRt user_optionsRtboolean_optionstFalsetcommand_consumes_argumentsRRR RRRO(((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyR s   /  (tsetuptools.command.easy_installRtdistutils.utilRRt pkg_resourcesRRRt distutilsRtdistutils.errorsRRR&R;R%R (((s`/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyts $07070100068643000081a4000000000000000000000001513ff56600010b6b000000b500010002ffffffffffffffff0000006b00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z m Z ddlmZddlmZmZddlmZddlmZmZdd lmZmZdd lmZmZmZmZdd lm Z m!Z!dd l"m#Z#dd l$m%Z%ddl&m'Z'ddl&m(Z(ddl"m)Z)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:ej;j<ej=Z>ddddddgZ?ddl@Z@ejAdk o;e@jBZCddlDZDdZEdZFejGdfkrdZHdZIndZHdZIde fd YZJd!ZKd"ZLd#ZMd$ZNd%ZOde2fd&YZPe>eQd'ZRd(ZSd)ZTd*ZUd+d,ZVd-ZWd.ZXd/ZYydd0lmZZ[Wne\k rod1Z[nXd2ZZd3Z]e>eQd4Z^eQeSd5Z_d6Z`d7Zaebd8ZcdS(9sEasy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ http://packages.python.org/distribute/easy_install.html iN(tglob(tCommandt_dont_write_bytecode(t run_setup(tlogtdir_util(t get_platform(t convert_patht subst_vars(tget_python_libtget_config_vars(tDistutilsArgErrortDistutilsOptionErrortDistutilsErrortDistutilsPlatformError(tINSTALL_SCHEMESt SCHEME_KEYS(tsetopt(tunpack_archive(t PackageIndex(t URL_SCHEME(t bdist_eggtegg_info(t yield_linestnormalize_pathtresource_stringtensure_directorytget_distributiontfind_distributionst Environmentt Requirementt Distributiont PathMetadatat EggMetadatat WorkingSettDistributionNotFoundtVersionConflictt DEVELOP_DISTtsamefilet easy_installtPthDistributionstextract_wininst_cfgtmaintget_exe_prefixess2.6cCstjddkS(NtPi(tstructtcalcsize(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytis_64bit7scCsttjdrItjj|rItjj|rItjj||Stjjtjj|tjjtjj|kS(NR&(thasattrtostpathtexistsR&tnormpathtnormcase(tp1tp2((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR&:s $icCs|S(N((ts((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt _to_asciiEscCs.yt|dtSWntk r)tSXdS(Ntascii(tunicodetTruet UnicodeErrortFalse(R8((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytisasciiGs   cCs |jdS(NR:(tencode(R8((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR9NscCs.y|jdtSWntk r)tSXdS(NR:(R@R<R=R>(R8((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR?Ps   cBseZdZdZeZdzd{d|d}d~ddddddddddddddddddgZdddd ddd"d1d4d:d=g Ze rej dAdydBe j fej dAnidd+6Z eZdCZdDZdEZdFZdGZdHZdIZdJZdKZdLZdMZdNZdOZdPZdQZdRZe dSZ!e dTZ"dUZ#edVZ$dWZ%dXZ&dYZ'dydZZ(d[dd\Z)d]Z*d^Z+d_Z,d`Z-daZ.dbZ/dcZ0dddeZ1dfZ2dgZ3dhZ4diZ5djZ6dkZ7dlZ8dmZ9dnZ:doZ;dpZ<e=dqe=drdsdtduZ>e=drdvdtdwZ?dxZ@RS(s'Manage a download/build/install processs Find/get/install Python packagessprefix=sinstallation prefixszip-oktzsinstall package as a zipfiles multi-versiontms%make apps have to require() a versiontupgradetUs1force upgrade (searches PyPI for latest versions)s install-dir=tdsinstall package to DIRs script-dir=R8sinstall scripts to DIRsexclude-scriptstxsDon't install scriptss always-copytas'Copy all needed packages to install dirs index-url=tis base URL of Python Package Indexs find-links=tfs(additional URL(s) to search for packagessdelete-conflictingtDs no longer needed; don't use thissignore-conflicts-at-my-risksbuild-directory=tbs/download/extract/build in DIR; keep the resultss optimize=tOslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]srecord=s3filename in which to record list of installed filess always-unziptZs*don't install as a zipfile, no matter whats site-dirs=tSs)list of directories where .pth files workteditabletes+Install specified packages in editable formsno-depstNsdon't install dependenciess allow-hosts=tHs$pattern(s) that hostnames must matchslocal-snapshots-oktls(allow building eggs from local checkoutstversions"print version information and exits no-find-linkss9Don't load find-links defined in packages being installedtusers!install in user site-package '%s'cCstr0tjjt}|jtj|_n d|_d|_ |_ d|_ |_ |_d|_d|_d|_d|_d|_|_d|_|_|_d|_|_|_d|_|_|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&trKtj'|_(tj|_)nd|_(d|_)d|_*d|_+d|_,|_-d|_.d|_/d|_0i|_1t2|_3d|_4|j5j6|_6|j5j7||j5j8ddS(NiR'(9t HAS_USER_SITER1R2tabspatht__file__t startswithtsitet USER_SITERUtNonetzip_oktlocal_snapshots_okt install_dirt script_dirtexclude_scriptst index_urlt find_linkstbuild_directorytargstoptimizetrecordRCt always_copyt multi_versionROtno_depst allow_hoststroottprefixt no_reportRTtinstall_purelibtinstall_platlibtinstall_headerst install_libtinstall_scriptst install_datat install_basetinstall_platbaset USER_BASEtinstall_userbasetinstall_usersitet no_find_linkst package_indextpth_filetalways_copy_fromtdelete_conflictingtignore_conflicts_at_my_riskt site_dirstinstalled_projectsR>tsitepy_installedt_dry_runt distributiontverboset_set_command_optionstget_option_dict(tselftwhereami((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytinitialize_optionssP                          cCsx|D]}tjj|s1tjj|rtjd||jstjj|r|tjj| r|t|qtj |qqqWdS(Ns Deleting %s( R1R2R3tislinkRtinfotdry_runtisdirtrmtreetunlink(Rtblockerstfilename((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytdelete_blockerss $ % c Cs|jr(dtdjGHtjntjjd}tdd\}}i |jjd6|jjd6|jj d6|d 6|dd !d 6|d|d d 6|d6|d6|d6|d6t tddd6|_ t r |j |j d<|j|j d|j9n|jdd/t:|j?t@s=y>t@|j?|_?d|j?ko d knstAnWq=tAk r9t-d(q=Xn|jBr^|jCr^t-d)n|j/r|jD rtEd*n|jFstEd+ng|_GdS(0Ns distribute %st distributeiRmt exec_prefixt dist_namet dist_versiont dist_fullnamet py_versionitpy_version_shortitpy_version_nodott sys_prefixtsys_exec_prefixtabiflagsttuserbasetusersites$User base directory is not specifiedtposixt unix_usert_userR_R`RdRRrRstinstallRgt,s"%s (in --site-dirs) does not exists$ (in --site-dirs) is not on sys.pathshttp://pypi.python.org/simplet*t search_paththostsRfs--optimize must be 0, 1, or 2sVCan't use both --delete-conflicting and --ignore-conflicts-at-my-risk at the same times9Must specify a build directory (-b) when using --editables:No urls, filenames, or requirements specified (see --help)(s install_dirs install_dir(s install_dirs script_dir(srecordsrecord(soptimizesoptimize(HRTRtsystexittsplitR Rtget_namet get_versiont get_fullnametgetattrt config_varsRVRxRyRUtcreate_home_pathR\RRuRvR1tnamet select_schemetexpand_basedirst expand_dirst_expandR`R_RzR>tset_undefined_optionsRoRstmapRR2t get_site_dirst all_site_dirsRt expandusertstripRRtwarnR tappendROtcheck_site_dirRbt shadow_pathtinsertRkR{t create_indexRt local_indexRct isinstancet basestringR^tscan_egg_linkstadd_find_linksRftintt ValueErrorR~RRdR Retoutputs( RRRmRR4R8RREt path_itemR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytfinalize_optionss           7   . !         cCsx|D]y}t||}|dk rtjdksFtjdkr[tjj|}nt||j}t|||qqWdS(NRtnt( RR\R1RR2RRRtsetattr(Rtattrstattrtval((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt _expand_attrsMs  cCs|jdddgdS(sNCalls `os.path.expanduser` on install_base, install_platbase and root.RuRvRlN(R(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRVscCs#|jddddddgdS(s+Calls `os.path.expanduser` on install dirs.RoRpRrRqRsRtN(R(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR[s cCs|j|jjkr(tj|jnzx%|jD]}|j||j q5W|jr|j}|j rt |j }x/t t |D]}|||||( RRR|tok_filet ok_existsRRIRtbasenametaltR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRsP    $   cCsg|j rV|jdrVx:|jdD]&}|j|||jd|q)Wn|j|dS(s=Write all the scripts for `dist`, unless scripts are excludedtscriptssscripts/N(Ratmetadata_isdirtmetadata_listdirtinstall_scriptt get_metadatatinstall_wrapper_scripts(Rtdistt script_name((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytinstall_egg_scripts s cCs|tjj|rhxctj|D]?\}}}x-|D]%}|jjtjj||q8Wq"Wn|jj|dS(N(R1R2RtwalkRRR(RR2tbasetdirstfilesR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt add_outputs  *cCs#|jrtd|fndS(NsjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).(ROR (RR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt not_editables cCsW|js dStjjtjj|j|jrStd|j|jfndS(Ns2%r already exists in %s; can't do a checkout there(ROR1R2R3RRdtkeyR (RR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytcheck_editable#s  'cCstjdd}d}|js.|jnzYt|tst|r|j||j j ||}|j d|||t St jj|r|j||j d|||t St|}n|j||j j|||j|j|j |j}|dkrDd|}|jr5|d7}nt|nB|jtkrm|j|||d|S|j ||j||SWdt jj|rt|nXdS(NRms easy_install-s+Could not find suitable distribution for %rs2 (--always-copy skips system and development eggs)tUsing(ttempfiletmkdtempR\ROtinstall_site_pyRRRRR{tdownloadt install_itemR<R1R2R3tparse_requirement_argRtfetch_distributionRCRhRR t precedenceR%tprocess_distributiontlocationR(RRtdepsttmpdirRR R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR'2s:           c Cs|p |j}|p*tjj||k}|p@|jd }|p||jdk o|tjjt|t|jk}|r| rx4|j|j D]}|j |krPqqWt }nt j dtjj||r!|j|||}xY|D]}|j|||qWn5|j|j|g}|j||d|d|dk rx!|D]}||kri|SqiWndS(Ns.eggs Processing %siR(RhR1R2RtendswithR}R\RRt project_nameR!R<RRRt install_eggsR tcheck_conflictstegg_distribution(RRRR#R"tinstall_neededR tdists((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR\s.      cCsUt|}xDtD]<}d|}t||dkrt||||qqWdS(s=Sets the install directories by applying the install schemes.tinstall_N(RRRR\R(RRtschemeRtattrname((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRs    c Gs$|j||jj||jj||jsF|j|n||j|jR#R?t setup_scripttsetups((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR&s4"  cCs[tjj|r3t|tjj|d}nttj|}tj |d|S(NsEGG-INFOtmetadata( R1R2RR RR!t zipimportt zipimporterRt from_filename(Rtegg_pathRb((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR(9s!cCstjj|jtjj|}tjj|}|jsLt|n|j|}|j |t ||stjj |rtjj | rt j|d|jn2tjj|r|jtj|fd|nt|tjj |r8|j|r%tjd}}qtjd}}na|j|rg|j||jd}}n2|j|rtjd}}ntjd}}|j|||f|dtjj|tjj|fn|j||j|S(NRs Removing tMovingtCopyingt Extractings %s to %s(R1R2RR_RRWRRR(R'R&RRRt remove_treeR3RRtuncache_zipdirRYR<R=tcopytreeR:tmkpathtunpack_and_compiletcopy2RR(RRfR#t destinationR RIRB((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRZ@s6$   %   ) cCst|}|dkr+td|ntdd|jddd|jdddt}tjj||j d}|_ |d}tjj|d }tjj|d }t |t |||_ |j||tjj|s}t|d } | jd xU|jdD]D\} } | d kr(| jd| jddj| fq(q(W| jntjj|d} |jgt|D]} tjj| | d^qtj||d|jd|j|j||S(Ns(%s is not a valid distutils Windows .exeR%RbRRTtplatforms.eggs.tmpsEGG-INFOsPKG-INFORsMetadata-Version: 1.0 ttarget_versions%s: %s t_t-RiRR(R)R\R RRRR1R2Rtegg_nameR!RR t _providert exe_to_eggR3RRtitemsRGttitleRRRCRt make_zipfileRRRZ(RR>R#tcfgR Rftegg_tmpRtpkg_infRItktvR`Re((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR[bs6   &    0 3c st|ggifd}t||g}xD]}|jjdrV|jd}|d}tj|dd|dR|RtstubstresRtresourcetpyfileRttxtRI((RRRR|Rse/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRws4       !cCs|Sddlm}m}ddlm}g}tj|jd}idd6dd6}x$|D]\}} } d||=%(version)s") # this version or higher s Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) R( RiRnR_RRRR2R!R%RTRP( RtreqR twhatRtegglocRRTR5((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR0s     cCs&tjj|}tj}dtS(Ns" Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. (R1R2RRRRP(RRR`Rtpython((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR^$s cCstjjdttjjdtt|}|jdkrid|jd}|jdd|n"|jdkr|jddn|jr|jdd nt j d |t |dd j |yt ||Wn-tk r}td |jdfnXdS( Nsdistutils.command.bdist_eggsdistutils.command.egg_infoiRiiRts-qs-ns Running %s %st sSetup script exited with %s(Rtmodulest setdefaultRRtlistRRRRRRRRt SystemExitR Re(RR`R?ReR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR1s   $c Csddg}tjdddtjj|}z|jtjj||j||j|||t|g}g}x?|D]7}x.||D]"}|j|j |j |qWqW| r|j rt j d|n|SWdt|t j|jXdS(NRs --dist-dirRms egg-dist-tmp-tdirs+No eggs found in %s (setup script problem?)(RRR1R2Rt_set_fetcher_optionsRRRRZR!RRRRRR( RR`R?Retdist_dirtall_eggsteggsRR ((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR_Es$    $   c Cs|jjdj}d }i}xF|jD]8\}}||krOq1n|d||jdd R'RRR R:RBR R RDR&R(RZR[RwR'RR0R^RR_RR.R]RnRRRRRRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR'Ws     5     * ) ,    * & .    )  " ) 1 # )     #    ) '   cCstdtjjddjtj}tjg}tj tjkr[|j tj nx,|D]$}|rbtj dkr|j tj j |ddn|tjdkr|jtj j |dd tjd dtj j |dd gn%|j|tj j |ddgtj d krd |krtjjd}|r|j tj j |ddtjd dqqqqbqbWx6dD].}t|}||kr|j |qqWtr|j tjntt|}|S(NRRtos2emxtriscostLibs site-packagesRtlibRis site-pythontdarwinsPython.frameworktHOMEtLibrarytPythonii(sos2emxsriscos(ii(RR\R1RRRRRRmRRRqR2RtseptextendRTR RVRZR[RR(tsitedirsRRmRt plat_specifictsite_lib((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRSsD*  "      ccs^i}xQ|D]I}t|}||kr1q nd||RItendrect prependedR-RRttagtcfglentbmlenR{tpartt null_bytetconfig((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR)s:  $$   c Csdddddg}tj|}zSxL|jD]>}|j}|jd}t|d kr|d d kr|d jd r|jddj|d dfPqnt|d ks4|jd rq4n|jdrq4n|dj dkr4xkt |j |D]Q}|j j dd}|jds|jd|d|fdfqqWq4q4WWd|jXg|D]\}}|j|f^q}|j|j|S(s4Get exe->egg path translations for a given .exe filesPURELIB/RsPLATLIB/pywin32_system32sPLATLIB/sSCRIPTS/sEGG-INFO/scripts/sDATA/LIB/site-packagesRiisPKG-INFOis .egg-infois EGG-INFO/s.pths -nspkg.pthtPURELIBtPLATLIBs\Rs%s/%s/N(sPURELIB/R(sPLATLIB/pywin32_system32R(sPLATLIB/R(sSCRIPTS/sEGG-INFO/scripts/(sDATA/LIB/site-packagesR(sPURELIBsPLATLIB(RtZipFiletinfolistRRRR$RRtupperRRRRGRYRRRtsorttreverse( t exe_filenameRRARRRtpthRFty((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR+s6  "#"3 + cCs<ytj|SWn$tk r7td|fnXdS(Ns1Not a URL, existing file, or requirement spec: %r(RRRR (R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRs  cBsMeZdZeZddZdZdZdZdZ dZ RS(s)A .pth file with Distribution paths in itcCs||_tt||_ttjj|j|_|jt j |gddx0t |j D]}t|jt|tqiWdS(N(RRRRR1R2Rtbasedirt_loadRt__init__R\RRR/RR<(RRRR2((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR s  cCsg|_t}tj|j}tjj|jr3t |jd}x|D]}|j drpt }qOn|j }|jj ||j sO|jj drqOnttjj|j|}|jdRRRR1R2R\RRRYR<RRRRRRR3tpoptdirtyR(Rt saw_importRRIRR2((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRs2   "&     cCs|js dSdjt|j|j}|rtjd|jd|}tj j |jrvtj |jnt |jd}|j ||jn;tj j|jrtjd|jtj |jnt|_dS(s$Write changed .pth file back to diskNs s Saving %ssimport sys; sys.__plen = len(sys.path) %s 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) RsDeleting empty %s(RRRRRRRRR1R2RRRRRR3R>(RtdataRI((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR3s   cCsl|j|jkrX|j|jks9|jtjkrX|jj|jt|_ntj ||dS(s"Add `dist` to the distribution mapN( R!RRR1tgetcwdRR<RRR/(RR ((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR/Os  cCsIx2|j|jkr4|jj|jt|_qWtj||dS(s'Remove `dist` from the distribution mapN(R!RRR<RR(RR ((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRYs cCstjjt|\}}t|j}|g}tjdkrKdpQtj}xut||kr||jkr|jtj |j |j |Stjj|\}}|j|qWW|SdS(NR( R1R2RRRRtaltsepRRtcurdirR R(RR2tnpathtlasttbaselenRR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR`s   (( RRRR>RRRRR/RR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR(s    cCs)ddlm}t|jts=tj|jj}n|djd}|j |}d}|r|j dp~d}|rd|}qn|rd}n t |}d t }t |s |r|jjd rd |jd}qq d }nt||}d t }|S( s;Create a #! line, getting options (if any) from script_texti(t first_line_res iRiRs python.exes#!%(executable)s%(options)s Rts -x(tdistutils.command.build_scriptsRRtpatternRMtretcompileRFt splitlinestmatchtgroupt nt_quote_argRPR?RRYtfix_jython_executable(RQRtwininstRtfirstR%toptionsthdr((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyROos,      cCsy|tjkr8tjdkr8t|tj||Stj}|d|dd|ddd||ffdS(NRiis %s %s(R1RRRVRtS_IWRITERR(tfunctargtexc((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt auto_chmods   cCs1ddlm}t||t|tjdS(s?Ensure that the importer caches dont have stale info for `path`i(t_zip_directory_cacheN(RcR2t_uncacheRtpath_importer_cache(R2tzdc((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRks cCsT||kr||=n:t|}x+|D]#}t||kr)||=dSq)WdS(N(R(R2tcachetp((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR3s    scCs7yt||dWnttfk r.tSXtSdS(s%Is this string a valid Python script?texecN(R#t SyntaxErrort TypeErrorR>R<(ttextR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt is_pythons cCsNy)t|}|jd}|jWnttfk rC|SX|dkS(sCDetermine if the specified executable is a .sh (contains a #! line)is#!(RRRRR(Rtfptmagic((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytis_shs cCsg}t}d}d|kp'd|k}|r@|jdnx|D]z}|dkrf|d7}qG|dkr|jd|ddd}qG|r|jd|d}n|j|qGW|r|jd|n|r|jd||jdnd j|S( s@Quote a command line argument according to Windows parsing rulesiRs t"s\iis\"R(R>RR(R/tresultt needquotetnbtc((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR's,      cCsb|jds|jdr"tSt||r5tS|jdr^d|jdjkStS(sMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. s.pys.pyws#!Ri(R$R<R<RYR$RR>(RQR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRNs(RVcGsdS(N((Re((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt_chmodscCsQtjd||yt||Wn&tjk rL}tjd|nXdS(Nschanging mode of %s to %oschmod failed: %s(RRRER1terror(R2RWRP((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRVs cCsCtjjdr?t|r?|r4tjdq?d|Sn|S(NtjavasWARNING: Unable to adapt shebang line for Jython, the following script is NOT executable see http://bugs.jython.org/issue1112 for more information.s/usr/bin/env %s(RRqRYR?RR(RR+((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR(s  c cst|j}td||}xdD]{}xr|j|jD][\}}dt}tjdksu|r|dkrd\} } dg} tj d d |} n0d\} } d ddg} tj dd|} t r| j dd} n| j dd} t j j| dd!s6tjdkr?| } n|} || | |dg| D]}||^q]fV|dtd| dfVqG|||fVqGWq+WdS(sEYield write_script() argument tuples for a distribution's entrypointsRtconsole_scriptst gui_scriptss# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) twin32s -script.pywsgui.exes.pyws(?i)python.exes pythonw.exes -script.pyscli.exes.pys.pycs.pyos(?i)pythonw.exes python.exet.s-64.s-32.iiRTs.exeRERKN(sconsole_scriptss gui_scripts(s -script.pywsgui.exe(s -script.pyscli.exe(RMR3ROt get_entry_mapRxRPRRqR"tsubR/RGR1R2R3R(R RR)RtheaderR&RtepRQRtlauncherRt new_headerR,RF((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRC s0 "      ( 0 cCsx|rd}n|dkr*d}ng}ytj|}Wn/tjk rt}|tj|tjnXx|D]}tjj||}ytj|j }Wntjk rd}nXt j |rt |||q|ytj |Wq|tjk r.}|tj |tjq|Xq|Wytj|Wn-tjk rs|tj|tjnXdS(sRecursively delete a directory tree. This code is taken from the Python 2.4 version of 'shutil', because the 2.3 version doesn't really work right. cWsdS(N((Re((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pytonerror>scWsdS(N((Re((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRRAsiN(R\R1R;RFRRR2Rtlstattst_modeRtS_ISDIRRRtrmdir(R2t ignore_errorsRRRterrRtfullnameRW((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR7s2     !cCs tjd}tj||S(Ni(R1tumask(ttmp((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRUZs cCsMddl}tjj|jd}|tjd~s((RReRj(RgR(RReRjse/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRi}scs/j|}d|kr+|jdn|S(Ns setup.cfg(tfind_config_filesR(RR(R(se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRls (RRt common_usageRiRl((RRg(se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRhzsic s6ddddgdtjdp)ddS(Nt script_argss-qR's-vR it distclass(RR]((R`RjRhR](se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyRks(RER`tsetuptools.distRtdistutils.coreR\RR](R]Rj(( RdRR`R]RjRcRRgRhse/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyR*ds  (dRRR1RcR<RRR"RRRRERRtsetuptools.sandboxRRRRRRRRtdistutils.sysconfigR R tdistutils.errorsR R R Rtdistutils.command.installRRtsetuptools.commandRtsetuptools.archive_utilRtsetuptools.package_indexRRRRt pkg_resourcesRRRRRRRRRR R!R"R#R$R%R2R4Rtsys_executablet__all__RZRTtENABLE_USER_SITERVR-R/R&RR9R?R'RRR)R+RR(R>ROR1RkR3R<R?R'RNRVRERR(RCRRUR_R\R*(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.pyt s         "d           - ) 5 " g   )     .#  07070100068638000081ed000000000000000000000001513ff565000007e9000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.py# This is just a kludge so that bdist_rpm doesn't guess wrong about the # distribution name and version, if the egg_info command is going to alter # them, another kludge to allow you to build old-style non-egg RPMs, and # finally, a kludge to track .rpm files for uploading when run on Python <2.5. from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm import sys, os class bdist_rpm(_bdist_rpm): def initialize_options(self): _bdist_rpm.initialize_options(self) self.no_egg = None if sys.version<"2.5": # Track for uploading any .rpm file(s) moved to self.dist_dir def move_file(self, src, dst, level=1): _bdist_rpm.move_file(self, src, dst, level) if dst==self.dist_dir and src.endswith('.rpm'): getattr(self.distribution,'dist_files',[]).append( ('bdist_rpm', src.endswith('.src.rpm') and 'any' or sys.version[:3], os.path.join(dst, os.path.basename(src))) ) def run(self): self.run_command('egg_info') # ensure distro name is up-to-date _bdist_rpm.run(self) def _make_spec_file(self): version = self.distribution.get_version() rpmversion = version.replace('-','_') spec = _bdist_rpm._make_spec_file(self) line23 = '%define version '+version line24 = '%define version '+rpmversion spec = [ line.replace( "Source0: %{name}-%{version}.tar", "Source0: %{name}-%{unmangled_version}.tar" ).replace( "setup.py install ", "setup.py install --single-version-externally-managed " ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" ).replace(line23,line24) for line in spec ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) return spec 07070100068633000081a4000000000000000000000001513ff565000003ba000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/__init__.pyc e?Qc@sdddddddddd d d d d dddddddgZddlmZddlZejdkrejdnddlmZdejkrdej ds  0707010006863a000081ed000000000000000000000001513ff5650000060c000000b500010002ffffffffffffffff0000006b00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyfrom distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst import os, sys class bdist_wininst(_bdist_wininst): def create_exe(self, arcname, fullname, bitmap=None): _bdist_wininst.create_exe(self, arcname, fullname, bitmap) dist_files = getattr(self.distribution, 'dist_files', []) if self.target_version: installer_name = os.path.join(self.dist_dir, "%s.win32-py%s.exe" % (fullname, self.target_version)) pyversion = self.target_version # fix 2.5 bdist_wininst ignoring --target-version spec bad = ('bdist_wininst','any',installer_name) if bad in dist_files: dist_files.remove(bad) else: installer_name = os.path.join(self.dist_dir, "%s.win32.exe" % fullname) pyversion = 'any' good = ('bdist_wininst', pyversion, installer_name) if good not in dist_files: dist_files.append(good) def reinitialize_command (self, command, reinit_subcommands=0): cmd = self.distribution.reinitialize_command( command, reinit_subcommands) if command in ('install', 'install_lib'): cmd.install_lib = None # work around distutils bug return cmd def run(self): self._is_running = True try: _bdist_wininst.run(self) finally: self._is_running = False 0707010006865d000081a4000000000000000000000001513ff56500001a4e000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z yddl mZWn!ek rddlmZnXejdkZyeWnek reZnXdZdefd YZdS( ssupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's packages.python.org). iN(tlog(tDistutilsOptionError(tuploadt3cCs$t|ts|jdS|SdS(s^Return bytes by either encoding the argument as ASCII or simply return the argument as-is.tasciiN(t isinstancetbytestencode(t str_or_bytes((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pytb s t upload_docscBsceZdZdddejfddgZejZdZd Z d Z d Z d Z RS(sUpload documentation to PyPIs repository=trsurl of repository [default: %s]s show-responses&display full response text from servers upload-dir=sdirectory to uploadcCstj|d|_dS(N(Rtinitialize_optionstNonet upload_dir(tself((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyR 6s cCs~tj||jdkrY|jd}tjj|jd|_|j |jn|j d|j d|jdS(NtbuildtdocsRsUsing upload directory %s( Rtfinalize_optionsRR tget_finalized_commandtostpathtjoint build_basetmkpathtensure_dirnametannounce(RR((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyR:s  c Cs|jjj}tj}tjj|d|}tj |d}xtj |j D]\}}}||j kr| rt d|j nxj|D]b}tjj||}|t |j jtjj} tjj| |} |j|| qWq\W|j|S(Ns%s.ziptws'no files found in upload directory '%s'(t distributiontmetadatatget_namettempfiletmkdtempRRRtzipfiletZipFiletwalkRRtlentlstriptseptwritetclose( Rtnamettmp_dirttmp_filetzip_filetroottdirstfilestfulltrelativetdest((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pytcreate_zipfileCs  " " cCs|j}|j|dS(N(R3t upload_file(RR,((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pytrunUs cCs}t|dj}|jj}idd6|jd6tjj||fd6}|jd|j }t rt j |j d}td}nt j|}d}||j7}td }td |} | td } g} x|jD] \} } t| tgkr)| g} nx| D]}t|tkritd |d }|d}n td}| j| | jtd| | j|| jtd| jt||r0|dtdkr0| jtdq0q0WqW| j| | jtdtdj| } |jd|jtjtj|j\}}}}}}| r| r| st|dkrtj|}n.|dkrtj|}ntd|d}tj}yu|j |j!d||j"dd||j"dt#t$| |j"d||j%|j&| Wn0t'j(k r}|jt#|tj)dSX|j*}|j+dkr|jd|j+|j,ftjnz|j+d kr/|j-d!}|dkrd"|j}n|jd#|tjn#|jd$|j+|j,ftj)|j/ryd%d&G|jGd%d&GHndS('Ntrbt doc_uploads:actionR)tcontentt:tutf8sBasic s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--s;filename="%s"iits* Content-Disposition: form-data; name="%s"s is s sSubmitting documentation to %sthttpthttpssunsupported schema tPOSTs Content-types multipart/form-data; boundary=%ssContent-lengtht AuthorizationisServer response (%s): %si-tLocationshttp://packages.python.org/%s/sUpload successful. Visit %ssUpload failed (%s): %st-iK(0topentreadRRRRRtbasenametusernametpasswordt _IS_PYTHON3tbase64t encodebytesRRt encodestringtstripR titemsttypettupletappendRRt repositoryRtINFOturlparsetAssertionErrorthttplibtHTTPConnectiontHTTPSConnectiontconnectt putrequestt putheadertstrR$t endheaderstsendtsocketterrortERRORt getresponsetstatustreasont getheaderR t show_response(RtfilenameR8tmetatdatat credentialst encoded_credstauthtboundaryt sep_boundaryt end_boundarytbodytkeytvaluestvaluetfntschematnetlocturltparamstqueryt fragmentstconntloglevelteR tlocation((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyR4Ys           $              N(s show-responseNs&display full response text from server(s upload-dir=Nsdirectory to upload( t__name__t __module__t descriptionRtDEFAULT_REPOSITORYR t user_optionstboolean_optionsR RR3R5R4(((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyR )s      (t__doc__RR]R!RTRHRRRtsyst distutilsRtdistutils.errorsRtdistutils.command.uploadRt ImportErrortsetuptools.command.uploadtversionRGRt NameErrorRZR R (((sd/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/upload_docs.pyts*            0707010006863b000081a4000000000000000000000001513ff566000007d5000000b500010002ffffffffffffffff0000006c00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyc e?Qc@sBddlmZddlZddlZdefdYZdS(i(t bdist_wininstNRcBs)eZddZddZdZRS(c Cstj||||t|jdg}|jrtjj|jd||jf}|j}dd|f}||kr|j |qn"tjj|jd|}d}d||f}||kr|j |ndS(Nt dist_filess%s.win32-py%s.exeRtanys %s.win32.exe( t_bdist_wininstt create_exetgetattrt distributionttarget_versiontostpathtjointdist_dirtremovetappend( tselftarcnametfullnametbitmapRtinstaller_namet pyversiontbadtgood((sf/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyRs      icCs1|jj||}|dkr-d|_n|S(Ntinstallt install_lib(sinstalls install_lib(Rtreinitialize_commandtNoneR(Rtcommandtreinit_subcommandstcmd((sf/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyRs     cCs+t|_ztj|Wdt|_XdS(N(tTruet _is_runningRtruntFalse(R((sf/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyR#s N(t__name__t __module__RRRR(((sf/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyRs  (tdistutils.command.bdist_wininstRRRtsys(((sf/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_wininst.pyts07070100068639000081a4000000000000000000000001513ff566000009c1000000b500010002ffffffffffffffff0000006800000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyc e?Qc@sBddlmZddlZddlZdefdYZdS(i(t bdist_rpmNRcBsAeZdZejdkr-ddZndZdZRS(cCstj|d|_dS(N(t _bdist_rpmtinitialize_optionstNonetno_egg(tself((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyR s s2.5ic Cstj||||||jkr|jdrt|jdgjd|jdradpktjd t j j |t j j |fndS(Ns.rpmt dist_filesRs.src.rpmtanyi( Rt move_filetdist_dirtendswithtgetattrt distributiontappendtsystversiontostpathtjointbasename(Rtsrctdsttlevel((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyRs cCs|jdtj|dS(Ntegg_info(t run_commandRtrun(R((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyRs cCs|jj}|jdd}tj|}d|}d|}g|D]<}|jddjddjdd j||^qK}|j|j|d d ||S( Nt-t_s%define version sSource0: %{name}-%{version}.tars)Source0: %{name}-%{unmangled_version}.tarssetup.py install s5setup.py install --single-version-externally-managed s%setups&%setup -n %{name}-%{unmangled_version}is%define unmangled_version (R t get_versiontreplaceRt_make_spec_filetinserttindex(RRt rpmversiontspectline23tline24tline((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyR*s   F!(t__name__t __module__RRRRRR(((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyR s   (tdistutils.command.bdist_rpmRRRR(((sb/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/bdist_rpm.pyts07070100068648000081ed000000000000000000000001513ff56500000ef9000000b500010002ffffffffffffffff0000006e00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_egg_info.pyfrom setuptools import Command from setuptools.archive_util import unpack_archive from distutils import log, dir_util import os, shutil, pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_options = [ ('install-dir=', 'd', "directory to install to"), ] def initialize_options(self): self.install_dir = None def finalize_options(self): self.set_undefined_options('install_lib',('install_dir','install_dir')) ei_cmd = self.get_finalized_command("egg_info") basename = pkg_resources.Distribution( None, None, ei_cmd.egg_name, ei_cmd.egg_version ).egg_name()+'.egg-info' self.source = ei_cmd.egg_info self.target = os.path.join(self.install_dir, basename) self.outputs = [self.target] def run(self): self.run_command('egg_info') target = self.target if os.path.isdir(self.target) and not os.path.islink(self.target): dir_util.remove_tree(self.target, dry_run=self.dry_run) elif os.path.exists(self.target): self.execute(os.unlink,(self.target,),"Removing "+self.target) if not self.dry_run: pkg_resources.ensure_directory(self.target) self.execute(self.copytree, (), "Copying %s to %s" % (self.source, self.target) ) self.install_namespaces() def get_outputs(self): return self.outputs def copytree(self): # Copy the .egg-info tree to site-packages def skimmer(src,dst): # filter out source-control directories; note that 'src' is always # a '/'-separated path, regardless of platform. 'dst' is a # platform-specific path. for skip in '.svn/','CVS/': if src.startswith(skip) or '/'+skip in src: return None self.outputs.append(dst) log.debug("Copying %s to %s", src, dst) return dst unpack_archive(self.source, self.target, skimmer) def install_namespaces(self): nsp = self._get_all_ns_packages() if not nsp: return filename,ext = os.path.splitext(self.target) filename += '-nspkg.pth'; self.outputs.append(filename) log.info("Installing %s",filename) if not self.dry_run: f = open(filename,'wt') for pkg in nsp: # ensure pkg is not a unicode string under Python 2.7 pkg = str(pkg) pth = tuple(pkg.split('.')) trailer = '\n' if '.' in pkg: trailer = ( "; m and setattr(sys.modules[%r], %r, m)\n" % ('.'.join(pth[:-1]), pth[-1]) ) f.write( "import sys,types,os; " "p = os.path.join(sys._getframe(1).f_locals['sitedir'], " "*%(pth)r); " "ie = os.path.exists(os.path.join(p,'__init__.py')); " "m = not ie and " "sys.modules.setdefault(%(pkg)r,types.ModuleType(%(pkg)r)); " "mp = (m or []) and m.__dict__.setdefault('__path__',[]); " "(p not in mp) and mp.append(p)%(trailer)s" % locals() ) f.close() def _get_all_ns_packages(self): nsp = {} for pkg in self.distribution.namespace_packages or []: pkg = pkg.split('.') while pkg: nsp['.'.join(pkg)] = 1 pkg.pop() nsp=list(nsp) nsp.sort() # set up shorter names first return nsp 0707010006864f000081a4000000000000000000000001513ff5650000031a000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyc e?Qc@s*ddlmZdefdYZdS(i(tregisterRcBseZejZdZRS(cCs|jdtj|dS(Ntegg_info(t run_commandt _registertrun(tself((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyRs (t__name__t __module__Rt__doc__R(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyRs N(tdistutils.command.registerRR(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/register.pyts07070100068640000081ed000000000000000000000001513ff565000014f8000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/develop.pyfrom setuptools.command.easy_install import easy_install from distutils.util import convert_path, subst_vars from pkg_resources import Distribution, PathMetadata, normalize_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os, setuptools, glob class develop(easy_install): """Set up package for development""" description = "install package in 'development mode'" user_options = easy_install.user_options + [ ("uninstall", "u", "Uninstall this source package"), ("egg-path=", None, "Set the path to be used in the .egg-link file"), ] boolean_options = easy_install.boolean_options + ['uninstall'] command_consumes_arguments = False # override base def run(self): if self.uninstall: self.multi_version = True self.uninstall_link() else: self.install_for_development() self.warn_deprecated_options() def initialize_options(self): self.uninstall = None self.egg_path = None easy_install.initialize_options(self) self.setup_path = None self.always_copy_from = '.' # always copy eggs installed in curdir def finalize_options(self): ei = self.get_finalized_command("egg_info") if ei.broken_egg_info: raise DistutilsError( "Please rename %r to %r before using 'develop'" % (ei.egg_info, ei.broken_egg_info) ) self.args = [ei.egg_name] easy_install.finalize_options(self) self.expand_basedirs() self.expand_dirs() # pick up setup-dir .egg files only: no .egg-info self.package_index.scan(glob.glob('*.egg')) self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link') self.egg_base = ei.egg_base if self.egg_path is None: self.egg_path = os.path.abspath(ei.egg_base) target = normalize_path(self.egg_base) if normalize_path(os.path.join(self.install_dir, self.egg_path)) != target: raise DistutilsOptionError( "--egg-path must be a relative path from the install" " directory to "+target ) # Make a distribution for the package's source self.dist = Distribution( target, PathMetadata(target, os.path.abspath(ei.egg_info)), project_name = ei.egg_name ) p = self.egg_base.replace(os.sep,'/') if p!= os.curdir: p = '../' * (p.count('/')+1) self.setup_path = p p = normalize_path(os.path.join(self.install_dir, self.egg_path, p)) if p != normalize_path(os.curdir): raise DistutilsOptionError( "Can't get a consistent path to setup script from" " installation directory", p, normalize_path(os.curdir)) def install_for_development(self): # Ensure metadata is up-to-date self.run_command('egg_info') # Build extensions in-place self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') self.install_site_py() # ensure that target dir is site-safe if setuptools.bootstrap_install_from: self.easy_install(setuptools.bootstrap_install_from) setuptools.bootstrap_install_from = None # create an .egg-link in the installation dir, pointing to our egg log.info("Creating %s (link to %s)", self.egg_link, self.egg_base) if not self.dry_run: f = open(self.egg_link,"w") f.write(self.egg_path + "\n" + self.setup_path) f.close() # postprocess the installed distro, fixing up .pth, installing scripts, # and handling requirements self.process_distribution(None, self.dist, not self.no_deps) def uninstall_link(self): if os.path.exists(self.egg_link): log.info("Removing %s (link to %s)", self.egg_link, self.egg_base) contents = [line.rstrip() for line in open(self.egg_link)] if contents not in ([self.egg_path], [self.egg_path, self.setup_path]): log.warn("Link points to %s: uninstall aborted", contents) return if not self.dry_run: os.unlink(self.egg_link) if not self.dry_run: self.update_pth(self.dist) # remove any .pth link to us if self.distribution.scripts: # XXX should also check for entry point scripts! log.warn("Note: you must uninstall or replace scripts manually!") def install_egg_scripts(self, dist): if dist is not self.dist: # Installing a dependency, so fall back to normal behavior return easy_install.install_egg_scripts(self,dist) # create wrapper scripts in the script dir, pointing to dist.scripts # new-style... self.install_wrapper_scripts(dist) # ...and old-style for script_name in self.distribution.scripts or []: script_path = os.path.abspath(convert_path(script_name)) script_name = os.path.basename(script_path) f = open(script_path,'rU') script_text = f.read() f.close() self.install_script(dist, script_name, script_text, script_path) 0707010006862c000081ed000000000000000000000001513ff56500001815000000b500010002ffffffffffffffff0000006200000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/archive_util.py"""Utilities for extracting common archive formats""" __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] import zipfile, tarfile, os, shutil from pkg_resources import ensure_directory from distutils.errors import DistutilsError class UnrecognizedFormat(DistutilsError): """Couldn't recognize the archive type""" def default_filter(src,dst): """The default progress/filter callback; returns True for all files""" return dst def unpack_archive(filename, extract_dir, progress_filter=default_filter, drivers=None ): """Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. """ for driver in drivers or extraction_drivers: try: driver(filename, extract_dir, progress_filter) except UnrecognizedFormat: continue else: return else: raise UnrecognizedFormat( "Not a recognized archive type: %s" % filename ) def unpack_directory(filename, extract_dir, progress_filter=default_filter): """"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory """ if not os.path.isdir(filename): raise UnrecognizedFormat("%s is not a directory" % (filename,)) paths = {filename:('',extract_dir)} for base, dirs, files in os.walk(filename): src,dst = paths[base] for d in dirs: paths[os.path.join(base,d)] = src+d+'/', os.path.join(dst,d) for f in files: name = src+f target = os.path.join(dst,f) target = progress_filter(src+f, target) if not target: continue # skip non-files ensure_directory(target) f = os.path.join(base,f) shutil.copyfile(f, target) shutil.copystat(f, target) def unpack_zipfile(filename, extract_dir, progress_filter=default_filter): """Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. """ if not zipfile.is_zipfile(filename): raise UnrecognizedFormat("%s is not a zip file" % (filename,)) z = zipfile.ZipFile(filename) try: for info in z.infolist(): name = info.filename # don't extract absolute paths or ones with .. in them if name.startswith('/') or '..' in name: continue target = os.path.join(extract_dir, *name.split('/')) target = progress_filter(name, target) if not target: continue if name.endswith('/'): # directory ensure_directory(target) else: # file ensure_directory(target) data = z.read(info.filename) f = open(target,'wb') try: f.write(data) finally: f.close() del data finally: z.close() def unpack_tarfile(filename, extract_dir, progress_filter=default_filter): """Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. """ try: tarobj = tarfile.open(filename) except tarfile.TarError: raise UnrecognizedFormat( "%s is not a compressed or uncompressed tar file" % (filename,) ) try: tarobj.chown = lambda *args: None # don't do any chowning! for member in tarobj: name = member.name # don't extract absolute paths or ones with .. in them if not name.startswith('/') and '..' not in name: prelim_dst = os.path.join(extract_dir, *name.split('/')) final_dst = progress_filter(name, prelim_dst) # If progress_filter returns None, then we do not extract # this file # TODO: Do we really need to limit to just these file types? # tarobj.extract() will handle all files on all platforms, # turning file types that aren't allowed on that platform into # regular files. if final_dst and (member.isfile() or member.isdir() or member.islnk() or member.issym()): tarobj.extract(member, extract_dir) if final_dst != prelim_dst: shutil.move(prelim_dst, final_dst) return True finally: tarobj.close() extraction_drivers = unpack_directory, unpack_zipfile, unpack_tarfile 0707010006862a000081ed000000000000000000000001513ff56500000ea0000000b500010002ffffffffffffffff0000005e00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/__init__.py"""Extensions to the 'distutils' for large or complex distributions""" from setuptools.extension import Extension, Library from setuptools.dist import Distribution, Feature, _get_unpatched import distutils.core, setuptools.command from setuptools.depends import Require from distutils.core import Command as _Command from distutils.util import convert_path import os import sys __version__ = '0.6' __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'find_packages' ] # This marker is used to simplify the process that checks is the # setuptools package was installed by the Setuptools project # or by the Distribute project, in case Setuptools creates # a distribution with the same version. # # The distribute_setup script for instance, will check if this # attribute is present to decide whether to reinstall the package # or not. _distribute = True bootstrap_install_from = None # If we run 2to3 on .py files, should we also convert docstrings? # Default: yes; assume that we can detect doctests reliably run_2to3_on_doctests = True # Standard package names for fixer packages lib2to3_fixer_packages = ['lib2to3.fixes'] def find_packages(where='.', exclude=()): """Return a list all Python packages found within directory 'where' 'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). """ out = [] stack=[(convert_path(where), '')] while stack: where,prefix = stack.pop(0) for name in os.listdir(where): fn = os.path.join(where,name) if ('.' not in name and os.path.isdir(fn) and os.path.isfile(os.path.join(fn,'__init__.py')) ): out.append(prefix+name); stack.append((fn,prefix+name+'.')) for pat in list(exclude)+['ez_setup', 'distribute_setup']: from fnmatch import fnmatchcase out = [item for item in out if not fnmatchcase(item,pat)] return out setup = distutils.core.setup _Command = _get_unpatched(_Command) class Command(_Command): __doc__ = _Command.__doc__ command_consumes_arguments = False def __init__(self, dist, **kw): # Add support for keyword arguments _Command.__init__(self,dist) for k,v in kw.items(): setattr(self,k,v) def reinitialize_command(self, command, reinit_subcommands=0, **kw): cmd = _Command.reinitialize_command(self, command, reinit_subcommands) for k,v in kw.items(): setattr(cmd,k,v) # update command with keywords return cmd import distutils.core distutils.core.Command = Command # we can't patch distutils.cmd, alas def findall(dir = os.curdir): """Find all files under 'dir' and return the list of full filenames (relative to 'dir'). """ all_files = [] for base, dirs, files in os.walk(dir): if base==os.curdir or base.startswith(os.curdir+os.sep): base = base[2:] if base: files = [os.path.join(base, f) for f in files] all_files.extend(filter(os.path.isfile, files)) return all_files import distutils.filelist distutils.filelist.findall = findall # fix findall bug in distutils. # sys.dont_write_bytecode was introduced in Python 2.6. if ((hasattr(sys, "dont_write_bytecode") and sys.dont_write_bytecode) or (not hasattr(sys, "dont_write_bytecode") and os.environ.get("PYTHONDONTWRITEBYTECODE"))): _dont_write_bytecode = True else: _dont_write_bytecode = False 0707010006866f000041ed000000000000000000000002513ff7e600000000000000b500010002ffffffffffffffff0000005800000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests07070100068676000081ed000000000000000000000001513ff565000009bd000000b500010002ffffffffffffffff0000006200000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.py"""Basic http server for tests to simulate PyPI or custom indexes """ import urllib2 import sys import threading import BaseHTTPServer from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler class IndexServer(HTTPServer): """Basic single-threaded http server simulating a package index You can use this server in unittest like this:: s = IndexServer() s.start() index_url = s.base_url() + 'mytestindex' # do some test requests to the index # The index files should be located in setuptools/tests/indexes s.stop() """ def __init__(self, server_address=('', 0), RequestHandlerClass=SimpleHTTPRequestHandler): HTTPServer.__init__(self, server_address, RequestHandlerClass) self._run = True def serve(self): while self._run: self.handle_request() def start(self): self.thread = threading.Thread(target=self.serve) self.thread.start() def stop(self): "Stop the server" # self.shutdown is not supported on python < 2.6, so just # set _run to false, and make a request, causing it to # terminate. self._run = False url = 'http://127.0.0.1:%(server_port)s/' % vars(self) try: if sys.version_info >= (2, 6): urllib2.urlopen(url, timeout=5) else: urllib2.urlopen(url) except urllib2.URLError: # ignore any errors; all that's important is the request pass self.thread.join() def base_url(self): port = self.server_port return 'http://127.0.0.1:%s/setuptools/tests/indexes/' % port class RequestRecorder(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): requests = vars(self.server).setdefault('requests', []) requests.append(self) self.send_response(200, 'OK') class MockServer(HTTPServer, threading.Thread): """ A simple HTTP Server that records the requests made to it. """ def __init__(self, server_address=('', 0), RequestHandlerClass=RequestRecorder): HTTPServer.__init__(self, server_address, RequestHandlerClass) threading.Thread.__init__(self) self.setDaemon(True) self.requests = [] def run(self): self.serve_forever() def url(self): return 'http://localhost:%(server_port)s/' % vars(self) url = property(url) 0707010006867e000081ed000000000000000000000001513ff56500000913000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.py"""Test .dist-info style distributions. """ import os import shutil import tempfile import unittest import textwrap try: import markerlib except: pass import pkg_resources from setuptools.tests.py26compat import skipIf def DALS(s): "dedent and left-strip" return textwrap.dedent(s).lstrip() class TestDistInfo(unittest.TestCase): def test_distinfo(self): dists = {} for d in pkg_resources.find_distributions(self.tmpdir): dists[d.project_name] = d assert len(dists) == 2, dists unversioned = dists['UnversionedDistribution'] versioned = dists['VersionedDistribution'] assert versioned.version == '2.718' # from filename assert unversioned.version == '0.3' # from METADATA @skipIf('markerlib' not in globals(), "install markerlib to test conditional dependencies") def test_conditional_dependencies(self): requires = [pkg_resources.Requirement.parse('splort==4'), pkg_resources.Requirement.parse('quux>=1.1')] for d in pkg_resources.find_distributions(self.tmpdir): self.assertEquals(d.requires(), requires[:1]) self.assertEquals(d.requires(extras=('baz',)), requires) self.assertEquals(d.extras, ['baz']) def setUp(self): self.tmpdir = tempfile.mkdtemp() versioned = os.path.join(self.tmpdir, 'VersionedDistribution-2.718.dist-info') os.mkdir(versioned) open(os.path.join(versioned, 'METADATA'), 'w+').write(DALS( """Metadata-Version: 1.2 Name: VersionedDistribution Requires-Dist: splort (4) Provides-Extra: baz Requires-Dist: quux (>=1.1); extra == 'baz' """)) unversioned = os.path.join(self.tmpdir, 'UnversionedDistribution.dist-info') os.mkdir(unversioned) open(os.path.join(unversioned, 'METADATA'), 'w+').write(DALS( """Metadata-Version: 1.2 Name: UnversionedDistribution Version: 0.3 Requires-Dist: splort (==4) Provides-Extra: baz Requires-Dist: quux (>=1.1); extra == 'baz' """)) def tearDown(self): shutil.rmtree(self.tmpdir) 07070100068682000081ed000000000000000000000001513ff56500001461000000b500010002ffffffffffffffff0000006d00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.py"""Package Index Tests """ import sys import unittest import urllib2 import pkg_resources import httplib import distutils.errors import setuptools.package_index from server import IndexServer class TestPackageIndex(unittest.TestCase): def test_bad_url_bad_port(self): index = setuptools.package_index.PackageIndex() url = 'http://127.0.0.1:0/nonesuch/test_package_index' try: v = index.open_url(url) except Exception, v: self.assert_(url in str(v)) else: self.assert_(isinstance(v,urllib2.HTTPError)) def test_bad_url_typo(self): # issue 16 # easy_install inquant.contentmirror.plone breaks because of a typo # in its home URL index = setuptools.package_index.PackageIndex( hosts=('www.example.com',) ) url = 'url:%20https://svn.plone.org/svn/collective/inquant.contentmirror.plone/trunk' try: v = index.open_url(url) except Exception, v: self.assert_(url in str(v)) else: self.assert_(isinstance(v, urllib2.HTTPError)) def test_bad_url_bad_status_line(self): index = setuptools.package_index.PackageIndex( hosts=('www.example.com',) ) def _urlopen(*args): import httplib raise httplib.BadStatusLine('line') old_urlopen = urllib2.urlopen urllib2.urlopen = _urlopen url = 'http://example.com' try: try: v = index.open_url(url) except Exception, v: self.assert_('line' in str(v)) else: raise AssertionError('Should have raise here!') finally: urllib2.urlopen = old_urlopen def test_bad_url_double_scheme(self): """ A bad URL with a double scheme should raise a DistutilsError. """ index = setuptools.package_index.PackageIndex( hosts=('www.example.com',) ) # issue 20 url = 'http://http://svn.pythonpaste.org/Paste/wphp/trunk' try: index.open_url(url) except distutils.errors.DistutilsError, error: msg = unicode(error) assert 'nonnumeric port' in msg or 'getaddrinfo failed' in msg return raise RuntimeError("Did not raise") def test_bad_url_screwy_href(self): index = setuptools.package_index.PackageIndex( hosts=('www.example.com',) ) # issue #160 if sys.version_info[0] == 2 and sys.version_info[1] == 7: # this should not fail url = 'http://example.com' page = ('') index.process_index(url, page) def test_url_ok(self): index = setuptools.package_index.PackageIndex( hosts=('www.example.com',) ) url = 'file:///tmp/test_package_index' self.assert_(index.url_ok(url, True)) def test_links_priority(self): """ Download links from the pypi simple index should be used before external download links. http://bitbucket.org/tarek/distribute/issue/163/md5-validation-error Usecase : - someone uploads a package on pypi, a md5 is generated - someone manually copies this link (with the md5 in the url) onto an external page accessible from the package page. - someone reuploads the package (with a different md5) - while easy_installing, an MD5 error occurs because the external link is used -> Distribute should use the link from pypi, not the external one. """ if sys.platform.startswith('java'): # Skip this test on jython because binding to :0 fails return # start an index server server = IndexServer() server.start() index_url = server.base_url() + 'test_links_priority/simple/' # scan a test index pi = setuptools.package_index.PackageIndex(index_url) requirement = pkg_resources.Requirement.parse('foobar') pi.find_packages(requirement) server.stop() # the distribution has been found self.assert_('foobar' in pi) # we have only one link, because links are compared without md5 self.assert_(len(pi['foobar'])==1) # the link should be from the index self.assert_('correct_md5' in pi['foobar'][0].location) def test_parse_bdist_wininst(self): self.assertEqual(setuptools.package_index.parse_bdist_wininst( 'reportlab-2.5.win32-py2.4.exe'), ('reportlab-2.5', '2.4', 'win32')) self.assertEqual(setuptools.package_index.parse_bdist_wininst( 'reportlab-2.5.win32.exe'), ('reportlab-2.5', None, 'win32')) self.assertEqual(setuptools.package_index.parse_bdist_wininst( 'reportlab-2.5.win-amd64-py2.7.exe'), ('reportlab-2.5', '2.7', 'win-amd64')) self.assertEqual(setuptools.package_index.parse_bdist_wininst( 'reportlab-2.5.win-amd64.exe'), ('reportlab-2.5', None, 'win-amd64')) 07070100068686000081ed000000000000000000000001513ff565000006bc000000b500010002ffffffffffffffff0000006800000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.py"""develop tests """ import sys import os import shutil import unittest import tempfile from setuptools.sandbox import DirectorySandbox, SandboxViolation def has_win32com(): """ Run this to determine if the local machine has win32com, and if it does, include additional tests. """ if not sys.platform.startswith('win32'): return False try: mod = __import__('win32com') except ImportError: return False return True class TestSandbox(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.dir) def test_devnull(self): if sys.version < '2.4': return sandbox = DirectorySandbox(self.dir) sandbox.run(self._file_writer(os.devnull)) def _file_writer(path): def do_write(): f = open(path, 'w') f.write('xxx') f.close() return do_write _file_writer = staticmethod(_file_writer) if has_win32com(): def test_win32com(self): """ win32com should not be prevented from caching COM interfaces in gen_py. """ import win32com gen_py = win32com.__gen_path__ target = os.path.join(gen_py, 'test_write') sandbox = DirectorySandbox(self.dir) try: try: sandbox.run(self._file_writer(target)) except SandboxViolation: self.fail("Could not create gen_py file due to SandboxViolation") finally: if os.path.exists(target): os.remove(target) if __name__ == '__main__': unittest.main() 0707010006867b000081a4000000000000000000000001513ff566000004e4000000b500010002ffffffffffffffff0000006b00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.pyc e?Qc@sdZddlZddlZddlZddlZddlmZddlmZddl m Z dej fdYZ dS(sbuild_ext tests iN(t build_ext(t DistributiontTestBuildExtTestcBseZdZRS(cCsYt}t|}d|jd<|jd}tj|d}||ksUtdS(Ntsfoo/bartfoo(RRtext_maptget_ext_filenametdistutils_build_exttAssertionError(tselftdisttcmdtrestwanted((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.pyttest_get_ext_filename s    (t__name__t __module__R(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.pyRs( t__doc__tostshutilttempfiletunittesttdistutils.command.build_extRRtsetuptools.command.build_exttsetuptools.distRtTestCaseR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.pyts 007070100068673000081a4000000000000000000000001513ff56600014e6a000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyc e?Qc!@syeWnek r'eefZnXyeWnek rLdZnXdZdddddddd d d d d ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$l Z d#d$l Z d#d$l Z d#d$l Z d#d$l Z d#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d%lmZejd&deed'iZd(ZedZedZedZedZedZeeBeBeBeBZed Z ed Z!ed Z"ed Z#e e!Be"Be#BZ$d)Z%d*Z&d+Z'd,Z(d-d.Z)d/d0Z*d1Z+d2efd3YZ,d4Z-d5Z.d6ej/fd7YZ0d8Z1dfd9YZ2dfd:YZ3dfd;YZ4dfd<YZ5dfd=YZ6dfd>YZ7de8fd?YZ9de8fd@YZ:de6fdAYZ;e<a=e<e<e<e<e<e>d'e<e?e?dB Z@e>e<e<e<e<e>d'e<e?e4dC ZAe?dDe<d'dEZBdfdFYZCd'aDdGZEdHejFfdIYZGe<e<e<e<dJZHdKeGfdLYZIe>e<e<e4dMZJdNZKdOZLdPZMe?e<dQZNe?e<dRZOe?dSZPdTfdUYZQieQdT6dVdW6dXdY6dZd[6d\d]6d^d_6ZRd`ZSedakreSnd$S(bcCsttt||S(N(tziptrangetlen(tseq((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt enumeratessreStructuredText entregister_optionflagtDONT_ACCEPT_TRUE_FOR_1tDONT_ACCEPT_BLANKLINEtNORMALIZE_WHITESPACEtELLIPSIStIGNORE_EXCEPTION_DETAILtCOMPARISON_FLAGSt REPORT_UDIFFt REPORT_CDIFFt REPORT_NDIFFtREPORT_ONLY_FIRST_FAILUREtREPORTING_FLAGSt is_privatetExampletDocTestt DocTestParsert DocTestFindert DocTestRunnert OutputCheckertDocTestFailuretUnexpectedExceptiont DebugRunnerttestmodttestfiletrun_docstring_examplestTestert DocTestSuitet DocFileSuitetset_unittest_reportflagstscript_from_examplest testsourcet debug_srctdebugiN(tStringIOtignoreicCsdtt>}|t|<|S(Ni(RtOPTIONFLAGS_BY_NAME(tnametflag((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs s s...cCsItjdtdd|d dkoH|d dkoE|dkn S(sprefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this protocol may make use of it). Return true iff base begins with an (at least one) underscore, but does not both begin and end with (at least) two underscores. >>> is_private("a.b", "my_func") False >>> is_private("____", "_my_func") True >>> is_private("someclass", "__init__") False >>> is_private("sometypo", "__init_") True >>> is_private("x.y.z", "_") True >>> is_private("_x.y.z", "__") False >>> is_private("", "") # senseless but consistent False sVis_private is deprecated; it wasn't useful; examine DocTestFinder.find() lists insteadt stackleveliit_t__i(twarningstwarntDeprecationWarning(tprefixtbase((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs  cCsUd}xHtjD]=}|j|d}|tt|kr||jO}qqW|S(s Return the compiler-flags associated with the future features that have been imported into the given namespace (globs). iN(t __future__tall_feature_namestgettNonetgetattrt compiler_flag(tglobstflagstfnametfeature((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_extract_future_flagss icCs{tj|r|St|ttfrDt|ttdgS|dkrkt j t j |j dSt ddS(s Return the module specified by `module`. In particular: - If `module` is a module, then return module. - If `module` is a string, then import and return the module with that name. - If `module` is None, then return the calling module. The calling module is assumed to be the module of the stack frame at the given depth in the call stack. t*t__name__s"Expected a module, string, or NoneN(tinspecttismodulet isinstancetstrtunicodet __import__tglobalstlocalsR6tsystmodulest _getframet f_globalst TypeError(tmoduletdepth((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_normalize_modules  icCstjd|d|S(s{ Add the given number of space characters to the beginning every non-blank line in `s`, and return the result. s (?m)^(?!$)t (tretsub(tstindent((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_indentscCs;t}|\}}}tj|||d||jS(sz Return a string containing a traceback message for the given exc_info tuple (as returned by sys.exc_info()). tfile(R&t tracebacktprint_exceptiontgetvalue(texc_infotexcouttexc_typetexc_valtexc_tb((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_exception_tracebacks t _SpoofOutcBseZdZddZRS(cCsNtj|}|r2|jd r2|d7}nt|drJ|`n|S(Ns t softspace(R&RYtendswiththasattrRa(tselftresult((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRYs   cCs,tj||t|dr(|`ndS(NRa(R&ttruncateRcRa(Rdtsize((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRfsN(R?t __module__RYR6Rf(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR`s cCs/|jtdkr||kS|jt}t|dksFtdt|}}|d}|r|j|rt|}|d=qtSn|d}|r|j|r|t|8}|d=qtSn||krtSxC|D];}|j|||}|dkrtS|t|7}qWtS(s_ Essentially the only subtle case: >>> _ellipsis_match('aa...aa', 'aaa') False iii( tfindtELLIPSIS_MARKERtsplitRtAssertionErrort startswithtFalseRbtTrue(twanttgottwststartpostendpostw((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_ellipsis_match"s2         cCs"|j}|rd|SdSdS(s)Return a commented form of the given lines# t#N(trstrip(tline((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt _comment_lineSs t_OutputRedirectingPdbcBs eZdZdZdZRS(s A specialized version of the python debugger that redirects stdout to a given stream when interacting with the user. Stdout is *not* redirected when traced code is executed. cCs||_tjj|dS(N(t_OutputRedirectingPdb__outtpdbtPdbt__init__(Rdtout((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRas cGs=tj}|jt_ztjj||SWd|t_XdS(N(RHtstdoutR|R}R~ttrace_dispatch(Rdtargst save_stdout((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRes   (R?Rht__doc__RR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR{[s cCstj|std|n|jdr:tdnt|dretjj|j d}nw|j dkrt t j dkrt j ddkrtjjt j dd}qtj}ntd|d tjj||jdS( NsExpected a module: %rt/s1Module-relative files may not have absolute pathst__file__it__main__ts+Can't resolve paths relative to the module s (it has no __file__)(R@RARLRmt ValueErrorRctostpathRkRR?RRHtargvtcurdirtjoin(RMRtbasedir((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_module_relative_pathps (  cBs#eZdZdddddZRS(sn A single doctest example, consisting of source code and expected output. `Example` defines the following attributes: - source: A single Python statement, always ending with a newline. The constructor adds a newline if needed. - want: The expected output from running the source code (either from stdout, or a traceback in case of exception). `want` ends with a newline unless it's empty, in which case it's an empty string. The constructor adds a newline if needed. - exc_msg: The exception message generated by the example, if the example is expected to generate an exception; or `None` if it is not expected to generate an exception. This exception message is compared against the return value of `traceback.format_exception_only()`. `exc_msg` ends with a newline unless it's `None`. The constructor adds a newline if needed. - lineno: The line number within the DocTest string containing this Example where the Example begins. This line number is zero-based, with respect to the beginning of the DocTest. - indent: The example's indentation in the DocTest string. I.e., the number of space characters that preceed the example's first prompt. - options: A dictionary mapping from option flags to True or False, which is used to override default options for this example. Any option flags not contained in this dictionary are left at their default value (as specified by the DocTestRunner's optionflags). By default, no options are set. icCs|jds|d7}n|r?|jd r?|d7}n|dk rh|jd rh|d7}n||_||_||_||_|dkri}n||_||_dS(Ns (RbR6tsourceRptlinenoRTtoptionstexc_msg(RdRRpRRRTR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs         N(R?RhRR6R(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs" cBs)eZdZdZdZdZRS(se A collection of doctest examples that should be run in a single namespace. Each `DocTest` defines the following attributes: - examples: the list of examples. - globs: The namespace (aka globals) that the examples should be run in. - name: A name identifying the DocTest (typically, the name of the object whose docstring this DocTest was extracted from). - filename: The name of the file that this DocTest was extracted from, or `None` if the filename is unknown. - lineno: The line number within filename where this DocTest begins, or `None` if the line number is unavailable. This line number is zero-based, with respect to the beginning of the file. - docstring: The string that the examples were extracted from, or `None` if the string is unavailable. cCs\t|t std||_||_|j|_||_||_||_ dS(s Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`. s8DocTest no longer accepts str; use DocTestParser insteadN( RBt basestringRltexamplest docstringtcopyR9R)tfilenameR(RdRR9R)RRR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs     cCslt|jdkrd}n1t|jdkr<d}ndt|j}d|j|j|j|fS(Nis no examplesis 1 examples %d exampless(RRR)RR(RdR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt__repr__s  cCsVt|tsdSt|j|j|jt|f|j|j|jt|fS(Ni(RBRtcmpR)RRtid(Rdtother((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt__cmp__s!(R?RhRRRR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs  cBseZdZejdejejBZejdejejBejBZ ejdj Z ddZ dZ ddZdZejd ejZd Zejd ejZd Zd ZdZRS(sD A class used to parse strings containing doctest examples. s # Source consists of a PS1 line followed by zero or more PS2 lines. (?P (?:^(?P [ ]*) >>> .*) # PS1 line (?:\n [ ]* \.\.\. .*)*) # PS2 lines \n? # Want consists of any non-blank lines that do not start with PS1. (?P (?:(?![ ]*$) # Not a blank line (?![ ]*>>>) # Not a line starting with PS1 .*$\n? # But any other line )*) s # Grab the traceback header. Different versions of Python have # said different things on the first traceback line. ^(?P Traceback\ \( (?: most\ recent\ call\ last | innermost\ last ) \) : ) \s* $ # toss trailing whitespace on the header. (?P .*?) # don't blink: absorb stuff until... ^ (?P \w+ .*) # a line *starts* with alphanum. s ^[ ]*(#.*)?$sc Csx|j}|j|}|dkrYdjg|jdD]}||^q=}ng}d\}}x|jj|D]}|j|||j!||jd||j7}|j |||\} } } } |j | s.|jt | | | d|d|t |j dd| n||jd|j|j7}|j}q~W|j|||S(s= Divide the given string into examples and intervening text, and return them as a list of alternating Examples and strings. Line numbers for the Examples are 0-based. The optional argument `name` is a name identifying this string, and is only used for error messages. is RRTR(ii(t expandtabst _min_indentRRkt _EXAMPLE_REtfinditertappendtstarttcountt_parse_examplet_IS_BLANK_OR_COMMENTRRtgrouptend( RdtstringR)t min_indenttltoutputtcharnoRtmRRRpR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytparse5s&  2 ! %cCs%t|j|||||||S(s" Extract all doctest examples from the given string, and collect them into a `DocTest` object. `globs`, `name`, `filename`, and `lineno` are attributes for the new `DocTest` object. See the documentation for `DocTest` for more information. (Rt get_examples(RdRR9R)RR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt get_doctest\s cCs2g|j||D]}t|tr|^qS(s Extract all doctest examples from the given string, and return them as a list of `Example` objects. Line numbers are 0-based, because it's most common in doctests that nothing interesting appears on the same line as opening triple-quote, and so the first interesting line is called "line 1" then. The optional argument `name` is a name identifying this string, and is only used for error messages. (RRBR(RdRR)tx((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRhs c Cs~t|jd}|jdjd}|j|||||j|dd|d||djg|D]}||d^qr}|jd}|jd} t| dkrtjd | d r| d =n|j| d|||t|djg| D]} | |^q}|jj|}|rS|jd } nd } |j |||} || || fS( s Given a regular expression match from `_EXAMPLE_RE` (`m`), return a pair `(source, want)`, where `source` is the matched example's source code (with prompts and indentation stripped); and `want` is the example's expected output (with indentation stripped). `name` is the string's name, and `lineno` is the line number where the example starts; both are used for error messages. RTRs iRPt.iRps *$itmsgN( RRRkt_check_prompt_blankt _check_prefixRRQtmatcht _EXCEPTION_RER6t _find_options( RdRR)RRTt source_linestslRRpt want_linestwlRR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRvs$ "*( &s#\s*doctest:\s*([^\n\'"]*)$c Csi}x|jj|D]}|jdjddj}xp|D]h}|ddksm|dtkrtd|d||fnt|d}|ddk||>> tests = DocTestFinder().find(_TestClass) >>> runner = DocTestRunner(verbose=False) >>> for test in tests: ... print runner.run(test) (0, 2) (0, 1) (0, 2) (0, 2) The `summarize` method prints a summary of all the test cases that have been run by the runner, and returns an aggregated `(f, t)` tuple: >>> runner.summarize(verbose=1) 4 items passed all tests: 2 tests in _TestClass 2 tests in _TestClass.__init__ 2 tests in _TestClass.get 1 tests in _TestClass.square 7 tests in 4 items. 7 passed and 0 failed. Test passed. (0, 7) The aggregated number of tried examples and failed examples is also available via the `tries` and `failures` attributes: >>> runner.tries 7 >>> runner.failures 0 The comparison between expected outputs and actual outputs is done by an `OutputChecker`. This comparison may be customized with a number of option flags; see the documentation for `testmod` for more information. If the option flags are insufficient, then the comparison may also be customized by passing a subclass of `OutputChecker` to the constructor. The test runner's display output can be controlled in two ways. First, an output function (`out) can be passed to `TestRunner.run`; this function will be called with strings that should be displayed. It defaults to `sys.stdout.write`. If capturing the output is not sufficient, then the display output can be also customized by subclassing DocTestRunner, and overriding the methods `report_start`, `report_success`, `report_unexpected_exception`, and `report_failure`. R>iFicCsv|p t|_|dkr0dtjk}n||_||_||_d|_d|_ i|_ t |_ dS(sc Create a new test runner. Optional keyword arg `checker` is the `OutputChecker` that should be used to compare the expected outputs and actual outputs of doctest examples. Optional keyword arg 'verbose' prints lots of stuff if true, only failures if false; by default, it's true iff '-v' is in sys.argv. Optional argument `optionflags` can be used to control how the test runner compares expected output to actual output, and how it displays failures. See the documentation for `testmod` for more information. s-viN( Rt_checkerR6RHRRt optionflagstoriginal_optionflagsttriestfailurest_name2ftR`t_fakeout(RdtcheckerRR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRUs       cCs_|jr[|jr=|dt|jdt|jq[|dt|jdndS(s Report that the test runner is about to process the given example. (Only displays a message if verbose=True) sTrying: s Expecting: sExpecting nothing N(RRpRUR(RdRRtexample((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt report_startys   (cCs|jr|dndS(st Report that the given example ran successfully. (Only displays a message if verbose=True) sok N(R(RdRRR Rq((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytreport_successs cCs3||j|||jj|||jdS(s7 Report that the given example failed. N(t_failure_headerRtoutput_differenceR(RdRRR Rq((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytreport_failurescCs.||j||dtt|dS(sO Report that the given example raised an unexpected exception. sException raised: N(R RUR_(RdRRR RZ((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytreport_unexpected_exceptionscCs|jg}|jrs|jdk rJ|jdk rJ|j|jd}nd}|jd|j||jfn!|jd|jd|jf|jd|j}|jt|dj|S(Nit?sFile "%s", line %s, in %ssLine %s, in %ssFailed example:s ( tDIVIDERRRR6RR)RRUR(RdRR RRR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR s   !  c Bsd}}|j}ed\}}} |jj} x,e|jD]\} } |je@of|dk} ||_| jrxH| jjD]4\}}|r|j|O_q|j|M_qWn|d7}| s|j ||| nd|j | f}y7e | j |d|d|j U|jjd }Wn3ek rLn ej}|jjnX|jj}|jjd|}|d kr| | j||jr|}qnej}ej|d d}| s|e|7}n| jd kr| }n| | j||jr6|}ns|je@rejd| j}ejd|}|r|r| |jd|jd|jr|}qn||kr| s_|j ||| |q_qD||kr| s|j!||| |n|d7}qD|| krG| s:|j"||| |n|d7}qDe#sDt$d |fqDW||_|j%|||||fS( s Run the examples in `test`. Write the outcome of each example with one of the `DocTestRunner.report_*` methods, using the writer function `out`. `compileflags` is the set of compiler flags that should be used to execute examples. Return a tuple `(f, t)`, where `t` is the number of examples tried, and `f` is the number of examples that failed. The examples are run in the namespace `test.globs`. iiistsingleiis[^:]*:sunknown outcomeN(&RRRt check_outputRRRRRR R)RRR9tdebuggert set_continueR6tKeyboardInterruptRHRZRRYRfRpRWtformat_exception_onlyR_RR RQRRR RRRnRlt_DocTestRunner__record_outcome(RdRt compileflagsRRRRtSUCCESStFAILUREtBOOMtcheckt examplenumR tquiett optionflagRRt exceptionRqtoutcomeRZRtm1tm2((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt__runs~                  '         cCs^|jj|jd\}}||||f|j|j<|j|7_|j|7_dS(s{ Record the fact that the given DocTest (`test`) generated `f` failures out of `t` tried examples. iN(ii(RR5R)RR(RdRtftttf2tt2((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt__record_outcome(ss3[\w\.]+)\[(?P\d+)\]>$cCs|jj|}|rb|jd|jjkrb|jjt|jd}|jjt S|j j j dkr|j ||S|j |SdS(NR)Ri( t%_DocTestRunner__LINECACHE_FILENAME_RERRRR)RtintRt splitlinesRotsave_linecache_getlinesRt co_argcount(RdRtmodule_globalsRR ((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt__patched_linecache_getlines5s!cCs||_|dkr't|j}ntj}|dkrH|j}n|jt_tj }t ||_ |j j |j j t_ t j|_|jt _z|j|||SWd|t_|t_ |jt _|r|jjnXdS(sJ Run the examples in `test`, and display the results using the writer function `out`. The examples are run in the namespace `test.globs`. If `clear_globs` is true (the default), then this namespace will be cleared after the test runs, to help with garbage collection. If you would like to examine the namespace after the test completes, then use `clear_globs=False`. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. The output of each example is checked using `DocTestRunner.check_output`, and the results are formatted by the `DocTestRunner.report_*` methods. N(RR6R=R9RHRtwriteRR}t set_traceR{RtresetRRR/t*_DocTestRunner__patched_linecache_getlinest_DocTestRunner__runtclear(RdRRRt clear_globsRtsave_set_trace((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytrun?s(             c Cs|dkr|j}ng}g}g}d}}x|jjD]}|\}\} } | | ksnt|| 7}|| 7}| dkr|j|qD| dkr|j|| fqD|j|qDW|r^|rt|GdGH|jx|D]} dG| GHqWn|r^t|GdGH|jx&|D]\} } d| | fGHq9Wq^n|r|jGHt|GdGH|jx/|D]$\} \} } d| | | fGHqWn|r|GdGt|jGd GH||Gd G|Gd GHn|rd G|Gd GHn|rdGHn||fS(s Print a summary of all the test cases that have been run by this DocTestRunner, and return a tuple `(f, t)`, where `f` is the total number of failed examples, and `t` is the total number of tried examples. The optional `verbose` argument controls how detailed the summary is. If the verbosity is not specified, then the DocTestRunner's verbosity is used. isitems had no tests:s sitems passed all tests:s %3d tests in %ssitems had failures:s %3d of %3d in %sstests insitems.s passed andsfailed.s***Test Failed***s failures.s Test passed.N( R6RRRRlRRtsortR( RdRtnoteststpassedtfailedttotaltttotalfRR)R'R(tthingR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt summarizexsR           cCs|j}xs|jjD]b\}\}}||krkd|dGH||\}}||}||}n||f||>> runner = DebugRunner(verbose=False) >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except UnexpectedException, failure: ... pass >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError We wrap the original exception to give the calling application access to the test and example information. If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' If a failure or error occurs, the globals are left intact: >>> del test.globs['__builtins__'] >>> test.globs {'x': 1} >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... >>> raise KeyError ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) Traceback (most recent call last): ... UnexpectedException: >>> del test.globs['__builtins__'] >>> test.globs {'x': 2} But the globals are cleared if there is no error: >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) (0, 1) >>> test.globs {} cCs5tj||||t}|r1|jjn|S(N(RR;RnR9R8(RdRRRR9tr((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR;scCst|||dS(N(R(RdRRR RZ((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRscCst|||dS(N(R(RdRRR Rq((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRsN(R?RhRR6RoR;RR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRgsY c Cs@|d k rtjdtn|d kr@tjjd}ntj|set d|fn|d kr}|j }nt d|d| } |rt d|d|} nt d|d|} x3| j||d|d |D]} | j| qW|r| jntd kr#| an tj| | j| jfS( s m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), starting with m.__doc__. Unless isprivate is specified, private names are not skipped. Also test examples reachable from dict m.__test__ if it exists and is not None. m.__test__ maps names to functions, classes and strings; function and class docstrings are tested even if the name is private; strings are tested directly, as if they were docstrings. Return (#failures, #tests). See doctest.__doc__ for an overview. Optional keyword arg "name" gives the name of the module; by default use m.__name__. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use m.__dict__. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. This is new in 2.4. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. This is new in 2.3. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Deprecated in Python 2.4: Optional keyword arg "isprivate" specifies a function used to determine whether a name is private. The default function is treat all functions as public. Optionally, "isprivate" can be set to doctest.is_private to skip over functions marked as private using the underscore naming convention; see its docs for details. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. sPthe isprivate argument is deprecated; examine DocTestFinder.find() lists insteadRstestmod: module required; %rRRRRR9RN(R6R.R/R0RHRIR5R@RARLR?RRRRiR;RCtmasterRERR( RR)R9Rt isprivatetreportRRtraise_on_errorRtfindertrunnerR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs*K      %    c CsP|r| rtdn|r@t|}t||}n|dkratjj|}n|dkrvi}n |j}|dk r|j|n| rt d|d|} nt d|d|} t |j } | j | |||d} | j| |r| jntdkr3| an tj| | j| jfS(s Test examples in the given file. Return (#failures, #tests). Optional keyword arg "module_relative" specifies how filenames should be interpreted: - If "module_relative" is True (the default), then "filename" specifies a module-relative path. By default, this path is relative to the calling module's directory; but if the "package" argument is specified, then it is relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and should not be an absolute path (i.e., it may not begin with "/"). - If "module_relative" is False, then "filename" specifies an os-specific path. The path may be absolute or relative (to the current working directory). Optional keyword arg "name" gives the name of the test; by default use the file's basename. Optional keyword argument "package" is a Python package or the name of a Python package whose directory should be used as the base directory for a module relative filename. If no package is specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use {}. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Optional keyword arg "parser" specifies a DocTestParser (or subclass) that should be used to extract tests from the files. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. s8Package may only be specified for module-relative paths.RRiN(RRORR6RRtbasenameRRRRtopentreadRR;RCRXRERR(Rtmodule_relativeR)tpackageR9RRZRRR[RR]RSR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRKs0M            tNoNamec Csdtd|dt}td|d|}x3|j||d|D]}|j|d|qCWdS(sr Test examples in the given object's docstring (`f`), using `globs` as globals. Optional argument `name` is used in failure messages. If the optional argument `verbose` is true, then generate output even if there are no failures. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. Optional keyword arg `optionflags` specifies options for the testing and output. See the documentation for `testmod` for more information. RRRR9RN(RRnRRiR;( R'R9RR)RRR\R]R((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRscBsbeZddddddZdZdddZddZdZddZdZ RS( icCstjdtdd|dkr=|dkr=tdn|dk rotj| rotd|fn|dkr|j}n||_||_ ||_ ||_ t d||_ td|d||_dS( NsCclass Tester is deprecated; use class doctest.DocTestRunner insteadR+is*Tester.__init__: must specify mod or globss)Tester.__init__: mod must be a module; %rRRR(R.R/R0R6RLR@RARR9RRYRRt testfinderRt testrunner(RdtmodR9RRYR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs          cCsytj||j|dd}|jr6dG|GHn|jj|\}}|jro|GdG|GdG|GHn||fS(NsRunning stringtofsexamples failed in string(RRR9R6RReR;(RdRSR)RR'R(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt runstrings!   c Csvd}}|jj||d|d|j}x;|D]3}|jj|\}} |||| }}q5W||fS(NiRMR9(RdRiR9ReR;( RdRR)RMR'R(RRR)R*((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytrundocs   cCsSddl}|j|}|jj||dkr@t}n|j|||S(Ni(ttypest ModuleTypeRRR6RnRi(RdRDR)RMRjR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytrundicts    cCs4ddl}|j|}||_|j||S(Ni(RjRkRRi(RdRDR)RjR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt run__test__s  cCs|jj|S(N(ReRC(RdR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRCscCs|jj|jdS(N(ReRE(RdR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyREsN( R?RhR6RRhRiRlRmRCRE(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs     cCs2|t@|kr"td|nt}|a|S(sSets the unittest option flags. The old flag is returned so that a runner could restore the old value if it wished to: >>> old = _unittest_reportflags >>> set_unittest_reportflags(REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) == old True >>> import doctest >>> doctest._unittest_reportflags == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True Only reporting flags can be set: >>> set_unittest_reportflags(ELLIPSIS) Traceback (most recent call last): ... ValueError: ('Only reporting flags allowed', 8) >>> set_unittest_reportflags(old) == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True sOnly reporting flags allowed(RRt_unittest_reportflags(R:told((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR!!s t DocTestCasecBskeZdd d d dZdZdZdZdZdZdZ dZ e Z d Z RS( icCsAtjj|||_||_||_||_||_dS(N(tunittesttTestCaseRt_dt_optionflagst _dt_checkert_dt_testt _dt_setUpt _dt_tearDown(RdRRtsetUpttearDownR ((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRGs     cCs,|j}|jdk r(|j|ndS(N(RuRvR6(RdR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRxQs cCs9|j}|jdk r(|j|n|jjdS(N(RuRwR6R9R8(RdR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRyWs cCs|j}tj}t}|j}|t@s;|tO}ntd|d|jdt }z5dd|_ |j |d|j dt \}}Wd|t_X|r|j |j|jndS(NRR RRiFRR9(RuRHRR&RsRRnRRtRnRR;R3tfailureExceptiontformat_failureRY(RdRRotnewRR]RR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytrunTest_s        " cCsj|j}|jdkr!d}n d|j}dj|jjdd}d|j|j|||fS(Nsunknown line numbers%sRis:Failed doctest test for %s File "%s", line %s, in %s %s(RuRR6RR)RkR(RdterrRRtlname((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR{ws   cCsI|jtd|jd|jdt}|j|j|jdS(sRun the test case without results and without catching exceptions The unit test framework includes a debug method on test cases and test suites to support post-mortem debugging. The test code is run in such a way that errors are not caught. This way a caller can catch the errors and initiate post-mortem debugging. The DocTestCase provides a debug method that raises UnexpectedException errors if there is an unexepcted exception: >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except UnexpectedException, failure: ... pass The UnexpectedException contains the test, the example, and the original exception: >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' RR RN(RxRRsRtRnR;RuRy(RdR]((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR%s B cCs |jjS(N(RuR)(Rd((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRscCs4|jjjd}d|ddj|d fS(NRs%s (%s)i(RuR)RkR(RdR)((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRscCsd|jjS(Ns Doctest: (RuR)(Rd((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytshortDescriptionsN( R?RhR6RRxRyR}R{R%RRRVR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRpEs     H  c Ks|d krt}nt|}|j|d|d|}|d krW|j}n|sot|dn|jtj}xz|D]r}t |j dkrqn|j s|j }|dd kr|d }n||_ n|j t||qW|S( s Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test case fails. An exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. The `module` argument provides the module to be tested. The argument can be either a module or a module name. If no argument is given, the calling module is used. A number of options may be provided as keyword arguments: setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. R9Rs has no testsiis.pycs.pyoiN(s.pycs.pyo(R6RRORiRRR<Rqt TestSuiteRRRRtaddTestRp( RMR9Rt test_finderRRtsuiteRR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyRs(%            t DocFileCasecBs)eZdZdZeZdZRS(cCsdj|jjjdS(NR,R(RRuR)Rk(Rd((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR scCs |jjS(N(RuR(Rd((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR scCsd|jj|jj|fS(Ns2Failed doctest test for %s File "%s", line 0 %s(RuR)R(RdR~((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR{ s(R?RhRRRVR{(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR s  c Ks|dkri}n|r1| r1tdn|rUt|}t||}ntjj|}t|j}|j ||||d}t ||S(Ns8Package may only be specified for module-relative paths.i( R6RRORRRR^R_R`RR( RRaRbR9RRR)tdocR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt DocFileTest$ s    cOsetj}|jdtr:t|jd|dA unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is True, then the given file paths are interpreted as os-independent module-relative paths. By default, these paths are relative to the calling module's directory; but if the "package" argument is specified, then they are relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and may not be an absolute path (i.e., it may not begin with "/"). If "module_relative" is False, then the given file paths are interpreted as os-specific paths. These paths may be absolute or relative (to the current working directory). package A Python package or the name of a Python package whose directory should be used as the base directory for module relative paths. If "package" is not specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. parser A DocTestParser (or subclass) that should be used to extract tests from the files. RaRb(RqRR5RoRORR(tpathstkwRR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR : s 5  cCs$g}xtj|D]}t|tr|j|jd |j}|r|jd|g|jdd D]}d|^qu7}qq|g|jdd D]}t|^q7}qWx$|r|ddkr|j qWx'|r|ddkr|j dqWdj |S(scExtract script from text with examples. Converts text with examples to a Python script. Example input is converted to regular code. Example output and all other words are converted to comments: >>> text = ''' ... Here are examples of simple math. ... ... Python has super accurate integer addition ... ... >>> 2 + 2 ... 5 ... ... And very friendly error messages: ... ... >>> 1/0 ... To Infinity ... And ... Beyond ... ... You can use logic if you want: ... ... >>> if 0: ... ... blah ... ... blah ... ... ... ... Ho hum ... ''' >>> print script_from_examples(text) # Here are examples of simple math. # # Python has super accurate integer addition # 2 + 2 # Expected: ## 5 # # And very friendly error messages: # 1/0 # Expected: ## To Infinity ## And ## Beyond # # You can use logic if you want: # if 0: blah blah # # Ho hum is # Expected:s s## Rwi( RRRBRRRRpRkRztpopR(RSRtpieceRpR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR" s9  4.cCs{t|}tj|}g|D]}|j|kr%|^q%}|s^t|dn|d}t|j}|S(sExtract the test sources from a doctest docstring as a script. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the doc string with tests to be debugged. snot found in testsi(RORRiR)RR"R(RMR)RR(Rttestsrc((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR# s ( cCs t|}t|||dS(s4Debug a single doctest docstring, in argument `src`'N(R"t debug_script(tsrctpmR9R((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR$ s cCsddl}tjdd}t|d}|j||jz|r\|j}ni}|ryt|||Wqtj dGH|j tj dqXn|j d|||Wdt j |XdS( s7Debug a test script. `src` is the script, as a string.iNs.pyt doctestdebugRuiis execfile(%r)(R}ttempfiletmktempR_R3tcloseRtexecfileRHRZt post_mortemR;Rtremove(RRR9R}t srcfilenameR'((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR s"   cCs2t|}t||}t|||jdS(sDebug a single doctest docstring. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the docstring with tests to be debugged. N(ROR#RR(RMR)RR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR% s t _TestClasscBs)eZdZdZdZdZRS(s A pointless class, for sanity-checking of docstring testing. Methods: square() get() >>> _TestClass(13).get() + _TestClass(-12).get() 1 >>> hex(_TestClass(13).square().get()) '0xa9' cCs ||_dS(sval -> _TestClass object with associated value val. >>> t = _TestClass(123) >>> print t.get() 123 N(R(RdR((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR! scCs|jd|_|S(sosquare() -> square TestClass's associated value >>> _TestClass(13).square().get() 169 i(R(Rd((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pytsquare+ scCs|jS(s}get() -> return TestClass's associated value. >>> x = _TestClass(-42) >>> print x.get() -42 (R(Rd((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR55 s(R?RhRRRR5(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyR s  s Example of a string object, searched as-is. >>> x = 1; y = 2 >>> x + y, x * y (3, 2) Rs In 2.2, boolean expressions displayed 0 or 1. By default, we still accept them. This can be disabled by passing DONT_ACCEPT_TRUE_FOR_1 to the new optionflags argument. >>> 4 == 4 1 >>> 4 == 4 True >>> 4 > 4 0 >>> 4 > 4 False sbool-int equivalences Blank lines can be marked with : >>> print 'foo\n\nbar\n' foo bar s blank liness If the ellipsis flag is used, then '...' can be used to elide substrings in the desired output: >>> print range(1000) #doctest: +ELLIPSIS [0, 1, 2, ..., 999] tellipsiss| If the whitespace normalization flag is used, then differences in whitespace are ignored. >>> print range(30) #doctest: +NORMALIZE_WHITESPACE [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] swhitespace normalizationcCs tj}|jtdS(N(RqtTextTestRunnerR;R(RW((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt_testq s R(TRt NameErrorRCRDRt __docformat__t__all__R3RHRWR@RRRQRjRqRKR}RR.R&tfilterwarningsR0R?R(RRRRR R R R R RRRRGRjRR=RORUR_R`RvRzR~R{RRRRRRRt ExceptionRRRR6RXRoRnRRRRRnR!RrRpRRRR R"R#R$RR%RRR(((s^/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.pyt s   *  T0                  1  $5<+n r  tA $? F P  ,     07070100068677000081a4000000000000000000000001513ff566000011a2000000b500010002ffffffffffffffff0000006300000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyc e?Qc@sdZddlZddlZddlZddlZddlmZddlmZdefdYZdej fdYZ d eej fd YZ dS( s?Basic http server for tests to simulate PyPI or custom indexes iN(t HTTPServer(tSimpleHTTPRequestHandlert IndexServercBsAeZdZdedZdZdZdZdZRS( sYBasic single-threaded http server simulating a package index You can use this server in unittest like this:: s = IndexServer() s.start() index_url = s.base_url() + 'mytestindex' # do some test requests to the index # The index files should be located in setuptools/tests/indexes s.stop() ticCs tj|||t|_dS(N(Rt__init__tTruet_run(tselftserver_addresstRequestHandlerClass((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyRscCsx|jr|jqWdS(N(Rthandle_request(R((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pytserves cCs)tjd|j|_|jjdS(Nttarget(t threadingtThreadR tthreadtstart(R((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyRscCswt|_dt|}y6tjdkrAtj|ddn tj|Wntjk renX|jj dS(sStop the servers!http://127.0.0.1:%(server_port)s/iittimeoutiN(ii( tFalseRtvarstsyst version_infoturllib2turlopentURLErrorRtjoin(Rturl((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pytstop"s cCs|j}d|S(Ns-http://127.0.0.1:%s/setuptools/tests/indexes/(t server_port(Rtport((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pytbase_url4s (Ri( t__name__t __module__t__doc__RRR RRR(((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyR s     tRequestRecordercBseZdZRS(cCs<t|jjdg}|j||jdddS(NtrequestsitOK(Rtservert setdefaulttappendt send_response(RR#((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pytdo_GET9s (RR R)(((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyR"8st MockServercBs;eZdZdedZdZdZeeZRS(sD A simple HTTP Server that records the requests made to it. RicCs=tj|||tjj||jtg|_dS(N(RRR Rt setDaemonRR#(RRR ((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyRBs cCs|jdS(N(t serve_forever(R((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pytrunIscCsdt|S(Ns!http://localhost:%(server_port)s/(R(R((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyRLs(Ri(RR R!R"RR-Rtproperty(((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyR*>s    ( R!RRR tBaseHTTPServerRtSimpleHTTPServerRRtBaseHTTPRequestHandlerR"RR*(((s]/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/server.pyts    .07070100068671000081a4000000000000000000000001513ff56600003ad2000000b500010002ffffffffffffffff0000006500000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyc e?Qc@sIdZddlZddlZddlZddlZddlZddlZddlm Z m Z ddlm Z ddlm Z ddl mZddlZddljZddlmZddlmZd Zd Zd ejfd YZd ejfdYZdejfdYZdejfdYZdS(s"Tests for the 'setuptools' packageiN(tDistutilsOptionErrortDistutilsPlatformError(tDistutilsSetupError(t Extension(t LooseVersion(tFeature(tRequirecCs}ddl}ddl}|j|jtjjddd|jddf}tj dkry|j |jdn|S( Nittestss api_tests.txtt optionflagstpackaget pkg_resourcestwin32swin_script_wrapper.txt( tdoctesttunittestt TestSuitet DocFileSuitetostpathtjointELLIPSIStsystplatformtaddTest(R R tsuite((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pytadditional_testsscKsAdtj_|jddgztj|SWddt_XdS(sDReturn distribution from 'setup(**args)', without executing commandst commandlinet script_argstinstallN(t distutilstcoret_setup_stop_aftert setdefaultt setuptoolstsetuptNonetcore_setup_stop_after(targs((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyt makeSetups  t DependsTestscBs,eZdZdZdZdZRS(cCsttdsdSd}|jtj|jddd|jtj|jddd|jtj|jddd|jtj|jddddS( Ntextract_constantcSsdatadS(Nttest(txtzty(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pytf13stqiR)R(R+R*(thasattrtdept assertEqualR't func_codeR"(tselfR,((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestExtractConst.s """cCsR|jttjd|jttjdtjd\}}}|jdS(Nsno-such.-thingssetuptools.non-existentssetuptools.tests(t assertRaisest ImportErrorR/t find_moduletclose(R2tftpti((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestFindModuleDscCs~ttdsdSddlm}|jtjdd||jtjddtj|jtjdd tdS( Ntget_module_constanti(t __version__temailR=Rtversionssetuptools.testst__doc__( R.R/R>R=R0R<RR?R@(R2R=((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestModuleExtractJscCsvttdsdStddd}|j|jd|j|jd|j|jd|j|jd|j|jdddl m }|j|j ||j |j d |j |j d  |j |j d  |j |j|j |jtd d ddt}|j |j|j |j |j |j d  tddd}|j |j |j |j tddddd}|j|jd|j|jd|j|jd|j|jd|j|jdgtD]}tjj|^q(}|j |j||j |j|dS(NR'tEmails1.0.3R>R=s Email-1.0.3i(R=s1.0.9s0.9.1tunknowns Email 3000t03000tformatsDo-what-I-means1.0sd-w-i-mtTestsRthomepageshttp://example.com(R.R/RR0tnametmoduletrequested_versiont attributet full_nameR>R=t get_versiontassert_t version_okt is_presentt is_currentRR"RERGt__path__RRtdirname(R2treqR=R9tpaths((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyt testRequireZs>%(t__name__t __module__R3R;RARV(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyR&,s   t DistroTestscBsPeZdZdZdZdZdZdZdZdZ RS(c Csstddg|_tddg|_tddddd d gd d d gd|j|jfdi|_dS(Nsbar.extsbar.csc.ysy.ctpackagestasa.bsa.b.ctbtct py_modulessb.dR)t ext_modulest package_dir(Rte1te2R%tdist(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pytsetUps cCs#|jt|jtjjdS(N(RNt isinstanceRcR t Distribution(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestDistroTypescCs|jjd|j|jjddg|jjd|j|jjdg|j|jjdg|j|jj|j|jg|jjd|j|jjg|j|jjdg|j|jj|jgtjddS(NR[R\R]R)( Rctexclude_packageR0RZR^R_RaRbR%(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestExcludePackages"cCs|jjd|jg|j|jj|jg|jjd|jg|j|jj|j|jg|jjd|jg|j|jj|j|jgdS(NR_(RctexcludeRaR0R_Rbtinclude(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestIncludeExcludes "cCsk|jjddddg|j|jjg|j|jjdg|j|jj|jgdS(NRZR]R\R[R)(RcRjR0RZR^R_Ra(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestExcludePackagesscCsft}|jddgddgd|jgt}|jddgddgd|jgdS(NRZR[R^R\R_(R%RkRbRj(R2Rc((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyt testEmptys ( cCs|j|jjd|jjd|j|jjd |j|jjd|jjd|j|jjd |j|jjd|jjd|j|jjd dS(NR[R\R](RNRcthas_contents_forRh(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyt testContentsscCs|jt|jjdd|jt|jjdd|jt|jjdidd6|jt|jjdidd6|jt|jjdidd6|jt|jjdidd6|jt|jjddg|jt|jjddgdS(Ntnonexistent_optionR)RZR+R_R`R-(R4RRcRkRj(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestInvalidIncludeExcludes         ( RWRXRdRgRiRlRmRnRpRr(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyRYs     t FeatureTestscBs>eZdZdZdZdZdZdZRS(cCstddd|_tditddtdd|jgd6td dtd d gd d gddgd 6tddtd dgddgdd!gd6tddtddd6dddgd d dgd d dgdtdd gg|_dS("Nt Distutilss1.0.3Rtfeaturestfootstandardtrequire_featurestbaztbarRZspkg.barR^tbar_ettremovesbar.exttoptionalspkg.baztscriptssscripts/baz_itt librariestlibfoos foo/foofoo.ctDWIMt availabletbazishtdwimRs --without-barRspkg.fooR_sbar.c(Rs foo/foofoo.c(RRTR%RtTruetFalseRRc(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyRds"     c Csh|jtddtdddtj |jtddtddj|jttddS(NR(RwR|R)R(RNRRRtinclude_by_defaultR4R(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyt testDefaultss #cCs'|jt|jjdj|jdS(NR(R4RRcRut include_in(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestAvailability scCs|j}|jd |jk|jd |jk|jd|jk|jd|jk|j|jd d |j|jdd|j|jdd|jd |jkdS(Ns with-dwims include DWIMs without-dwimsexclude DWIM (default)swith-barsinclude bar (default)s without-bars exclude bars without-fooswith-foos without-baz(s with-dwimNs include DWIM(s without-dwimNsexclude DWIM (default)(swith-barNsinclude bar (default)(s without-barNs exclude bar(RcRNR"tfeature_optionsR0tfeature_negopt(R2Rc((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestFeatureOptionss cCs|j}|j|jd|j|jd|j|jd|jd|jk|jd|jk|jd|jk|jd|jk|jd |j k|j|j g|j|j |j g|j t|jd dS( NiiR{spkg.barspkg.bazsscripts/baz_itRs foo/foofoo.cRz(slibfoos foo/foofoo.c(RcR0twith_footwith_bartwith_bazRNR^RZR~RR_RxRTR4Rtinclude_feature(R2Rc((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestUseFeatures$s c Cs-|jttditdddd6dS(NRuR)R|R+(R4t SystemExitR%R(R2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestFeatureWithInvalidRemove5s(RWRXRdRRRRR(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyRss     tTestCommandTestscBs>eZdZdZdZdZdZdZRS(cCs2tjd}|jt|tjjdS(NR((R%tget_command_objRNReRtcmdtCommand(R2ttest_cmd((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestTestIsCommand<scCsEtdddg}|jd}|j|j|jddS(NRR(s--test-suite=foo.tests.suitesfoo.tests.suite(R%Rtensure_finalizedR0t test_suite(R2tts1((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestLongOptSuiteWNoDefault@s cCs9tddjd}|j|j|jddS(NRsbar.tests.suiteR((R%RRR0R(R2tts2((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestDefaultSuiteFs cCs[tddddddgjd}|j|j|jd|j|jddS(NRs bar.testsRR(s-ms foo.testssfoo.tests.test_suite(R%RRR0t test_moduleR(R2tts3((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestDefaultWModuleOnCmdLineKs  cCs>tddddddgjd}|jt|jdS(NRR(s-ms bar.testss-ssfoo.tests.suite(R%RR4RR(R2tts4((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyttestConflictingOptionsTs cCs3tjd}|j|j|jddS(NR((R%RRR0RR"(R2tts5((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyt testNoSuiteZs (RWRXRRRRRR(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyR:s     (R@RRR R tdistutils.coreRt distutils.cmdtdistutils.errorsRRRRtdistutils.versionRtsetuptools.distR tsetuptools.dependstdependsR/RRRR%tTestCaseR&RYRsR(((s_/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.pyts(        YcR0707010006867c000081ed000000000000000000000001513ff56500000949000000b500010002ffffffffffffffff0000006800000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.py"""develop tests """ import sys import os, shutil, tempfile, unittest import tempfile import site from StringIO import StringIO from distutils.errors import DistutilsError from setuptools.command.develop import develop from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution SETUP_PY = """\ from setuptools import setup setup(name='foo') """ class TestDevelopTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() setup = os.path.join(self.dir, 'setup.py') f = open(setup, 'w') f.write(SETUP_PY) f.close() self.old_cwd = os.getcwd() os.chdir(self.dir) if sys.version >= "2.6": self.old_base = site.USER_BASE site.USER_BASE = tempfile.mkdtemp() self.old_site = site.USER_SITE site.USER_SITE = tempfile.mkdtemp() def tearDown(self): os.chdir(self.old_cwd) shutil.rmtree(self.dir) if sys.version >= "2.6": shutil.rmtree(site.USER_BASE) shutil.rmtree(site.USER_SITE) site.USER_BASE = self.old_base site.USER_SITE = self.old_site def test_develop(self): if sys.version < "2.6" or hasattr(sys, 'real_prefix'): return dist = Distribution() dist.script_name = 'setup.py' cmd = develop(dist) cmd.user = 1 cmd.ensure_finalized() cmd.install_dir = site.USER_SITE cmd.user = 1 old_stdout = sys.stdout sys.stdout = StringIO() try: cmd.run() finally: sys.stdout = old_stdout # let's see if we got our egg link at the right place content = os.listdir(site.USER_SITE) content.sort() self.assertEquals(content, ['UNKNOWN.egg-link', 'easy-install.pth']) def test_develop_with_setup_requires(self): wanted = ("Could not find suitable distribution for " "Requirement.parse('I-DONT-EXIST')") old_dir = os.getcwd() os.chdir(self.dir) try: try: dist = Distribution({'setup_requires': ['I_DONT_EXIST']}) except DistutilsError, e: error = str(e) if error == wanted: pass finally: os.chdir(old_dir) 07070100068674000081ed000000000000000000000001513ff5650000010b000000b500010002ffffffffffffffff0000006600000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pyimport unittest try: # provide skipIf for Python 2.4-2.6 skipIf = unittest.skipIf except AttributeError: def skipIf(condition, reason): def skipper(func): def skip(*args, **kwargs): return if condition: return skip return func return skipper 07070100068685000081a4000000000000000000000001513ff5660000722f000000b500010002ffffffffffffffff0000006b00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyc e?Qc@sTddlmZmZddlTddlmZmZddlZddlZddlZddl Z ddl Z ddl Z ye Wn!e k rddlmZ nXedZdefdYZd efd YZd efd YZd efdYZdefdYZdefdYZdefdYZdS(i(tTestCaset makeSuite(t*(tget_script_headertis_shN(t ImmutableSetcCs\yt|}Wn tk r2tj|}nX| sLt|tkrP|S|t dS(s copied from Python2.7s [truncated]...(treprt Exceptiontobjectt__repr__tlent _MAX_LENGTH(tobjtshorttresult((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt safe_repr s tMetadatacBs2eZdZdZdZdZdZRS(sAMock object to return metadata as if from an on-disk distributioncGst||_dS(N(tdicttmetadata(tselftpairs((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt__init__scCs ||jkS(N(R(Rtname((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt has_metadatascCs |j|S(N(R(RR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt get_metadatascCst|j|S(N(t yield_linesR(RR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pytget_metadata_lines!s(t__name__t __module__t__doc__RRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRs    t DistroTestscBsneZdZdZdZdZdZdZd dZdZ dZ d Z d Z RS( cCstgdddd}|jt|g|j|dg|jtjd|jtjd|jtjd|j|d|jt|dg|jg|dD]}|j^qdd d g|j |dd |jg|dD]}|j^qdd g|jtjd |jg|dD]}|j^qMd dd gt g}tjd}tjd}t d\}|j|j ||jd |j||j|j ||jdt g}|j||j||j t|j ||t g}|j||j||j||j|j ||jddS(NtplatformtpythontFooPkgsFooPkg-1.3_1.eggsFooPkg-1.4-py2.4-win32.eggsFooPkg-1.2-py2.4.eggtfoopkgs1.4s1.3-1s1.2isFooPkg-1.9.eggs1.9s FooPkg>=1.3(t EnvironmenttNonet assertEqualtlisttaddt Distributiont from_filenametassert_tversiontremovet WorkingSettparse_requirementst best_matcht assertRaisestVersionConflict(Rtadtdisttwstfoo12tfoo14treq((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestCollection&s@-*-    cCs||j|jd|j|jd|j|jd|j|jd|j|jd|j|jtddS(NR!R"s1.3-1s2.4twin32(R%t project_nametkeyR+t py_versionRtparsed_versiont parse_version(Rtd((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt checkFooPkgUs c Csntddddddddd }|j|td}|j|jtjd |j|jddS( Ns /some/pathR:R!R+s1.3-1R<s2.4RR9i(R(R@R%R<tsysR+RR$(RR?((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestDistroBasics]s  cCs<tjd}|j|tjd}|j|dS(NsFooPkg-1.3_1-py2.4-win32.eggs!FooPkg-1.3_1-py2.4-win32.egg-info(R(R)R@(RR?((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestDistroParsehs c Cs;tddddddddtd }|j|dS( Ns /some/pathR:R!R<s2.4RR9RsPKG-INFOs%Metadata-Version: 1.0 Version: 1.3-1 (sPKG-INFOs%Metadata-Version: 1.0 Version: 1.3-1 (R(RR@(RR?((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestDistroMetadatans  cCstddtd|fS(Ns/fooRs depends.txt(R(R(Rttxt((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt distRequiresxscCs/|jt|j|tt|dS(N(R%R&trequiresR.(RR3REtextras((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt checkRequires{scCs.x'dD]}|j|j||qWdS(Ns Twisted>=1.5sTwisted>=1.5 ZConfig>=2.0(s Twisted>=1.5sTwisted>=1.5 ZConfig>=2.0(RIRF(Rtv((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestDistroDependsSimples cCstg}tg}|jt|jg|g|jt|jtd|tj ddt d }|j ||j tj dxUt dD]G}t|jtd|}|j||gt |j |qW|jt|jtd|tg}|jt|jtd |tj d dt d }|j ||jt|jtd |||g|jt|jtd |dS(NtFoos/foo_dir/Foo-1.2.eggRs depends.txts[bar] Baz>=2.0s Foo-0.9.eggisFoo==0.9sFoo[bar]s/foo_dir/Baz-2.1.eggsFoo==1.2 Foo!=1.2(s depends.txts[bar] Baz>=2.0(s depends.txtsFoo(R#R-R%R&tresolveR0tDistributionNotFoundR.R(R)RR'trangetmapR1(RR2R4RLtittargetstBaz((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testResolves4 "   ( cCs|jd}|j|d|j|djdg|j|djdg|j|djddg|j|djddg|jt|jd gdS( Ns Twisted>=1.5 [docgen] ZConfig>=2.0 docutils>=0.3 [fastcgi] fcgiapp>=0.1s Twisted>=1.5s'Twisted>=1.5 ZConfig>=2.0 docutils>=0.3tdocgensTwisted>=1.5 fcgiapp>=0.1tfastcgis4Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1s4Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3tfoo(RFRItsplitR0t UnknownExtraRG(RR?((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestDistroDependsOptionss     cCstg}tddddd}|jt|j|tddddd}|j|tg}tddd}|j|dS(Ns /some/pathR:t setuptoolsR+s0.7a1s0.6c9(R-R(R0t ValueErrorR'(RR4R?td2td3((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt#testSetuptoolsDistributeCombinations       (( RRR8R@RBRCRDRFRIRKRTRZR_(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyR$s /      ) tEntryPointTestsc BseZdZdZdZdZdZdZede dddgd e d d d gd d gde ddddgZ dZ dZ dZ RS(cCs|j|jd|j|jd|j|jd|j|jd|j|jtk|jt|ddS(NRWssetuptools.tests.test_resourcesR`txs9foo = setuptools.tests.test_resources:EntryPointTests [x](sEntryPointTests(Ra( R%Rt module_nametattrsRHR*tloadR`tstr(Rtep((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt assertfieldss cCs"tjddtd|_dS(NsFooPkg-1.2-py2.4.eggRs requires.txts[x](s requires.txts[x](R(R)RR3(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pytsetUpscCs2tdddgdg|j}|j|dS(NRWssetuptools.tests.test_resourcesR`Ra(t EntryPointR3Rg(RRf((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testBasicss cCsd}tj||j}|j|tjd}|j|jd|j|jd|j|jd |j|jd tjd}|j|jd|j|jd|j|jd |j|jd dS(Ns9foo = setuptools.tests.test_resources:EntryPointTests [x]sbar baz= spammity[PING]sbar baztspammitytpings fizzly = wocka:footfizzlytwockaRW((Rl(sfoo(( RitparseR3RgR%RRbRcRH(RtsRf((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testParses cCs[xTddddddgD]:}ytj|Wntk rCqXtd|qWdS(NRWsx=1=2sx=a:b:csq=x/nasfez=pish:tush-zsx=f[a]>2sShould've been bad(RiRoR\tAssertionError(RRf((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testRejects s cCsh|jt|t|jxB|jjD]1\}}|jt|j|t|q/WdS(N(R%R t submap_expectt iteritemsRtget(RtmR;Rf((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt checkSubMapstfeature1t somemodulet somefunctiontfeature2sanother.modulet SomeClasstextra1textra2tfeature3s this.moduleRHt somethings # define features for blah blah feature1 = somemodule:somefunction feature2 = another.module:SomeClass [extra1,extra2] feature3 = this.module [something] cCsX|jtjd|j|jttjdd|jttjdddgdS(Ntxyzsx asfoo=barRasfoo=baz(RxRit parse_groupt submap_strR0R\(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testParseList"scCstji|jd6}|j|d|j|jdgtjd|j}|j|d|j|jdg|jttjddg|jttj|jdS(NRs[xyz] s[xyz](Rit parse_mapRRxR%tkeysR0R\(RRw((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testParseMap(s(RRRgRhRjRqRsRxRRiRtRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyR`s      tRequirementsTestscBsGeZdZdZdZdZdZdZdZRS(cCstjd}|jt|d|jt|d|j|tdd gd |j|tdd gd|j|tddgd|j|tddgd|j|tddgd|j|tjd dS(Ns Twisted>=1.2s!Requirement.parse('Twisted>=1.2')tTwisteds>=s1.2ttwisTeds2.0tZopes3.0sTwisted[extras]>=1.2(s>=s1.2((s>=s1.2((s>=s2.0((s>=s1.2((s>=s3.0((t RequirementRoR%ReRtassertNotEqual(Rtr((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRj4scCsvtdddgd }tdd d gd }|j|||jt|t||jt|ddS( NRs==s1.2c1s>=s1.2sTwisted==1.2c1,>=1.2(s==s1.2c1(s>=s1.2((s>=s1.2(s==s1.2c1((RR%Re(Rtr1tr2((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testOrdering?s cCstddgd }tjd}tjd}tjd}|jtd|k|jtd|k|jd|k|jd|k|j||k|j||k|j||kdS( NRs>=s1.2sFooPkg-1.3_1.eggsTwisted-1.1.eggsTwisted-1.2.eggs1.1(s>=s1.2((RR(R)R*R>(RRtfoo_distttwist11ttwist12((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestBasicContainsFsc Csmtd\}x*dD]"}|j||k||fqWx*dD]"}|j||k||fqCWdS(Ns*Foo>=1.2,<=1.3,==1.9,>2.0,!=2.5,<3.0,==4.5s1.2s1.2.2s1.3s1.9s2.0.1s2.3s2.6s3.0c1s4.5s1.2c1s1.3.1s1.5s1.9.1s2.0s2.5s3.0s4.0( s1.2s1.2.2s1.3s1.9s2.0.1s2.3s2.6s3.0c1s4.5(s1.2c1s1.3.1s1.5s1.9.1s2.0s2.5s3.0s4.0(R.R*(RRRJ((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestAdvancedContainsSs    cCstjd}tjd}tjd}|j|||j|||j|jd |j|jd |jt|t||jt|tddtdfftddgfdS( NsTwisted[foo,bar]>=1.2sTwisted[bar,FOO]>=1.2sTwisted[BAR,FOO]>=1.2.0RWtbarttwisteds>=s1.2(sfooR(Rsfoo(RRoR%RHthashR>t frozenset(RRRtr3((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestOptionsAndHashing[s!cCstjd}tjd}tj}|j|d|k|j|d|k|j|d|k|j|d|k|j|d|k|j|d|k|j|d|kdS(Ns foo==0.3a2s foo!=0.3a4s foo-0.3a4.eggs foo-0.3a1.eggs foo-0.3a2.eggs foo-0.3a3.eggs foo-0.3a5.egg(RRoR(R)R*(RRRR?((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestVersionEqualityis cCs|jtjdjd|jtjdjd|jtjdjd|jtjdjd|jtjdjd|jtjdjd|jtjdjd|jtjdjd|jtjd jddS( NR[t distributessetuptools==0.6c9ssetuptools==0.6c10ssetuptools>=0.6ssetuptools < 0.7ssetuptools == 0.7ssetuptools == 0.7a1ssetuptools >= 0.7(R%RRoR:(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testDistributeSetuptoolsOverridews$( RRRjRRRRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyR2s    t ParseTestscBsPeZdZdZdZdZdZdZdZdZ RS(cCs |jttdgdS(Nt(R%R&R.(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestEmptyParsescCsxxggfddgfgggfdddgfddgddgfgD]+\}}|jttj||qLWdS(NRas x ytysx (R%R&t pkg_resourcesR(Rtinptout((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testYieldings0%cCs{|jttjdddgfdddgfddgfdgfd d gfg|jtttjd dS( Ns x [Y] z a [b ] # foo c [ d] [q] v RatYtztatbtcR?tqRJs[foo(R%R&Rtsplit_sectionsR$R0R\(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testSplittings  CcCsr|jtdd|jtdd|jtdd|jtdd|jtdddS( Ns adns-pythons WSGI Utilss WSGI-Utilss WSGI Utilss Money$$$Makers Money-Makerspeak.webspeak-web(R%t safe_nameR(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt testSafeNames cCsr|jtdd|jtdd|jtdd|jtdd|jtdddS( Ns1.2-1s 1.2 alphas 1.2.alphas2.3.4 20050521s2.3.4.20050521s Money$$$Makers Money-Makerspeak.web(R%t safe_version(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestSafeVersions cCs|jttdtddgdg|jttdtdddgdg|jtjd td dgd|jttjd|jttjd|jttjd|jttjd|jttjddS(NsTwis-Ted>=1.2-1sTwis-Teds>=s1.2-1sTwisted >=1.2, \ # more <2.0Rs1.2t=2.3sx\sx==2 qs X==1 Y==2t#(s>=s1.2-1((s>=s1.2(Rs2.0((s==s1.99a3((R%R&R.RRoR0R\(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestSimpleRequirementss csfd}|dd|dd|dd|dd|d d |d d |d d |dd|dddS(Ncs<t|t|}}j||||||fdS(N(R>R%(ts1ts2tp1tp2(R(se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRss0.4s0.4.0s0.4.0.0s0.4.0-0s0.4-0t0pl1s0.0pl1t0pre1s0.0c1s 0.0.0preview1t0c1t0rc1s1.2a1s1.2.a.1s1.2...as1.2a((RR((Rse/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRs        csfd}|dd|dd|dd|dd |dd|d d |d d |d d|dd|dd|dd|dd|dd|dd|dd|dd|dd|dd|dd|d d!|d"d|dd#|dd$|dd%|dd&|d'd(|d(d)|d*d+|d,d-|d.d'|d.d'|d*d/|d-d0d1j}x@t|D]2\}}x#||d2D]}|||qWqWdS(3Ncs?t|t|}}j||k||||fdS(N(R>R*(RRRR(R(se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRss2.1s2.1.1s2.1.0s2.10t2a1t2b0t2b1t2c0s2.3a1s2.3s2.1-1s2.1-2s2.1.1-1s2.1pl4s2.1a0-20040501s1.1s02.1tA56tB27s3.2s3.2.pl0s3.2-1s3.2pl1s3.2pl1-1s0.4s4.0s0.0.4s0.4.0Rs0.4pl1s2.1devs2.1a0s2.1.0rc1s 2.1.0-rc0s2.1.0-as 2.1.0-alphas 2.1.0-foos1.0s1.0-1s1.0.1s1.0as1.0bs1.0devs1.0rc1s1.0pres1.0-as1.0-rc1s 0.80.1-3 0.80.1-2 0.80.1-1 0.79.9999+0.80.0pre4-1 0.79.9999+0.80.0pre2-3 0.79.9999+0.80.0pre2-2 0.77.2-1 0.77.1-1 0.77.0-1 i(RXt enumerate(RRttorturetptv1tv2((Rse/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttestVersionOrderingsL                                  ( RRRRRRRRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRs       tScriptHeaderTestscBs eZdZdZdZRS(s/Users/José/bin/pythoncCstjjd s#ttj r|jtddtjj tj|jtddtjj tj|jtdd|j d|j ndS( Ntjavas#!/usr/local/bin/pythons#!%s s#!/usr/bin/python -xs #!%s -x s#!/usr/bin/pythont executables#!%s -x ( RARt startswithRRR%Rtostpathtnormpatht non_ascii_exe(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttest_get_script_header$s# cCsTtjdkr+tjjddkr+dStj}dt_tj}ztjj tjj t dd}|j t dd |d |tjt_t_|j t d d |d ||jd tjjktjt_t_|j t dd |jd|j|jd tjjkWd|t_|t_XdS(NitLC_CTYPEtCtPOSIXs java1.5.0_13is.pys#!/usr/local/bin/pythonRs#!/usr/bin/env %s s#!/usr/bin/python -xs #!%s -x sUnable to adapt shebang lines#!/usr/bin/pythons#!%s -x (i(NRR(RAt version_infoRtenvironRvR$RtstdoutRRtsplitextt__file__R%RtStringIOtstderrR*tgetvalueR(RRRtexe((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt(test_get_script_header_jython_workaround/s.    &     (RRRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyR!s tNamespaceTestscBs,eZdZdZdZdZRS(cCsytjj|_tjdd|_tjtj j |jdt j |_ t j j tj j |jddS(Ntprefixstests-distribute-s site-pkgs(Rt_namespace_packagestcopyt_ns_pkgsttempfiletmkdtempt_tmpdirRtmakedirsRtjoinRAt_prev_sys_pathtappend(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRhSs  cCs3tj|j|jjt_|jt_ dS(N( tshutiltrmtreeRRRRRRRAR(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttearDownZscCsH||krDdt|t|f}|j|jt|ndS(s4 assertIn and assertTrue does not exist in Python2.3s%s not found in %sN(Rtfailt_formatMessagetmsg(Rtmembert containert standardMsg((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyt _assertIn_s  cCstjjtjj|jdtjtjj|jdddtjtjj|jdddd}xddgD]}ttjj|j|ddd}|j||j ttjj|j|dddd}|j||j qWdd l }|j dt j jydd l}Wn tk r_}|jd nX|j d t j j|jt j dd g|j|jjtjj|jdddtjj|jdddgd S( s Test nested namespace packages Create namespace packages in the following tree : site-packages-1/pkg1/pkg2 site-packages-2/pkg1/pkg2 Check both are in the _namespace_packages dict and that their __path__ is correct s site-pkgs2s site-pkgstpkg1tpkg2s8__import__('pkg_resources').declare_namespace(__name__) s __init__.pytwiNs7Distribute tried to import the parent namespace packages pkg1.pkg2(RARRRRRRtopentwritetcloseRRRRRt pkg1.pkg2t ImportErrorRR%Rt__path__(Rtns_strtsitet pkg1_initt pkg2_initRte((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyttest_two_levels_deepfs0 "%%    (RRRhRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyRQs   (tunittestRRRtsetuptools.command.easy_installRRRRARRRRt NameErrortsetsRtFalseRt EmptyProviderRRR`RRRR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.pyts H  Rf00707010006867d000081a4000000000000000000000001513ff56600000d49000000b500010002ffffffffffffffff0000006900000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m ZddlmZdZd ejfd YZdS( sdevelop tests iN(tStringIO(tDistutilsError(tdevelop(t easy_install(t Distributions0from setuptools import setup setup(name='foo') tTestDevelopTestcBs,eZdZdZdZdZRS(cCstj|_tjj|jd}t|d}|jt|j tj |_ tj |jt jdkrtj|_tjt_tj|_tjt_ndS(Nssetup.pytws2.6(ttempfiletmkdtemptdirtostpathtjointopentwritetSETUP_PYtclosetgetcwdtold_cwdtchdirtsystversiontsitet USER_BASEtold_baset USER_SITEtold_site(tselftsetuptf((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pytsetUps    cCsntj|jtj|jtjdkrjtjtj tjtj |j t_ |j t_ ndS(Ns2.6( R RRtshutiltrmtreeR RRRRRRR(R((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyttearDown$s cCstjdksttdr"dSt}d|_t|}d|_|jtj |_ d|_tj }t t_ z|j Wd|t_ Xtjtj }|j|j|ddgdS(Ns2.6t real_prefixssetup.pyisUNKNOWN.egg-linkseasy-install.pth(RRthasattrRt script_nameRtusertensure_finalizedRRt install_dirtstdoutRtrunR tlistdirtsortt assertEquals(Rtdisttcmdt old_stdouttcontent((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyt test_develop-s"           cCsd}tj}tj|jzOytidgd6}Wn.tk ro}t|}||krpqpnXWdtj|XdS(NsJCould not find suitable distribution for Requirement.parse('I-DONT-EXIST')t I_DONT_EXISTtsetup_requires(R RRR RRtstr(Rtwantedtold_dirR-teterror((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyt test_develop_with_setup_requiresCs    (t__name__t __module__RR!R1R9(((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyRs  (t__doc__RR RRtunittestRRtdistutils.errorsRtsetuptools.command.developRtsetuptools.commandRteasy_install_pkgtsetuptools.distRRtTestCaseR(((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_develop.pyts 0  07070100068688000081ed000000000000000000000001513ff5650000075d000000b500010002ffffffffffffffff0000006c00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.py"""build_ext tests """ import sys, os, shutil, tempfile, unittest, site, zipfile from setuptools.command.upload_docs import upload_docs from setuptools.dist import Distribution SETUP_PY = """\ from setuptools import setup setup(name='foo') """ class TestUploadDocsTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() setup = os.path.join(self.dir, 'setup.py') f = open(setup, 'w') f.write(SETUP_PY) f.close() self.old_cwd = os.getcwd() os.chdir(self.dir) self.upload_dir = os.path.join(self.dir, 'build') os.mkdir(self.upload_dir) # A test document. f = open(os.path.join(self.upload_dir, 'index.html'), 'w') f.write("Hello world.") f.close() # An empty folder. os.mkdir(os.path.join(self.upload_dir, 'empty')) if sys.version >= "2.6": self.old_base = site.USER_BASE site.USER_BASE = upload_docs.USER_BASE = tempfile.mkdtemp() self.old_site = site.USER_SITE site.USER_SITE = upload_docs.USER_SITE = tempfile.mkdtemp() def tearDown(self): os.chdir(self.old_cwd) shutil.rmtree(self.dir) if sys.version >= "2.6": shutil.rmtree(site.USER_BASE) shutil.rmtree(site.USER_SITE) site.USER_BASE = self.old_base site.USER_SITE = self.old_site def test_create_zipfile(self): # Test to make sure zipfile creation handles common cases. # This explicitly includes a folder containing an empty folder. dist = Distribution() cmd = upload_docs(dist) cmd.upload_dir = self.upload_dir zip_file = cmd.create_zipfile() assert zipfile.is_zipfile(zip_file) zip_f = zipfile.ZipFile(zip_file) # woh... assert zip_f.namelist() == ['index.html'] 07070100068680000081ed000000000000000000000001513ff5650000346c000000b500010002ffffffffffffffff0000006d00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.py"""Easy install Tests """ import sys import os import shutil import tempfile import unittest import site import textwrap import tarfile import urlparse import StringIO import distutils.core from setuptools.command.easy_install import easy_install, get_script_args, main from setuptools.command.easy_install import PthDistributions from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution from pkg_resources import Distribution as PRDistribution import setuptools.tests.server try: # import multiprocessing solely for the purpose of testing its existence __import__('multiprocessing') import logging _LOG = logging.getLogger('test_easy_install') logging.basicConfig(level=logging.INFO, stream=sys.stderr) _MULTIPROC = True except ImportError: _MULTIPROC = False _LOG = None class FakeDist(object): def get_entry_map(self, group): if group != 'console_scripts': return {} return {'name': 'ep'} def as_requirement(self): return 'spec' WANTED = """\ #!%s # EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name' __requires__ = 'spec' import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point('spec', 'console_scripts', 'name')() ) """ % sys.executable SETUP_PY = """\ from setuptools import setup setup(name='foo') """ class TestEasyInstallTest(unittest.TestCase): def test_install_site_py(self): dist = Distribution() cmd = easy_install(dist) cmd.sitepy_installed = False cmd.install_dir = tempfile.mkdtemp() try: cmd.install_site_py() sitepy = os.path.join(cmd.install_dir, 'site.py') self.assert_(os.path.exists(sitepy)) finally: shutil.rmtree(cmd.install_dir) def test_get_script_args(self): dist = FakeDist() old_platform = sys.platform try: name, script = [i for i in get_script_args(dist).next()][0:2] finally: sys.platform = old_platform self.assertEquals(script, WANTED) def test_no_setup_cfg(self): # makes sure easy_install as a command (main) # doesn't use a setup.cfg file that is located # in the current working directory dir = tempfile.mkdtemp() setup_cfg = open(os.path.join(dir, 'setup.cfg'), 'w') setup_cfg.write('[easy_install]\nfind_links = http://example.com') setup_cfg.close() setup_py = open(os.path.join(dir, 'setup.py'), 'w') setup_py.write(SETUP_PY) setup_py.close() from setuptools.dist import Distribution def _parse_command_line(self): msg = 'Error: a local setup.cfg was used' opts = self.command_options if 'easy_install' in opts: assert 'find_links' not in opts['easy_install'], msg return self._old_parse_command_line() Distribution._old_parse_command_line = Distribution.parse_command_line Distribution.parse_command_line = _parse_command_line old_wd = os.getcwd() try: os.chdir(dir) main([]) finally: os.chdir(old_wd) shutil.rmtree(dir) Distribution.parse_command_line = Distribution._old_parse_command_line def test_no_find_links(self): # new option '--no-find-links', that blocks find-links added at # the project level dist = Distribution() cmd = easy_install(dist) cmd.check_pth_processing = lambda: True cmd.no_find_links = True cmd.find_links = ['link1', 'link2'] cmd.install_dir = os.path.join(tempfile.mkdtemp(), 'ok') cmd.args = ['ok'] cmd.ensure_finalized() self.assertEquals(cmd.package_index.scanned_urls, {}) # let's try without it (default behavior) cmd = easy_install(dist) cmd.check_pth_processing = lambda: True cmd.find_links = ['link1', 'link2'] cmd.install_dir = os.path.join(tempfile.mkdtemp(), 'ok') cmd.args = ['ok'] cmd.ensure_finalized() keys = cmd.package_index.scanned_urls.keys() keys.sort() self.assertEquals(keys, ['link1', 'link2']) class TestPTHFileWriter(unittest.TestCase): def test_add_from_cwd_site_sets_dirty(self): '''a pth file manager should set dirty if a distribution is in site but also the cwd ''' pth = PthDistributions('does-not_exist', [os.getcwd()]) self.assert_(not pth.dirty) pth.add(PRDistribution(os.getcwd())) self.assert_(pth.dirty) def test_add_from_site_is_ignored(self): if os.name != 'nt': location = '/test/location/does-not-have-to-exist' else: location = 'c:\\does_not_exist' pth = PthDistributions('does-not_exist', [location, ]) self.assert_(not pth.dirty) pth.add(PRDistribution(location)) self.assert_(not pth.dirty) class TestUserInstallTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() setup = os.path.join(self.dir, 'setup.py') f = open(setup, 'w') f.write(SETUP_PY) f.close() self.old_cwd = os.getcwd() os.chdir(self.dir) if sys.version >= "2.6": self.old_has_site = easy_install_pkg.HAS_USER_SITE self.old_file = easy_install_pkg.__file__ self.old_base = site.USER_BASE site.USER_BASE = tempfile.mkdtemp() self.old_site = site.USER_SITE site.USER_SITE = tempfile.mkdtemp() easy_install_pkg.__file__ = site.USER_SITE def tearDown(self): os.chdir(self.old_cwd) shutil.rmtree(self.dir) if sys.version >= "2.6": shutil.rmtree(site.USER_BASE) shutil.rmtree(site.USER_SITE) site.USER_BASE = self.old_base site.USER_SITE = self.old_site easy_install_pkg.HAS_USER_SITE = self.old_has_site easy_install_pkg.__file__ = self.old_file def test_user_install_implied(self): easy_install_pkg.HAS_USER_SITE = True # disabled sometimes #XXX: replace with something meaningfull if sys.version < "2.6": return #SKIP dist = Distribution() dist.script_name = 'setup.py' cmd = easy_install(dist) cmd.args = ['py'] cmd.ensure_finalized() self.assertTrue(cmd.user, 'user should be implied') def test_multiproc_atexit(self): if not _MULTIPROC: return _LOG.info('this should not break') def test_user_install_not_implied_without_usersite_enabled(self): easy_install_pkg.HAS_USER_SITE = False # usually enabled #XXX: replace with something meaningfull if sys.version < "2.6": return #SKIP dist = Distribution() dist.script_name = 'setup.py' cmd = easy_install(dist) cmd.args = ['py'] cmd.initialize_options() self.assertFalse(cmd.user, 'NOT user should be implied') def test_local_index(self): # make sure the local index is used # when easy_install looks for installed # packages new_location = tempfile.mkdtemp() target = tempfile.mkdtemp() egg_file = os.path.join(new_location, 'foo-1.0.egg-info') f = open(egg_file, 'w') try: f.write('Name: foo\n') except: f.close() sys.path.append(target) old_ppath = os.environ.get('PYTHONPATH') os.environ['PYTHONPATH'] = os.path.pathsep.join(sys.path) try: dist = Distribution() dist.script_name = 'setup.py' cmd = easy_install(dist) cmd.install_dir = target cmd.args = ['foo'] cmd.ensure_finalized() cmd.local_index.scan([new_location]) res = cmd.easy_install('foo') self.assertEquals(res.location, new_location) finally: sys.path.remove(target) for basedir in [new_location, target, ]: if not os.path.exists(basedir) or not os.path.isdir(basedir): continue try: shutil.rmtree(basedir) except: pass if old_ppath is not None: os.environ['PYTHONPATH'] = old_ppath else: del os.environ['PYTHONPATH'] class TestSetupRequires(unittest.TestCase): def test_setup_requires_honors_fetch_params(self): """ When easy_install installs a source distribution which specifies setup_requires, it should honor the fetch parameters (such as allow-hosts, index-url, and find-links). """ # set up a server which will simulate an alternate package index. p_index = setuptools.tests.server.MockServer() p_index.start() netloc = 1 p_index_loc = urlparse.urlparse(p_index.url)[netloc] if p_index_loc.endswith(':0'): # Some platforms (Jython) don't find a port to which to bind, # so skip this test for them. return # I realize this is all-but-impossible to read, because it was # ported from some well-factored, safe code using 'with'. If you # need to maintain this code, consider making the changes in # the parent revision (of this comment) and then port the changes # back for Python 2.4 (or deprecate Python 2.4). def install(dist_file): def install_at(temp_install_dir): def install_env(): ei_params = ['--index-url', p_index.url, '--allow-hosts', p_index_loc, '--exclude-scripts', '--install-dir', temp_install_dir, dist_file] def install_clean_reset(): def install_clean_argv(): # attempt to install the dist. It should fail because # it doesn't exist. self.assertRaises(SystemExit, easy_install_pkg.main, ei_params) argv_context(install_clean_argv, ['easy_install']) reset_setup_stop_context(install_clean_reset) environment_context(install_env, PYTHONPATH=temp_install_dir) tempdir_context(install_at) # create an sdist that has a build-time dependency. self.create_sdist(install) # there should have been two or three requests to the server # (three happens on Python 3.3a) self.assert_(2 <= len(p_index.requests) <= 3) self.assertEqual(p_index.requests[0].path, '/does-not-exist/') def create_sdist(self, installer): """ Create an sdist with a setup_requires dependency (of something that doesn't exist) and invoke installer on it. """ def build_sdist(dir): setup_py = tarfile.TarInfo(name="setup.py") try: # Python 3 (StringIO gets converted to io module) MemFile = StringIO.BytesIO except AttributeError: MemFile = StringIO.StringIO setup_py_bytes = MemFile(textwrap.dedent(""" import setuptools setuptools.setup( name="distribute-test-fetcher", version="1.0", setup_requires = ['does-not-exist'], ) """).lstrip().encode('utf-8')) setup_py.size = len(setup_py_bytes.getvalue()) dist_path = os.path.join(dir, 'distribute-test-fetcher-1.0.tar.gz') dist = tarfile.open(dist_path, 'w:gz') try: dist.addfile(setup_py, fileobj=setup_py_bytes) finally: dist.close() installer(dist_path) tempdir_context(build_sdist) def tempdir_context(f, cd=lambda dir:None): """ Invoke f in the context """ temp_dir = tempfile.mkdtemp() orig_dir = os.getcwd() try: cd(temp_dir) f(temp_dir) finally: cd(orig_dir) shutil.rmtree(temp_dir) def environment_context(f, **updates): """ Invoke f in the context """ old_env = os.environ.copy() os.environ.update(updates) try: f() finally: for key in updates: del os.environ[key] os.environ.update(old_env) def argv_context(f, repl): """ Invoke f in the context """ old_argv = sys.argv[:] sys.argv[:] = repl try: f() finally: sys.argv[:] = old_argv def reset_setup_stop_context(f): """ When the distribute tests are run using setup.py test, and then one wants to invoke another setup() command (such as easy_install) within those tests, it's necessary to reset the global variable in distutils.core so that the setup() command will run naturally. """ setup_stop_after = distutils.core._setup_stop_after distutils.core._setup_stop_after = None try: f() finally: distutils.core._setup_stop_after = setup_stop_after 07070100068684000081ed000000000000000000000001513ff56500006065000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_resources.py#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove from unittest import TestCase, makeSuite; from pkg_resources import * from setuptools.command.easy_install import get_script_header, is_sh import os, pkg_resources, sys, StringIO, tempfile, shutil try: frozenset except NameError: from sets import ImmutableSet as frozenset def safe_repr(obj, short=False): """ copied from Python2.7""" try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + ' [truncated]...' class Metadata(EmptyProvider): """Mock object to return metadata as if from an on-disk distribution""" def __init__(self,*pairs): self.metadata = dict(pairs) def has_metadata(self,name): return name in self.metadata def get_metadata(self,name): return self.metadata[name] def get_metadata_lines(self,name): return yield_lines(self.get_metadata(name)) class DistroTests(TestCase): def testCollection(self): # empty path should produce no distributions ad = Environment([], platform=None, python=None) self.assertEqual(list(ad), []) self.assertEqual(ad['FooPkg'],[]) ad.add(Distribution.from_filename("FooPkg-1.3_1.egg")) ad.add(Distribution.from_filename("FooPkg-1.4-py2.4-win32.egg")) ad.add(Distribution.from_filename("FooPkg-1.2-py2.4.egg")) # Name is in there now self.assert_(ad['FooPkg']) # But only 1 package self.assertEqual(list(ad), ['foopkg']) # Distributions sort by version self.assertEqual( [dist.version for dist in ad['FooPkg']], ['1.4','1.3-1','1.2'] ) # Removing a distribution leaves sequence alone ad.remove(ad['FooPkg'][1]) self.assertEqual( [dist.version for dist in ad['FooPkg']], ['1.4','1.2'] ) # And inserting adds them in order ad.add(Distribution.from_filename("FooPkg-1.9.egg")) self.assertEqual( [dist.version for dist in ad['FooPkg']], ['1.9','1.4','1.2'] ) ws = WorkingSet([]) foo12 = Distribution.from_filename("FooPkg-1.2-py2.4.egg") foo14 = Distribution.from_filename("FooPkg-1.4-py2.4-win32.egg") req, = parse_requirements("FooPkg>=1.3") # Nominal case: no distros on path, should yield all applicable self.assertEqual(ad.best_match(req,ws).version, '1.9') # If a matching distro is already installed, should return only that ws.add(foo14); self.assertEqual(ad.best_match(req,ws).version, '1.4') # If the first matching distro is unsuitable, it's a version conflict ws = WorkingSet([]); ws.add(foo12); ws.add(foo14) self.assertRaises(VersionConflict, ad.best_match, req, ws) # If more than one match on the path, the first one takes precedence ws = WorkingSet([]); ws.add(foo14); ws.add(foo12); ws.add(foo14); self.assertEqual(ad.best_match(req,ws).version, '1.4') def checkFooPkg(self,d): self.assertEqual(d.project_name, "FooPkg") self.assertEqual(d.key, "foopkg") self.assertEqual(d.version, "1.3-1") self.assertEqual(d.py_version, "2.4") self.assertEqual(d.platform, "win32") self.assertEqual(d.parsed_version, parse_version("1.3-1")) def testDistroBasics(self): d = Distribution( "/some/path", project_name="FooPkg",version="1.3-1",py_version="2.4",platform="win32" ) self.checkFooPkg(d) d = Distribution("/some/path") self.assertEqual(d.py_version, sys.version[:3]) self.assertEqual(d.platform, None) def testDistroParse(self): d = Distribution.from_filename("FooPkg-1.3_1-py2.4-win32.egg") self.checkFooPkg(d) d = Distribution.from_filename("FooPkg-1.3_1-py2.4-win32.egg-info") self.checkFooPkg(d) def testDistroMetadata(self): d = Distribution( "/some/path", project_name="FooPkg", py_version="2.4", platform="win32", metadata = Metadata( ('PKG-INFO',"Metadata-Version: 1.0\nVersion: 1.3-1\n") ) ) self.checkFooPkg(d) def distRequires(self, txt): return Distribution("/foo", metadata=Metadata(('depends.txt', txt))) def checkRequires(self, dist, txt, extras=()): self.assertEqual( list(dist.requires(extras)), list(parse_requirements(txt)) ) def testDistroDependsSimple(self): for v in "Twisted>=1.5", "Twisted>=1.5\nZConfig>=2.0": self.checkRequires(self.distRequires(v), v) def testResolve(self): ad = Environment([]); ws = WorkingSet([]) # Resolving no requirements -> nothing to install self.assertEqual( list(ws.resolve([],ad)), [] ) # Request something not in the collection -> DistributionNotFound self.assertRaises( DistributionNotFound, ws.resolve, parse_requirements("Foo"), ad ) Foo = Distribution.from_filename( "/foo_dir/Foo-1.2.egg", metadata=Metadata(('depends.txt', "[bar]\nBaz>=2.0")) ) ad.add(Foo); ad.add(Distribution.from_filename("Foo-0.9.egg")) # Request thing(s) that are available -> list to activate for i in range(3): targets = list(ws.resolve(parse_requirements("Foo"), ad)) self.assertEqual(targets, [Foo]) map(ws.add,targets) self.assertRaises(VersionConflict, ws.resolve, parse_requirements("Foo==0.9"), ad) ws = WorkingSet([]) # reset # Request an extra that causes an unresolved dependency for "Baz" self.assertRaises( DistributionNotFound, ws.resolve,parse_requirements("Foo[bar]"), ad ) Baz = Distribution.from_filename( "/foo_dir/Baz-2.1.egg", metadata=Metadata(('depends.txt', "Foo")) ) ad.add(Baz) # Activation list now includes resolved dependency self.assertEqual( list(ws.resolve(parse_requirements("Foo[bar]"), ad)), [Foo,Baz] ) # Requests for conflicting versions produce VersionConflict self.assertRaises( VersionConflict, ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad ) def testDistroDependsOptions(self): d = self.distRequires(""" Twisted>=1.5 [docgen] ZConfig>=2.0 docutils>=0.3 [fastcgi] fcgiapp>=0.1""") self.checkRequires(d,"Twisted>=1.5") self.checkRequires( d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3".split(), ["docgen"] ) self.checkRequires( d,"Twisted>=1.5 fcgiapp>=0.1".split(), ["fastcgi"] ) self.checkRequires( d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1".split(), ["docgen","fastcgi"] ) self.checkRequires( d,"Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3".split(), ["fastcgi", "docgen"] ) self.assertRaises(UnknownExtra, d.requires, ["foo"]) def testSetuptoolsDistributeCombination(self): # Ensure that installing a 0.7-series setuptools fails. PJE says that # it will not co-exist. ws = WorkingSet([]) d = Distribution( "/some/path", project_name="setuptools", version="0.7a1") self.assertRaises(ValueError, ws.add, d) # A 0.6-series is no problem d2 = Distribution( "/some/path", project_name="setuptools", version="0.6c9") ws.add(d2) # a unexisting version needs to work ws = WorkingSet([]) d3 = Distribution( "/some/path", project_name="setuptools") ws.add(d3) class EntryPointTests(TestCase): def assertfields(self, ep): self.assertEqual(ep.name,"foo") self.assertEqual(ep.module_name,"setuptools.tests.test_resources") self.assertEqual(ep.attrs, ("EntryPointTests",)) self.assertEqual(ep.extras, ("x",)) self.assert_(ep.load() is EntryPointTests) self.assertEqual( str(ep), "foo = setuptools.tests.test_resources:EntryPointTests [x]" ) def setUp(self): self.dist = Distribution.from_filename( "FooPkg-1.2-py2.4.egg", metadata=Metadata(('requires.txt','[x]'))) def testBasics(self): ep = EntryPoint( "foo", "setuptools.tests.test_resources", ["EntryPointTests"], ["x"], self.dist ) self.assertfields(ep) def testParse(self): s = "foo = setuptools.tests.test_resources:EntryPointTests [x]" ep = EntryPoint.parse(s, self.dist) self.assertfields(ep) ep = EntryPoint.parse("bar baz= spammity[PING]") self.assertEqual(ep.name,"bar baz") self.assertEqual(ep.module_name,"spammity") self.assertEqual(ep.attrs, ()) self.assertEqual(ep.extras, ("ping",)) ep = EntryPoint.parse(" fizzly = wocka:foo") self.assertEqual(ep.name,"fizzly") self.assertEqual(ep.module_name,"wocka") self.assertEqual(ep.attrs, ("foo",)) self.assertEqual(ep.extras, ()) def testRejects(self): for ep in [ "foo", "x=1=2", "x=a:b:c", "q=x/na", "fez=pish:tush-z", "x=f[a]>2", ]: try: EntryPoint.parse(ep) except ValueError: pass else: raise AssertionError("Should've been bad", ep) def checkSubMap(self, m): self.assertEqual(len(m), len(self.submap_expect)) for key, ep in self.submap_expect.iteritems(): self.assertEqual(repr(m.get(key)), repr(ep)) submap_expect = dict( feature1=EntryPoint('feature1', 'somemodule', ['somefunction']), feature2=EntryPoint('feature2', 'another.module', ['SomeClass'], ['extra1','extra2']), feature3=EntryPoint('feature3', 'this.module', extras=['something']) ) submap_str = """ # define features for blah blah feature1 = somemodule:somefunction feature2 = another.module:SomeClass [extra1,extra2] feature3 = this.module [something] """ def testParseList(self): self.checkSubMap(EntryPoint.parse_group("xyz", self.submap_str)) self.assertRaises(ValueError, EntryPoint.parse_group, "x a", "foo=bar") self.assertRaises(ValueError, EntryPoint.parse_group, "x", ["foo=baz", "foo=bar"]) def testParseMap(self): m = EntryPoint.parse_map({'xyz':self.submap_str}) self.checkSubMap(m['xyz']) self.assertEqual(m.keys(),['xyz']) m = EntryPoint.parse_map("[xyz]\n"+self.submap_str) self.checkSubMap(m['xyz']) self.assertEqual(m.keys(),['xyz']) self.assertRaises(ValueError, EntryPoint.parse_map, ["[xyz]", "[xyz]"]) self.assertRaises(ValueError, EntryPoint.parse_map, self.submap_str) class RequirementsTests(TestCase): def testBasics(self): r = Requirement.parse("Twisted>=1.2") self.assertEqual(str(r),"Twisted>=1.2") self.assertEqual(repr(r),"Requirement.parse('Twisted>=1.2')") self.assertEqual(r, Requirement("Twisted", [('>=','1.2')], ())) self.assertEqual(r, Requirement("twisTed", [('>=','1.2')], ())) self.assertNotEqual(r, Requirement("Twisted", [('>=','2.0')], ())) self.assertNotEqual(r, Requirement("Zope", [('>=','1.2')], ())) self.assertNotEqual(r, Requirement("Zope", [('>=','3.0')], ())) self.assertNotEqual(r, Requirement.parse("Twisted[extras]>=1.2")) def testOrdering(self): r1 = Requirement("Twisted", [('==','1.2c1'),('>=','1.2')], ()) r2 = Requirement("Twisted", [('>=','1.2'),('==','1.2c1')], ()) self.assertEqual(r1,r2) self.assertEqual(str(r1),str(r2)) self.assertEqual(str(r2),"Twisted==1.2c1,>=1.2") def testBasicContains(self): r = Requirement("Twisted", [('>=','1.2')], ()) foo_dist = Distribution.from_filename("FooPkg-1.3_1.egg") twist11 = Distribution.from_filename("Twisted-1.1.egg") twist12 = Distribution.from_filename("Twisted-1.2.egg") self.assert_(parse_version('1.2') in r) self.assert_(parse_version('1.1') not in r) self.assert_('1.2' in r) self.assert_('1.1' not in r) self.assert_(foo_dist not in r) self.assert_(twist11 not in r) self.assert_(twist12 in r) def testAdvancedContains(self): r, = parse_requirements("Foo>=1.2,<=1.3,==1.9,>2.0,!=2.5,<3.0,==4.5") for v in ('1.2','1.2.2','1.3','1.9','2.0.1','2.3','2.6','3.0c1','4.5'): self.assert_(v in r, (v,r)) for v in ('1.2c1','1.3.1','1.5','1.9.1','2.0','2.5','3.0','4.0'): self.assert_(v not in r, (v,r)) def testOptionsAndHashing(self): r1 = Requirement.parse("Twisted[foo,bar]>=1.2") r2 = Requirement.parse("Twisted[bar,FOO]>=1.2") r3 = Requirement.parse("Twisted[BAR,FOO]>=1.2.0") self.assertEqual(r1,r2) self.assertEqual(r1,r3) self.assertEqual(r1.extras, ("foo","bar")) self.assertEqual(r2.extras, ("bar","foo")) # extras are normalized self.assertEqual(hash(r1), hash(r2)) self.assertEqual( hash(r1), hash(("twisted", ((">=",parse_version("1.2")),), frozenset(["foo","bar"]))) ) def testVersionEquality(self): r1 = Requirement.parse("foo==0.3a2") r2 = Requirement.parse("foo!=0.3a4") d = Distribution.from_filename self.assert_(d("foo-0.3a4.egg") not in r1) self.assert_(d("foo-0.3a1.egg") not in r1) self.assert_(d("foo-0.3a4.egg") not in r2) self.assert_(d("foo-0.3a2.egg") in r1) self.assert_(d("foo-0.3a2.egg") in r2) self.assert_(d("foo-0.3a3.egg") in r2) self.assert_(d("foo-0.3a5.egg") in r2) def testDistributeSetuptoolsOverride(self): # Plain setuptools or distribute mean we return distribute. self.assertEqual( Requirement.parse('setuptools').project_name, 'distribute') self.assertEqual( Requirement.parse('distribute').project_name, 'distribute') # setuptools lower than 0.7 means distribute self.assertEqual( Requirement.parse('setuptools==0.6c9').project_name, 'distribute') self.assertEqual( Requirement.parse('setuptools==0.6c10').project_name, 'distribute') self.assertEqual( Requirement.parse('setuptools>=0.6').project_name, 'distribute') self.assertEqual( Requirement.parse('setuptools < 0.7').project_name, 'distribute') # setuptools 0.7 and higher means setuptools. self.assertEqual( Requirement.parse('setuptools == 0.7').project_name, 'setuptools') self.assertEqual( Requirement.parse('setuptools == 0.7a1').project_name, 'setuptools') self.assertEqual( Requirement.parse('setuptools >= 0.7').project_name, 'setuptools') class ParseTests(TestCase): def testEmptyParse(self): self.assertEqual(list(parse_requirements('')), []) def testYielding(self): for inp,out in [ ([], []), ('x',['x']), ([[]],[]), (' x\n y', ['x','y']), (['x\n\n','y'], ['x','y']), ]: self.assertEqual(list(pkg_resources.yield_lines(inp)),out) def testSplitting(self): self.assertEqual( list( pkg_resources.split_sections(""" x [Y] z a [b ] # foo c [ d] [q] v """ ) ), [(None,["x"]), ("Y",["z","a"]), ("b",["c"]), ("d",[]), ("q",["v"])] ) self.assertRaises(ValueError,list,pkg_resources.split_sections("[foo")) def testSafeName(self): self.assertEqual(safe_name("adns-python"), "adns-python") self.assertEqual(safe_name("WSGI Utils"), "WSGI-Utils") self.assertEqual(safe_name("WSGI Utils"), "WSGI-Utils") self.assertEqual(safe_name("Money$$$Maker"), "Money-Maker") self.assertNotEqual(safe_name("peak.web"), "peak-web") def testSafeVersion(self): self.assertEqual(safe_version("1.2-1"), "1.2-1") self.assertEqual(safe_version("1.2 alpha"), "1.2.alpha") self.assertEqual(safe_version("2.3.4 20050521"), "2.3.4.20050521") self.assertEqual(safe_version("Money$$$Maker"), "Money-Maker") self.assertEqual(safe_version("peak.web"), "peak.web") def testSimpleRequirements(self): self.assertEqual( list(parse_requirements('Twis-Ted>=1.2-1')), [Requirement('Twis-Ted',[('>=','1.2-1')], ())] ) self.assertEqual( list(parse_requirements('Twisted >=1.2, \ # more\n<2.0')), [Requirement('Twisted',[('>=','1.2'),('<','2.0')], ())] ) self.assertEqual( Requirement.parse("FooBar==1.99a3"), Requirement("FooBar", [('==','1.99a3')], ()) ) self.assertRaises(ValueError,Requirement.parse,">=2.3") self.assertRaises(ValueError,Requirement.parse,"x\\") self.assertRaises(ValueError,Requirement.parse,"x==2 q") self.assertRaises(ValueError,Requirement.parse,"X==1\nY==2") self.assertRaises(ValueError,Requirement.parse,"#") def testVersionEquality(self): def c(s1,s2): p1, p2 = parse_version(s1),parse_version(s2) self.assertEqual(p1,p2, (s1,s2,p1,p2)) c('0.4', '0.4.0') c('0.4.0.0', '0.4.0') c('0.4.0-0', '0.4-0') c('0pl1', '0.0pl1') c('0pre1', '0.0c1') c('0.0.0preview1', '0c1') c('0.0c1', '0rc1') c('1.2a1', '1.2.a.1'); c('1.2...a', '1.2a') def testVersionOrdering(self): def c(s1,s2): p1, p2 = parse_version(s1),parse_version(s2) self.assert_(p1= (3,) and os.environ.get("LC_CTYPE") in (None, "C", "POSIX")): return platform = sys.platform sys.platform = 'java1.5.0_13' stdout = sys.stdout try: # A mock sys.executable that uses a shebang line (this file) exe = os.path.normpath(os.path.splitext(__file__)[0] + '.py') self.assertEqual( get_script_header('#!/usr/local/bin/python', executable=exe), '#!/usr/bin/env %s\n' % exe) # Ensure we generate what is basically a broken shebang line # when there's options, with a warning emitted sys.stdout = sys.stderr = StringIO.StringIO() self.assertEqual(get_script_header('#!/usr/bin/python -x', executable=exe), '#!%s -x\n' % exe) self.assert_('Unable to adapt shebang line' in sys.stdout.getvalue()) sys.stdout = sys.stderr = StringIO.StringIO() self.assertEqual(get_script_header('#!/usr/bin/python', executable=self.non_ascii_exe), '#!%s -x\n' % self.non_ascii_exe) self.assert_('Unable to adapt shebang line' in sys.stdout.getvalue()) finally: sys.platform = platform sys.stdout = stdout class NamespaceTests(TestCase): def setUp(self): self._ns_pkgs = pkg_resources._namespace_packages.copy() self._tmpdir = tempfile.mkdtemp(prefix="tests-distribute-") os.makedirs(os.path.join(self._tmpdir, "site-pkgs")) self._prev_sys_path = sys.path[:] sys.path.append(os.path.join(self._tmpdir, "site-pkgs")) def tearDown(self): shutil.rmtree(self._tmpdir) pkg_resources._namespace_packages = self._ns_pkgs.copy() sys.path = self._prev_sys_path[:] def _assertIn(self, member, container): """ assertIn and assertTrue does not exist in Python2.3""" if member not in container: standardMsg = '%s not found in %s' % (safe_repr(member), safe_repr(container)) self.fail(self._formatMessage(msg, standardMsg)) def test_two_levels_deep(self): """ Test nested namespace packages Create namespace packages in the following tree : site-packages-1/pkg1/pkg2 site-packages-2/pkg1/pkg2 Check both are in the _namespace_packages dict and that their __path__ is correct """ sys.path.append(os.path.join(self._tmpdir, "site-pkgs2")) os.makedirs(os.path.join(self._tmpdir, "site-pkgs", "pkg1", "pkg2")) os.makedirs(os.path.join(self._tmpdir, "site-pkgs2", "pkg1", "pkg2")) ns_str = "__import__('pkg_resources').declare_namespace(__name__)\n" for site in ["site-pkgs", "site-pkgs2"]: pkg1_init = open(os.path.join(self._tmpdir, site, "pkg1", "__init__.py"), "w") pkg1_init.write(ns_str) pkg1_init.close() pkg2_init = open(os.path.join(self._tmpdir, site, "pkg1", "pkg2", "__init__.py"), "w") pkg2_init.write(ns_str) pkg2_init.close() import pkg1 self._assertIn("pkg1", pkg_resources._namespace_packages.keys()) try: import pkg1.pkg2 except ImportError, e: self.fail("Distribute tried to import the parent namespace package") # check the _namespace_packages dict self._assertIn("pkg1.pkg2", pkg_resources._namespace_packages.keys()) self.assertEqual(pkg_resources._namespace_packages["pkg1"], ["pkg1.pkg2"]) # check the __path__ attribute contains both paths self.assertEqual(pkg1.pkg2.__path__, [ os.path.join(self._tmpdir, "site-pkgs", "pkg1", "pkg2"), os.path.join(self._tmpdir, "site-pkgs2", "pkg1", "pkg2") ]) 07070100068683000081a4000000000000000000000001513ff566000019bb000000b500010002ffffffffffffffff0000006e00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZ ddl m Z dej fdYZ dS(sPackage Index Tests iN(t IndexServertTestPackageIndexcBsPeZdZdZdZdZdZdZdZdZ RS(cCsttjj}d}y|j|}Wn,tk rV}|j|t|knX|jt|tj dS(Ns.http://127.0.0.1:0/nonesuch/test_package_index( t setuptoolst package_indext PackageIndextopen_urlt Exceptiontassert_tstrt isinstanceturllib2t HTTPError(tselftindexturltv((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_bad_url_bad_portscCsztjjdd}d}y|j|}Wn,tk r\}|j|t|knX|jt|tj dS(Nthostsswww.example.comsMurl:%20https://svn.plone.org/svn/collective/inquant.contentmirror.plone/trunk(swww.example.com( RRRRRRRR R R (R R RR((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_bad_url_typos  cCstjjdd}d}tj}|t_d}zRy|j|}Wn,tk rz}|jdt|kn Xt dWd|t_XdS(NRswww.example.comcWsddl}|jddS(Nitline(thttplibt BadStatusLine(targsR((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyt_urlopen-s shttp://example.comRsShould have raise here!(swww.example.com( RRRR turlopenRRRRtAssertionError(R R Rt old_urlopenRR((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_bad_url_bad_status_line(s     cCstjjdd}d}y|j|WnDtjjk rr}t|}d|ksnd|ksntdSXt ddS( sO A bad URL with a double scheme should raise a DistutilsError. Rswww.example.coms2http://http://svn.pythonpaste.org/Paste/wphp/trunksnonnumeric portsgetaddrinfo failedNs Did not raise(swww.example.com( RRRRt distutilsterrorstDistutilsErrortunicodeRt RuntimeError(R R Rterrortmsg((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_bad_url_double_scheme>s   cCs^tjjdd }tjddkrZtjddkrZd}d}|j||ndS( NRswww.example.comiiiishttp://example.coms>(swww.example.com(RRRtsyst version_infot process_index(R R Rtpage((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_bad_url_screwy_hrefPs   &cCs8tjjdd}d}|j|j|tdS(NRswww.example.comsfile:///tmp/test_package_index(swww.example.com(RRRRturl_oktTrue(R R R((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyt test_url_ok]s  cCstjjdrdSt}|j|jd}tjj|}t j j d}|j ||j |jd|k|jt|ddk|jd|ddjkdS(s Download links from the pypi simple index should be used before external download links. http://bitbucket.org/tarek/distribute/issue/163/md5-validation-error Usecase : - someone uploads a package on pypi, a md5 is generated - someone manually copies this link (with the md5 in the url) onto an external page accessible from the package page. - someone reuploads the package (with a different md5) - while easy_installing, an MD5 error occurs because the external link is used -> Distribute should use the link from pypi, not the external one. tjavaNstest_links_priority/simple/tfoobarit correct_md5i(R$tplatformt startswithRtstarttbase_urlRRRt pkg_resourcest Requirementtparset find_packageststopRtlentlocation(R tservert index_urltpit requirement((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_links_priorityds    cCst|jtjjdd |jtjjdd |jtjjdd |jtjjd d dS(Nsreportlab-2.5.win32-py2.4.exes reportlab-2.5s2.4twin32sreportlab-2.5.win32.exes!reportlab-2.5.win-amd64-py2.7.exes2.7s win-amd64sreportlab-2.5.win-amd64.exe(s reportlab-2.5s2.4swin32(s reportlab-2.5Nswin32(s reportlab-2.5s2.7s win-amd64(s reportlab-2.5Ns win-amd64(t assertEqualRRtparse_bdist_wininsttNone(R ((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyttest_parse_bdist_wininsts   ( t__name__t __module__RRRR#R(R+R>RC(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyR s     %(t__doc__R$tunittestR R3Rtdistutils.errorsRtsetuptools.package_indexRR:RtTestCaseR(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_packageindex.pyts       07070100068670000081ed000000000000000000000001513ff5650000306c000000b500010002ffffffffffffffff0000006400000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/__init__.py"""Tests for the 'setuptools' package""" import sys import os import unittest import doctest import distutils.core import distutils.cmd from distutils.errors import DistutilsOptionError, DistutilsPlatformError from distutils.errors import DistutilsSetupError from distutils.core import Extension from distutils.version import LooseVersion import setuptools.dist import setuptools.depends as dep from setuptools import Feature from setuptools.depends import Require def additional_tests(): import doctest, unittest suite = unittest.TestSuite(( doctest.DocFileSuite( os.path.join('tests', 'api_tests.txt'), optionflags=doctest.ELLIPSIS, package='pkg_resources', ), )) if sys.platform == 'win32': suite.addTest(doctest.DocFileSuite('win_script_wrapper.txt')) return suite def makeSetup(**args): """Return distribution from 'setup(**args)', without executing commands""" distutils.core._setup_stop_after = "commandline" # Don't let system command line leak into tests! args.setdefault('script_args',['install']) try: return setuptools.setup(**args) finally: distutils.core_setup_stop_after = None class DependsTests(unittest.TestCase): def testExtractConst(self): if not hasattr(dep, 'extract_constant'): # skip on non-bytecode platforms return def f1(): global x, y, z x = "test" y = z # unrecognized name self.assertEqual(dep.extract_constant(f1.func_code,'q', -1), None) # constant assigned self.assertEqual(dep.extract_constant(f1.func_code,'x', -1), "test") # expression assigned self.assertEqual(dep.extract_constant(f1.func_code,'y', -1), -1) # recognized name, not assigned self.assertEqual(dep.extract_constant(f1.func_code,'z', -1), None) def testFindModule(self): self.assertRaises(ImportError, dep.find_module, 'no-such.-thing') self.assertRaises(ImportError, dep.find_module, 'setuptools.non-existent') f,p,i = dep.find_module('setuptools.tests') f.close() def testModuleExtract(self): if not hasattr(dep, 'get_module_constant'): # skip on non-bytecode platforms return from email import __version__ self.assertEqual( dep.get_module_constant('email','__version__'), __version__ ) self.assertEqual( dep.get_module_constant('sys','version'), sys.version ) self.assertEqual( dep.get_module_constant('setuptools.tests','__doc__'),__doc__ ) def testRequire(self): if not hasattr(dep, 'extract_constant'): # skip on non-bytecode platformsh return req = Require('Email','1.0.3','email') self.assertEqual(req.name, 'Email') self.assertEqual(req.module, 'email') self.assertEqual(req.requested_version, '1.0.3') self.assertEqual(req.attribute, '__version__') self.assertEqual(req.full_name(), 'Email-1.0.3') from email import __version__ self.assertEqual(req.get_version(), __version__) self.assert_(req.version_ok('1.0.9')) self.assert_(not req.version_ok('0.9.1')) self.assert_(not req.version_ok('unknown')) self.assert_(req.is_present()) self.assert_(req.is_current()) req = Require('Email 3000','03000','email',format=LooseVersion) self.assert_(req.is_present()) self.assert_(not req.is_current()) self.assert_(not req.version_ok('unknown')) req = Require('Do-what-I-mean','1.0','d-w-i-m') self.assert_(not req.is_present()) self.assert_(not req.is_current()) req = Require('Tests', None, 'tests', homepage="http://example.com") self.assertEqual(req.format, None) self.assertEqual(req.attribute, None) self.assertEqual(req.requested_version, None) self.assertEqual(req.full_name(), 'Tests') self.assertEqual(req.homepage, 'http://example.com') paths = [os.path.dirname(p) for p in __path__] self.assert_(req.is_present(paths)) self.assert_(req.is_current(paths)) class DistroTests(unittest.TestCase): def setUp(self): self.e1 = Extension('bar.ext',['bar.c']) self.e2 = Extension('c.y', ['y.c']) self.dist = makeSetup( packages=['a', 'a.b', 'a.b.c', 'b', 'c'], py_modules=['b.d','x'], ext_modules = (self.e1, self.e2), package_dir = {}, ) def testDistroType(self): self.assert_(isinstance(self.dist,setuptools.dist.Distribution)) def testExcludePackage(self): self.dist.exclude_package('a') self.assertEqual(self.dist.packages, ['b','c']) self.dist.exclude_package('b') self.assertEqual(self.dist.packages, ['c']) self.assertEqual(self.dist.py_modules, ['x']) self.assertEqual(self.dist.ext_modules, [self.e1, self.e2]) self.dist.exclude_package('c') self.assertEqual(self.dist.packages, []) self.assertEqual(self.dist.py_modules, ['x']) self.assertEqual(self.dist.ext_modules, [self.e1]) # test removals from unspecified options makeSetup().exclude_package('x') def testIncludeExclude(self): # remove an extension self.dist.exclude(ext_modules=[self.e1]) self.assertEqual(self.dist.ext_modules, [self.e2]) # add it back in self.dist.include(ext_modules=[self.e1]) self.assertEqual(self.dist.ext_modules, [self.e2, self.e1]) # should not add duplicate self.dist.include(ext_modules=[self.e1]) self.assertEqual(self.dist.ext_modules, [self.e2, self.e1]) def testExcludePackages(self): self.dist.exclude(packages=['c','b','a']) self.assertEqual(self.dist.packages, []) self.assertEqual(self.dist.py_modules, ['x']) self.assertEqual(self.dist.ext_modules, [self.e1]) def testEmpty(self): dist = makeSetup() dist.include(packages=['a'], py_modules=['b'], ext_modules=[self.e2]) dist = makeSetup() dist.exclude(packages=['a'], py_modules=['b'], ext_modules=[self.e2]) def testContents(self): self.assert_(self.dist.has_contents_for('a')) self.dist.exclude_package('a') self.assert_(not self.dist.has_contents_for('a')) self.assert_(self.dist.has_contents_for('b')) self.dist.exclude_package('b') self.assert_(not self.dist.has_contents_for('b')) self.assert_(self.dist.has_contents_for('c')) self.dist.exclude_package('c') self.assert_(not self.dist.has_contents_for('c')) def testInvalidIncludeExclude(self): self.assertRaises(DistutilsSetupError, self.dist.include, nonexistent_option='x' ) self.assertRaises(DistutilsSetupError, self.dist.exclude, nonexistent_option='x' ) self.assertRaises(DistutilsSetupError, self.dist.include, packages={'x':'y'} ) self.assertRaises(DistutilsSetupError, self.dist.exclude, packages={'x':'y'} ) self.assertRaises(DistutilsSetupError, self.dist.include, ext_modules={'x':'y'} ) self.assertRaises(DistutilsSetupError, self.dist.exclude, ext_modules={'x':'y'} ) self.assertRaises(DistutilsSetupError, self.dist.include, package_dir=['q'] ) self.assertRaises(DistutilsSetupError, self.dist.exclude, package_dir=['q'] ) class FeatureTests(unittest.TestCase): def setUp(self): self.req = Require('Distutils','1.0.3','distutils') self.dist = makeSetup( features={ 'foo': Feature("foo",standard=True,require_features=['baz',self.req]), 'bar': Feature("bar", standard=True, packages=['pkg.bar'], py_modules=['bar_et'], remove=['bar.ext'], ), 'baz': Feature( "baz", optional=False, packages=['pkg.baz'], scripts = ['scripts/baz_it'], libraries=[('libfoo','foo/foofoo.c')] ), 'dwim': Feature("DWIM", available=False, remove='bazish'), }, script_args=['--without-bar', 'install'], packages = ['pkg.bar', 'pkg.foo'], py_modules = ['bar_et', 'bazish'], ext_modules = [Extension('bar.ext',['bar.c'])] ) def testDefaults(self): self.assert_(not Feature( "test",standard=True,remove='x',available=False ).include_by_default() ) self.assert_( Feature("test",standard=True,remove='x').include_by_default() ) # Feature must have either kwargs, removes, or require_features self.assertRaises(DistutilsSetupError, Feature, "test") def testAvailability(self): self.assertRaises( DistutilsPlatformError, self.dist.features['dwim'].include_in, self.dist ) def testFeatureOptions(self): dist = self.dist self.assert_( ('with-dwim',None,'include DWIM') in dist.feature_options ) self.assert_( ('without-dwim',None,'exclude DWIM (default)') in dist.feature_options ) self.assert_( ('with-bar',None,'include bar (default)') in dist.feature_options ) self.assert_( ('without-bar',None,'exclude bar') in dist.feature_options ) self.assertEqual(dist.feature_negopt['without-foo'],'with-foo') self.assertEqual(dist.feature_negopt['without-bar'],'with-bar') self.assertEqual(dist.feature_negopt['without-dwim'],'with-dwim') self.assert_(not 'without-baz' in dist.feature_negopt) def testUseFeatures(self): dist = self.dist self.assertEqual(dist.with_foo,1) self.assertEqual(dist.with_bar,0) self.assertEqual(dist.with_baz,1) self.assert_(not 'bar_et' in dist.py_modules) self.assert_(not 'pkg.bar' in dist.packages) self.assert_('pkg.baz' in dist.packages) self.assert_('scripts/baz_it' in dist.scripts) self.assert_(('libfoo','foo/foofoo.c') in dist.libraries) self.assertEqual(dist.ext_modules,[]) self.assertEqual(dist.require_features, [self.req]) # If we ask for bar, it should fail because we explicitly disabled # it on the command line self.assertRaises(DistutilsOptionError, dist.include_feature, 'bar') def testFeatureWithInvalidRemove(self): self.assertRaises( SystemExit, makeSetup, features = {'x':Feature('x', remove='y')} ) class TestCommandTests(unittest.TestCase): def testTestIsCommand(self): test_cmd = makeSetup().get_command_obj('test') self.assert_(isinstance(test_cmd, distutils.cmd.Command)) def testLongOptSuiteWNoDefault(self): ts1 = makeSetup(script_args=['test','--test-suite=foo.tests.suite']) ts1 = ts1.get_command_obj('test') ts1.ensure_finalized() self.assertEqual(ts1.test_suite, 'foo.tests.suite') def testDefaultSuite(self): ts2 = makeSetup(test_suite='bar.tests.suite').get_command_obj('test') ts2.ensure_finalized() self.assertEqual(ts2.test_suite, 'bar.tests.suite') def testDefaultWModuleOnCmdLine(self): ts3 = makeSetup( test_suite='bar.tests', script_args=['test','-m','foo.tests'] ).get_command_obj('test') ts3.ensure_finalized() self.assertEqual(ts3.test_module, 'foo.tests') self.assertEqual(ts3.test_suite, 'foo.tests.test_suite') def testConflictingOptions(self): ts4 = makeSetup( script_args=['test','-m','bar.tests', '-s','foo.tests.suite'] ).get_command_obj('test') self.assertRaises(DistutilsOptionError, ts4.ensure_finalized) def testNoSuite(self): ts5 = makeSetup().get_command_obj('test') ts5.ensure_finalized() self.assertEqual(ts5.test_suite, None) 0707010006867a000081ed000000000000000000000001513ff565000002a1000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_build_ext.py"""build_ext tests """ import os, shutil, tempfile, unittest from distutils.command.build_ext import build_ext as distutils_build_ext from setuptools.command.build_ext import build_ext from setuptools.dist import Distribution class TestBuildExtTest(unittest.TestCase): def test_get_ext_filename(self): # setuptools needs to give back the same # result than distutils, even if the fullname # is not in ext_map dist = Distribution() cmd = build_ext(dist) cmd.ext_map['foo/bar'] = '' res = cmd.get_ext_filename('foo') wanted = distutils_build_ext.get_ext_filename(cmd, 'foo') assert res == wanted 07070100068678000081ed000000000000000000000001513ff56500000799000000b500010002ffffffffffffffff0000006a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.py"""develop tests """ import sys import os, re, shutil, tempfile, unittest import tempfile import site from StringIO import StringIO from distutils.errors import DistutilsError from setuptools.command.bdist_egg import bdist_egg from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution SETUP_PY = """\ from setuptools import setup setup(name='foo', py_modules=['hi']) """ class TestDevelopTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() self.old_cwd = os.getcwd() os.chdir(self.dir) f = open('setup.py', 'w') f.write(SETUP_PY) f.close() f = open('hi.py', 'w') f.write('1\n') f.close() if sys.version >= "2.6": self.old_base = site.USER_BASE site.USER_BASE = tempfile.mkdtemp() self.old_site = site.USER_SITE site.USER_SITE = tempfile.mkdtemp() def tearDown(self): os.chdir(self.old_cwd) shutil.rmtree(self.dir) if sys.version >= "2.6": shutil.rmtree(site.USER_BASE) shutil.rmtree(site.USER_SITE) site.USER_BASE = self.old_base site.USER_SITE = self.old_site def test_bdist_egg(self): dist = Distribution(dict( script_name='setup.py', script_args=['bdist_egg'], name='foo', py_modules=['hi'] )) os.makedirs(os.path.join('build', 'src')) old_stdout = sys.stdout sys.stdout = o = StringIO() try: dist.parse_command_line() dist.run_commands() finally: sys.stdout = old_stdout # let's see if we got our egg link at the right place [content] = os.listdir('dist') self.assertTrue(re.match('foo-0.0.0-py[23].\d.egg$', content)) def test_suite(): return unittest.makeSuite(TestDevelopTest) 07070100068687000081a4000000000000000000000001513ff56600000d26000000b500010002ffffffffffffffff0000006900000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlmZmZdZ dej fdYZ e dkrej ndS(sdevelop tests iN(tDirectorySandboxtSandboxViolationcCs?tjjdstSytd}Wntk r:tSXtS(sp Run this to determine if the local machine has win32com, and if it does, include additional tests. twin32twin32com(tsystplatformt startswithtFalset __import__t ImportErrortTrue(tmod((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyt has_win32com s t TestSandboxcBsMeZdZdZdZdZeeZerKdZnRS(cCstj|_dS(N(ttempfiletmkdtemptdir(tself((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pytsetUpscCstj|jdS(N(tshutiltrmtreeR(R((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyttearDownscCs?tjdkrdSt|j}|j|jtjdS(Ns2.4(RtversionRRtrunt _file_writertostdevnull(Rtsandbox((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyt test_devnull scsfd}|S(Ncs*td}|jd|jdS(Ntwtxxx(topentwritetclose(tf(tpath(sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pytdo_write's ((R#R$((R#sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyR&scCsddl}|j}tjj|d}t|j}z?y|j|j|Wnt k rv|j dnXWdtjj |rtj |nXdS(sm win32com should not be prevented from caching COM interfaces in gen_py. iNt test_writes4Could not create gen_py file due to SandboxViolation( Rt __gen_path__RR#tjoinRRRRRtfailtexiststremove(RRtgen_pyttargetR((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyt test_win32com0s   ( t__name__t __module__RRRRt staticmethodR R-(((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyR s      t__main__(t__doc__RRRtunittestRtsetuptools.sandboxRRR tTestCaseR R.tmain(((sc/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_sandbox.pyts      ) 07070100068672000081ed000000000000000000000001513ff56500018592000000b500010002ffffffffffffffff0000006300000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/doctest.py# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! try: basestring except NameError: basestring = str,unicode try: enumerate except NameError: def enumerate(seq): return zip(range(len(seq)),seq) r"""Module doctest -- a framework for running examples in docstrings. In simplest use, end each module M to be tested with: def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test() Then running the module as a script will cause the examples in the docstrings to get executed and verified: python M.py This won't display anything unless an example fails, in which case the failing example(s) and the cause(s) of the failure(s) are printed to stdout (why not stderr? because stderr is a lame hack <0.2 wink>), and the final line of output is "Test failed.". Run it with the -v switch instead: python M.py -v and a detailed report of all examples tried is printed to stdout, along with assorted summaries at the end. You can force verbose mode by passing "verbose=True" to testmod, or prohibit it by passing "verbose=False". In either of those cases, sys.argv is not examined by testmod. There are a variety of other ways to run doctests, including integration with the unittest framework, and support for running non-Python text files containing doctests. There are also many ways to override parts of doctest's default behaviors. See the Library Reference Manual for details. """ __docformat__ = 'reStructuredText en' __all__ = [ # 0, Option Flags 'register_optionflag', 'DONT_ACCEPT_TRUE_FOR_1', 'DONT_ACCEPT_BLANKLINE', 'NORMALIZE_WHITESPACE', 'ELLIPSIS', 'IGNORE_EXCEPTION_DETAIL', 'COMPARISON_FLAGS', 'REPORT_UDIFF', 'REPORT_CDIFF', 'REPORT_NDIFF', 'REPORT_ONLY_FIRST_FAILURE', 'REPORTING_FLAGS', # 1. Utility Functions 'is_private', # 2. Example & DocTest 'Example', 'DocTest', # 3. Doctest Parser 'DocTestParser', # 4. Doctest Finder 'DocTestFinder', # 5. Doctest Runner 'DocTestRunner', 'OutputChecker', 'DocTestFailure', 'UnexpectedException', 'DebugRunner', # 6. Test Functions 'testmod', 'testfile', 'run_docstring_examples', # 7. Tester 'Tester', # 8. Unittest Support 'DocTestSuite', 'DocFileSuite', 'set_unittest_reportflags', # 9. Debugging Support 'script_from_examples', 'testsource', 'debug_src', 'debug', ] import __future__ import sys, traceback, inspect, linecache, os, re, types import unittest, difflib, pdb, tempfile import warnings from StringIO import StringIO # Don't whine about the deprecated is_private function in this # module's tests. warnings.filterwarnings("ignore", "is_private", DeprecationWarning, __name__, 0) # There are 4 basic classes: # - Example: a pair, plus an intra-docstring line number. # - DocTest: a collection of examples, parsed from a docstring, plus # info about where the docstring came from (name, filename, lineno). # - DocTestFinder: extracts DocTests from a given object's docstring and # its contained objects' docstrings. # - DocTestRunner: runs DocTest cases, and accumulates statistics. # # So the basic picture is: # # list of: # +------+ +---------+ +-------+ # |object| --DocTestFinder-> | DocTest | --DocTestRunner-> |results| # +------+ +---------+ +-------+ # | Example | # | ... | # | Example | # +---------+ # Option constants. OPTIONFLAGS_BY_NAME = {} def register_optionflag(name): flag = 1 << len(OPTIONFLAGS_BY_NAME) OPTIONFLAGS_BY_NAME[name] = flag return flag DONT_ACCEPT_TRUE_FOR_1 = register_optionflag('DONT_ACCEPT_TRUE_FOR_1') DONT_ACCEPT_BLANKLINE = register_optionflag('DONT_ACCEPT_BLANKLINE') NORMALIZE_WHITESPACE = register_optionflag('NORMALIZE_WHITESPACE') ELLIPSIS = register_optionflag('ELLIPSIS') IGNORE_EXCEPTION_DETAIL = register_optionflag('IGNORE_EXCEPTION_DETAIL') COMPARISON_FLAGS = (DONT_ACCEPT_TRUE_FOR_1 | DONT_ACCEPT_BLANKLINE | NORMALIZE_WHITESPACE | ELLIPSIS | IGNORE_EXCEPTION_DETAIL) REPORT_UDIFF = register_optionflag('REPORT_UDIFF') REPORT_CDIFF = register_optionflag('REPORT_CDIFF') REPORT_NDIFF = register_optionflag('REPORT_NDIFF') REPORT_ONLY_FIRST_FAILURE = register_optionflag('REPORT_ONLY_FIRST_FAILURE') REPORTING_FLAGS = (REPORT_UDIFF | REPORT_CDIFF | REPORT_NDIFF | REPORT_ONLY_FIRST_FAILURE) # Special string markers for use in `want` strings: BLANKLINE_MARKER = '' ELLIPSIS_MARKER = '...' ###################################################################### ## Table of Contents ###################################################################### # 1. Utility Functions # 2. Example & DocTest -- store test cases # 3. DocTest Parser -- extracts examples from strings # 4. DocTest Finder -- extracts test cases from objects # 5. DocTest Runner -- runs test cases # 6. Test Functions -- convenient wrappers for testing # 7. Tester Class -- for backwards compatibility # 8. Unittest Support # 9. Debugging Support # 10. Example Usage ###################################################################### ## 1. Utility Functions ###################################################################### def is_private(prefix, base): """prefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this protocol may make use of it). Return true iff base begins with an (at least one) underscore, but does not both begin and end with (at least) two underscores. >>> is_private("a.b", "my_func") False >>> is_private("____", "_my_func") True >>> is_private("someclass", "__init__") False >>> is_private("sometypo", "__init_") True >>> is_private("x.y.z", "_") True >>> is_private("_x.y.z", "__") False >>> is_private("", "") # senseless but consistent False """ warnings.warn("is_private is deprecated; it wasn't useful; " "examine DocTestFinder.find() lists instead", DeprecationWarning, stacklevel=2) return base[:1] == "_" and not base[:2] == "__" == base[-2:] def _extract_future_flags(globs): """ Return the compiler-flags associated with the future features that have been imported into the given namespace (globs). """ flags = 0 for fname in __future__.all_feature_names: feature = globs.get(fname, None) if feature is getattr(__future__, fname): flags |= feature.compiler_flag return flags def _normalize_module(module, depth=2): """ Return the module specified by `module`. In particular: - If `module` is a module, then return module. - If `module` is a string, then import and return the module with that name. - If `module` is None, then return the calling module. The calling module is assumed to be the module of the stack frame at the given depth in the call stack. """ if inspect.ismodule(module): return module elif isinstance(module, (str, unicode)): return __import__(module, globals(), locals(), ["*"]) elif module is None: return sys.modules[sys._getframe(depth).f_globals['__name__']] else: raise TypeError("Expected a module, string, or None") def _indent(s, indent=4): """ Add the given number of space characters to the beginning every non-blank line in `s`, and return the result. """ # This regexp matches the start of non-blank lines: return re.sub('(?m)^(?!$)', indent*' ', s) def _exception_traceback(exc_info): """ Return a string containing a traceback message for the given exc_info tuple (as returned by sys.exc_info()). """ # Get a traceback message. excout = StringIO() exc_type, exc_val, exc_tb = exc_info traceback.print_exception(exc_type, exc_val, exc_tb, file=excout) return excout.getvalue() # Override some StringIO methods. class _SpoofOut(StringIO): def getvalue(self): result = StringIO.getvalue(self) # If anything at all was written, make sure there's a trailing # newline. There's no way for the expected output to indicate # that a trailing newline is missing. if result and not result.endswith("\n"): result += "\n" # Prevent softspace from screwing up the next test case, in # case they used print with a trailing comma in an example. if hasattr(self, "softspace"): del self.softspace return result def truncate(self, size=None): StringIO.truncate(self, size) if hasattr(self, "softspace"): del self.softspace # Worst-case linear-time ellipsis matching. def _ellipsis_match(want, got): """ Essentially the only subtle case: >>> _ellipsis_match('aa...aa', 'aaa') False """ if want.find(ELLIPSIS_MARKER)==-1: return want == got # Find "the real" strings. ws = want.split(ELLIPSIS_MARKER) assert len(ws) >= 2 # Deal with exact matches possibly needed at one or both ends. startpos, endpos = 0, len(got) w = ws[0] if w: # starts with exact match if got.startswith(w): startpos = len(w) del ws[0] else: return False w = ws[-1] if w: # ends with exact match if got.endswith(w): endpos -= len(w) del ws[-1] else: return False if startpos > endpos: # Exact end matches required more characters than we have, as in # _ellipsis_match('aa...aa', 'aaa') return False # For the rest, we only need to find the leftmost non-overlapping # match for each piece. If there's no overall match that way alone, # there's no overall match period. for w in ws: # w may be '' at times, if there are consecutive ellipses, or # due to an ellipsis at the start or end of `want`. That's OK. # Search for an empty string succeeds, and doesn't change startpos. startpos = got.find(w, startpos, endpos) if startpos < 0: return False startpos += len(w) return True def _comment_line(line): "Return a commented form of the given line" line = line.rstrip() if line: return '# '+line else: return '#' class _OutputRedirectingPdb(pdb.Pdb): """ A specialized version of the python debugger that redirects stdout to a given stream when interacting with the user. Stdout is *not* redirected when traced code is executed. """ def __init__(self, out): self.__out = out pdb.Pdb.__init__(self) def trace_dispatch(self, *args): # Redirect stdout to the given stream. save_stdout = sys.stdout sys.stdout = self.__out # Call Pdb's trace dispatch method. try: return pdb.Pdb.trace_dispatch(self, *args) finally: sys.stdout = save_stdout # [XX] Normalize with respect to os.path.pardir? def _module_relative_path(module, path): if not inspect.ismodule(module): raise TypeError, 'Expected a module: %r' % module if path.startswith('/'): raise ValueError, 'Module-relative files may not have absolute paths' # Find the base directory for the path. if hasattr(module, '__file__'): # A normal module/package basedir = os.path.split(module.__file__)[0] elif module.__name__ == '__main__': # An interactive session. if len(sys.argv)>0 and sys.argv[0] != '': basedir = os.path.split(sys.argv[0])[0] else: basedir = os.curdir else: # A module w/o __file__ (this includes builtins) raise ValueError("Can't resolve paths relative to the module " + module + " (it has no __file__)") # Combine the base directory and the path. return os.path.join(basedir, *(path.split('/'))) ###################################################################### ## 2. Example & DocTest ###################################################################### ## - An "example" is a pair, where "source" is a ## fragment of source code, and "want" is the expected output for ## "source." The Example class also includes information about ## where the example was extracted from. ## ## - A "doctest" is a collection of examples, typically extracted from ## a string (such as an object's docstring). The DocTest class also ## includes information about where the string was extracted from. class Example: """ A single doctest example, consisting of source code and expected output. `Example` defines the following attributes: - source: A single Python statement, always ending with a newline. The constructor adds a newline if needed. - want: The expected output from running the source code (either from stdout, or a traceback in case of exception). `want` ends with a newline unless it's empty, in which case it's an empty string. The constructor adds a newline if needed. - exc_msg: The exception message generated by the example, if the example is expected to generate an exception; or `None` if it is not expected to generate an exception. This exception message is compared against the return value of `traceback.format_exception_only()`. `exc_msg` ends with a newline unless it's `None`. The constructor adds a newline if needed. - lineno: The line number within the DocTest string containing this Example where the Example begins. This line number is zero-based, with respect to the beginning of the DocTest. - indent: The example's indentation in the DocTest string. I.e., the number of space characters that preceed the example's first prompt. - options: A dictionary mapping from option flags to True or False, which is used to override default options for this example. Any option flags not contained in this dictionary are left at their default value (as specified by the DocTestRunner's optionflags). By default, no options are set. """ def __init__(self, source, want, exc_msg=None, lineno=0, indent=0, options=None): # Normalize inputs. if not source.endswith('\n'): source += '\n' if want and not want.endswith('\n'): want += '\n' if exc_msg is not None and not exc_msg.endswith('\n'): exc_msg += '\n' # Store properties. self.source = source self.want = want self.lineno = lineno self.indent = indent if options is None: options = {} self.options = options self.exc_msg = exc_msg class DocTest: """ A collection of doctest examples that should be run in a single namespace. Each `DocTest` defines the following attributes: - examples: the list of examples. - globs: The namespace (aka globals) that the examples should be run in. - name: A name identifying the DocTest (typically, the name of the object whose docstring this DocTest was extracted from). - filename: The name of the file that this DocTest was extracted from, or `None` if the filename is unknown. - lineno: The line number within filename where this DocTest begins, or `None` if the line number is unavailable. This line number is zero-based, with respect to the beginning of the file. - docstring: The string that the examples were extracted from, or `None` if the string is unavailable. """ def __init__(self, examples, globs, name, filename, lineno, docstring): """ Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`. """ assert not isinstance(examples, basestring), \ "DocTest no longer accepts str; use DocTestParser instead" self.examples = examples self.docstring = docstring self.globs = globs.copy() self.name = name self.filename = filename self.lineno = lineno def __repr__(self): if len(self.examples) == 0: examples = 'no examples' elif len(self.examples) == 1: examples = '1 example' else: examples = '%d examples' % len(self.examples) return ('' % (self.name, self.filename, self.lineno, examples)) # This lets us sort tests by name: def __cmp__(self, other): if not isinstance(other, DocTest): return -1 return cmp((self.name, self.filename, self.lineno, id(self)), (other.name, other.filename, other.lineno, id(other))) ###################################################################### ## 3. DocTestParser ###################################################################### class DocTestParser: """ A class used to parse strings containing doctest examples. """ # This regular expression is used to find doctest examples in a # string. It defines three groups: `source` is the source code # (including leading indentation and prompts); `indent` is the # indentation of the first (PS1) line of the source code; and # `want` is the expected output (including leading indentation). _EXAMPLE_RE = re.compile(r''' # Source consists of a PS1 line followed by zero or more PS2 lines. (?P (?:^(?P [ ]*) >>> .*) # PS1 line (?:\n [ ]* \.\.\. .*)*) # PS2 lines \n? # Want consists of any non-blank lines that do not start with PS1. (?P (?:(?![ ]*$) # Not a blank line (?![ ]*>>>) # Not a line starting with PS1 .*$\n? # But any other line )*) ''', re.MULTILINE | re.VERBOSE) # A regular expression for handling `want` strings that contain # expected exceptions. It divides `want` into three pieces: # - the traceback header line (`hdr`) # - the traceback stack (`stack`) # - the exception message (`msg`), as generated by # traceback.format_exception_only() # `msg` may have multiple lines. We assume/require that the # exception message is the first non-indented line starting with a word # character following the traceback header line. _EXCEPTION_RE = re.compile(r""" # Grab the traceback header. Different versions of Python have # said different things on the first traceback line. ^(?P Traceback\ \( (?: most\ recent\ call\ last | innermost\ last ) \) : ) \s* $ # toss trailing whitespace on the header. (?P .*?) # don't blink: absorb stuff until... ^ (?P \w+ .*) # a line *starts* with alphanum. """, re.VERBOSE | re.MULTILINE | re.DOTALL) # A callable returning a true value iff its argument is a blank line # or contains a single comment. _IS_BLANK_OR_COMMENT = re.compile(r'^[ ]*(#.*)?$').match def parse(self, string, name=''): """ Divide the given string into examples and intervening text, and return them as a list of alternating Examples and strings. Line numbers for the Examples are 0-based. The optional argument `name` is a name identifying this string, and is only used for error messages. """ string = string.expandtabs() # If all lines begin with the same indentation, then strip it. min_indent = self._min_indent(string) if min_indent > 0: string = '\n'.join([l[min_indent:] for l in string.split('\n')]) output = [] charno, lineno = 0, 0 # Find all doctest examples in the string: for m in self._EXAMPLE_RE.finditer(string): # Add the pre-example text to `output`. output.append(string[charno:m.start()]) # Update lineno (lines before this example) lineno += string.count('\n', charno, m.start()) # Extract info from the regexp match. (source, options, want, exc_msg) = \ self._parse_example(m, name, lineno) # Create an Example, and add it to the list. if not self._IS_BLANK_OR_COMMENT(source): output.append( Example(source, want, exc_msg, lineno=lineno, indent=min_indent+len(m.group('indent')), options=options) ) # Update lineno (lines inside this example) lineno += string.count('\n', m.start(), m.end()) # Update charno. charno = m.end() # Add any remaining post-example text to `output`. output.append(string[charno:]) return output def get_doctest(self, string, globs, name, filename, lineno): """ Extract all doctest examples from the given string, and collect them into a `DocTest` object. `globs`, `name`, `filename`, and `lineno` are attributes for the new `DocTest` object. See the documentation for `DocTest` for more information. """ return DocTest(self.get_examples(string, name), globs, name, filename, lineno, string) def get_examples(self, string, name=''): """ Extract all doctest examples from the given string, and return them as a list of `Example` objects. Line numbers are 0-based, because it's most common in doctests that nothing interesting appears on the same line as opening triple-quote, and so the first interesting line is called \"line 1\" then. The optional argument `name` is a name identifying this string, and is only used for error messages. """ return [x for x in self.parse(string, name) if isinstance(x, Example)] def _parse_example(self, m, name, lineno): """ Given a regular expression match from `_EXAMPLE_RE` (`m`), return a pair `(source, want)`, where `source` is the matched example's source code (with prompts and indentation stripped); and `want` is the example's expected output (with indentation stripped). `name` is the string's name, and `lineno` is the line number where the example starts; both are used for error messages. """ # Get the example's indentation level. indent = len(m.group('indent')) # Divide source into lines; check that they're properly # indented; and then strip their indentation & prompts. source_lines = m.group('source').split('\n') self._check_prompt_blank(source_lines, indent, name, lineno) self._check_prefix(source_lines[1:], ' '*indent + '.', name, lineno) source = '\n'.join([sl[indent+4:] for sl in source_lines]) # Divide want into lines; check that it's properly indented; and # then strip the indentation. Spaces before the last newline should # be preserved, so plain rstrip() isn't good enough. want = m.group('want') want_lines = want.split('\n') if len(want_lines) > 1 and re.match(r' *$', want_lines[-1]): del want_lines[-1] # forget final newline & spaces after it self._check_prefix(want_lines, ' '*indent, name, lineno + len(source_lines)) want = '\n'.join([wl[indent:] for wl in want_lines]) # If `want` contains a traceback message, then extract it. m = self._EXCEPTION_RE.match(want) if m: exc_msg = m.group('msg') else: exc_msg = None # Extract options from the source. options = self._find_options(source, name, lineno) return source, options, want, exc_msg # This regular expression looks for option directives in the # source code of an example. Option directives are comments # starting with "doctest:". Warning: this may give false # positives for string-literals that contain the string # "#doctest:". Eliminating these false positives would require # actually parsing the string; but we limit them by ignoring any # line containing "#doctest:" that is *followed* by a quote mark. _OPTION_DIRECTIVE_RE = re.compile(r'#\s*doctest:\s*([^\n\'"]*)$', re.MULTILINE) def _find_options(self, source, name, lineno): """ Return a dictionary containing option overrides extracted from option directives in the given source string. `name` is the string's name, and `lineno` is the line number where the example starts; both are used for error messages. """ options = {} # (note: with the current regexp, this will match at most once:) for m in self._OPTION_DIRECTIVE_RE.finditer(source): option_strings = m.group(1).replace(',', ' ').split() for option in option_strings: if (option[0] not in '+-' or option[1:] not in OPTIONFLAGS_BY_NAME): raise ValueError('line %r of the doctest for %s ' 'has an invalid option: %r' % (lineno+1, name, option)) flag = OPTIONFLAGS_BY_NAME[option[1:]] options[flag] = (option[0] == '+') if options and self._IS_BLANK_OR_COMMENT(source): raise ValueError('line %r of the doctest for %s has an option ' 'directive on a line with no example: %r' % (lineno, name, source)) return options # This regular expression finds the indentation of every non-blank # line in a string. _INDENT_RE = re.compile('^([ ]*)(?=\S)', re.MULTILINE) def _min_indent(self, s): "Return the minimum indentation of any non-blank line in `s`" indents = [len(indent) for indent in self._INDENT_RE.findall(s)] if len(indents) > 0: return min(indents) else: return 0 def _check_prompt_blank(self, lines, indent, name, lineno): """ Given the lines of a source string (including prompts and leading indentation), check to make sure that every prompt is followed by a space character. If any line is not followed by a space character, then raise ValueError. """ for i, line in enumerate(lines): if len(line) >= indent+4 and line[indent+3] != ' ': raise ValueError('line %r of the docstring for %s ' 'lacks blank after %s: %r' % (lineno+i+1, name, line[indent:indent+3], line)) def _check_prefix(self, lines, prefix, name, lineno): """ Check that every line in the given list starts with the given prefix; if any line does not, then raise a ValueError. """ for i, line in enumerate(lines): if line and not line.startswith(prefix): raise ValueError('line %r of the docstring for %s has ' 'inconsistent leading whitespace: %r' % (lineno+i+1, name, line)) ###################################################################### ## 4. DocTest Finder ###################################################################### class DocTestFinder: """ A class used to extract the DocTests that are relevant to a given object, from its docstring and the docstrings of its contained objects. Doctests can currently be extracted from the following object types: modules, functions, classes, methods, staticmethods, classmethods, and properties. """ def __init__(self, verbose=False, parser=DocTestParser(), recurse=True, _namefilter=None, exclude_empty=True): """ Create a new doctest finder. The optional argument `parser` specifies a class or function that should be used to create new DocTest objects (or objects that implement the same interface as DocTest). The signature for this factory function should match the signature of the DocTest constructor. If the optional argument `recurse` is false, then `find` will only examine the given object, and not any contained objects. If the optional argument `exclude_empty` is false, then `find` will include tests for objects with empty docstrings. """ self._parser = parser self._verbose = verbose self._recurse = recurse self._exclude_empty = exclude_empty # _namefilter is undocumented, and exists only for temporary backward- # compatibility support of testmod's deprecated isprivate mess. self._namefilter = _namefilter def find(self, obj, name=None, module=None, globs=None, extraglobs=None): """ Return a list of the DocTests that are defined by the given object's docstring, or by any of its contained objects' docstrings. The optional parameter `module` is the module that contains the given object. If the module is not specified or is None, then the test finder will attempt to automatically determine the correct module. The object's module is used: - As a default namespace, if `globs` is not specified. - To prevent the DocTestFinder from extracting DocTests from objects that are imported from other modules. - To find the name of the file containing the object. - To help find the line number of the object within its file. Contained objects whose module does not match `module` are ignored. If `module` is False, no attempt to find the module will be made. This is obscure, of use mostly in tests: if `module` is False, or is None but cannot be found automatically, then all objects are considered to belong to the (non-existent) module, so all contained objects will (recursively) be searched for doctests. The globals for each DocTest is formed by combining `globs` and `extraglobs` (bindings in `extraglobs` override bindings in `globs`). A new copy of the globals dictionary is created for each DocTest. If `globs` is not specified, then it defaults to the module's `__dict__`, if specified, or {} otherwise. If `extraglobs` is not specified, then it defaults to {}. """ # If name was not specified, then extract it from the object. if name is None: name = getattr(obj, '__name__', None) if name is None: raise ValueError("DocTestFinder.find: name must be given " "when obj.__name__ doesn't exist: %r" % (type(obj),)) # Find the module that contains the given object (if obj is # a module, then module=obj.). Note: this may fail, in which # case module will be None. if module is False: module = None elif module is None: module = inspect.getmodule(obj) # Read the module's source code. This is used by # DocTestFinder._find_lineno to find the line number for a # given object's docstring. try: file = inspect.getsourcefile(obj) or inspect.getfile(obj) source_lines = linecache.getlines(file) if not source_lines: source_lines = None except TypeError: source_lines = None # Initialize globals, and merge in extraglobs. if globs is None: if module is None: globs = {} else: globs = module.__dict__.copy() else: globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) # Recursively expore `obj`, extracting DocTests. tests = [] self._find(tests, obj, name, module, source_lines, globs, {}) return tests def _filter(self, obj, prefix, base): """ Return true if the given object should not be examined. """ return (self._namefilter is not None and self._namefilter(prefix, base)) def _from_module(self, module, object): """ Return true if the given object is defined in the given module. """ if module is None: return True elif inspect.isfunction(object): return module.__dict__ is object.func_globals elif inspect.isclass(object): return module.__name__ == object.__module__ elif inspect.getmodule(object) is not None: return module is inspect.getmodule(object) elif hasattr(object, '__module__'): return module.__name__ == object.__module__ elif isinstance(object, property): return True # [XX] no way not be sure. else: raise ValueError("object must be a class or function") def _find(self, tests, obj, name, module, source_lines, globs, seen): """ Find tests for the given object and any contained objects, and add them to `tests`. """ if self._verbose: print 'Finding tests in %s' % name # If we've already processed this object, then ignore it. if id(obj) in seen: return seen[id(obj)] = 1 # Find a test for this object, and add it to the list of tests. test = self._get_test(obj, name, module, globs, source_lines) if test is not None: tests.append(test) # Look for tests in a module's contained objects. if inspect.ismodule(obj) and self._recurse: for valname, val in obj.__dict__.items(): # Check if this contained object should be ignored. if self._filter(val, name, valname): continue valname = '%s.%s' % (name, valname) # Recurse to functions & classes. if ((inspect.isfunction(val) or inspect.isclass(val)) and self._from_module(module, val)): self._find(tests, val, valname, module, source_lines, globs, seen) # Look for tests in a module's __test__ dictionary. if inspect.ismodule(obj) and self._recurse: for valname, val in getattr(obj, '__test__', {}).items(): if not isinstance(valname, basestring): raise ValueError("DocTestFinder.find: __test__ keys " "must be strings: %r" % (type(valname),)) if not (inspect.isfunction(val) or inspect.isclass(val) or inspect.ismethod(val) or inspect.ismodule(val) or isinstance(val, basestring)): raise ValueError("DocTestFinder.find: __test__ values " "must be strings, functions, methods, " "classes, or modules: %r" % (type(val),)) valname = '%s.__test__.%s' % (name, valname) self._find(tests, val, valname, module, source_lines, globs, seen) # Look for tests in a class's contained objects. if inspect.isclass(obj) and self._recurse: for valname, val in obj.__dict__.items(): # Check if this contained object should be ignored. if self._filter(val, name, valname): continue # Special handling for staticmethod/classmethod. if isinstance(val, staticmethod): val = getattr(obj, valname) if isinstance(val, classmethod): val = getattr(obj, valname).im_func # Recurse to methods, properties, and nested classes. if ((inspect.isfunction(val) or inspect.isclass(val) or isinstance(val, property)) and self._from_module(module, val)): valname = '%s.%s' % (name, valname) self._find(tests, val, valname, module, source_lines, globs, seen) def _get_test(self, obj, name, module, globs, source_lines): """ Return a DocTest for the given object, if it defines a docstring; otherwise, return None. """ # Extract the object's docstring. If it doesn't have one, # then return None (no test for this object). if isinstance(obj, basestring): docstring = obj else: try: if obj.__doc__ is None: docstring = '' else: docstring = obj.__doc__ if not isinstance(docstring, basestring): docstring = str(docstring) except (TypeError, AttributeError): docstring = '' # Find the docstring's location in the file. lineno = self._find_lineno(obj, source_lines) # Don't bother if the docstring is empty. if self._exclude_empty and not docstring: return None # Return a DocTest for this object. if module is None: filename = None else: filename = getattr(module, '__file__', module.__name__) if filename[-4:] in (".pyc", ".pyo"): filename = filename[:-1] return self._parser.get_doctest(docstring, globs, name, filename, lineno) def _find_lineno(self, obj, source_lines): """ Return a line number of the given object's docstring. Note: this method assumes that the object has a docstring. """ lineno = None # Find the line number for modules. if inspect.ismodule(obj): lineno = 0 # Find the line number for classes. # Note: this could be fooled if a class is defined multiple # times in a single file. if inspect.isclass(obj): if source_lines is None: return None pat = re.compile(r'^\s*class\s*%s\b' % getattr(obj, '__name__', '-')) for i, line in enumerate(source_lines): if pat.match(line): lineno = i break # Find the line number for functions & methods. if inspect.ismethod(obj): obj = obj.im_func if inspect.isfunction(obj): obj = obj.func_code if inspect.istraceback(obj): obj = obj.tb_frame if inspect.isframe(obj): obj = obj.f_code if inspect.iscode(obj): lineno = getattr(obj, 'co_firstlineno', None)-1 # Find the line number where the docstring starts. Assume # that it's the first line that begins with a quote mark. # Note: this could be fooled by a multiline function # signature, where a continuation line begins with a quote # mark. if lineno is not None: if source_lines is None: return lineno+1 pat = re.compile('(^|.*:)\s*\w*("|\')') for lineno in range(lineno, len(source_lines)): if pat.match(source_lines[lineno]): return lineno # We couldn't find the line number. return None ###################################################################### ## 5. DocTest Runner ###################################################################### class DocTestRunner: """ A class used to run DocTest test cases, and accumulate statistics. The `run` method is used to process a single DocTest case. It returns a tuple `(f, t)`, where `t` is the number of test cases tried, and `f` is the number of test cases that failed. >>> tests = DocTestFinder().find(_TestClass) >>> runner = DocTestRunner(verbose=False) >>> for test in tests: ... print runner.run(test) (0, 2) (0, 1) (0, 2) (0, 2) The `summarize` method prints a summary of all the test cases that have been run by the runner, and returns an aggregated `(f, t)` tuple: >>> runner.summarize(verbose=1) 4 items passed all tests: 2 tests in _TestClass 2 tests in _TestClass.__init__ 2 tests in _TestClass.get 1 tests in _TestClass.square 7 tests in 4 items. 7 passed and 0 failed. Test passed. (0, 7) The aggregated number of tried examples and failed examples is also available via the `tries` and `failures` attributes: >>> runner.tries 7 >>> runner.failures 0 The comparison between expected outputs and actual outputs is done by an `OutputChecker`. This comparison may be customized with a number of option flags; see the documentation for `testmod` for more information. If the option flags are insufficient, then the comparison may also be customized by passing a subclass of `OutputChecker` to the constructor. The test runner's display output can be controlled in two ways. First, an output function (`out) can be passed to `TestRunner.run`; this function will be called with strings that should be displayed. It defaults to `sys.stdout.write`. If capturing the output is not sufficient, then the display output can be also customized by subclassing DocTestRunner, and overriding the methods `report_start`, `report_success`, `report_unexpected_exception`, and `report_failure`. """ # This divider string is used to separate failure messages, and to # separate sections of the summary. DIVIDER = "*" * 70 def __init__(self, checker=None, verbose=None, optionflags=0): """ Create a new test runner. Optional keyword arg `checker` is the `OutputChecker` that should be used to compare the expected outputs and actual outputs of doctest examples. Optional keyword arg 'verbose' prints lots of stuff if true, only failures if false; by default, it's true iff '-v' is in sys.argv. Optional argument `optionflags` can be used to control how the test runner compares expected output to actual output, and how it displays failures. See the documentation for `testmod` for more information. """ self._checker = checker or OutputChecker() if verbose is None: verbose = '-v' in sys.argv self._verbose = verbose self.optionflags = optionflags self.original_optionflags = optionflags # Keep track of the examples we've run. self.tries = 0 self.failures = 0 self._name2ft = {} # Create a fake output target for capturing doctest output. self._fakeout = _SpoofOut() #///////////////////////////////////////////////////////////////// # Reporting methods #///////////////////////////////////////////////////////////////// def report_start(self, out, test, example): """ Report that the test runner is about to process the given example. (Only displays a message if verbose=True) """ if self._verbose: if example.want: out('Trying:\n' + _indent(example.source) + 'Expecting:\n' + _indent(example.want)) else: out('Trying:\n' + _indent(example.source) + 'Expecting nothing\n') def report_success(self, out, test, example, got): """ Report that the given example ran successfully. (Only displays a message if verbose=True) """ if self._verbose: out("ok\n") def report_failure(self, out, test, example, got): """ Report that the given example failed. """ out(self._failure_header(test, example) + self._checker.output_difference(example, got, self.optionflags)) def report_unexpected_exception(self, out, test, example, exc_info): """ Report that the given example raised an unexpected exception. """ out(self._failure_header(test, example) + 'Exception raised:\n' + _indent(_exception_traceback(exc_info))) def _failure_header(self, test, example): out = [self.DIVIDER] if test.filename: if test.lineno is not None and example.lineno is not None: lineno = test.lineno + example.lineno + 1 else: lineno = '?' out.append('File "%s", line %s, in %s' % (test.filename, lineno, test.name)) else: out.append('Line %s, in %s' % (example.lineno+1, test.name)) out.append('Failed example:') source = example.source out.append(_indent(source)) return '\n'.join(out) #///////////////////////////////////////////////////////////////// # DocTest Running #///////////////////////////////////////////////////////////////// def __run(self, test, compileflags, out): """ Run the examples in `test`. Write the outcome of each example with one of the `DocTestRunner.report_*` methods, using the writer function `out`. `compileflags` is the set of compiler flags that should be used to execute examples. Return a tuple `(f, t)`, where `t` is the number of examples tried, and `f` is the number of examples that failed. The examples are run in the namespace `test.globs`. """ # Keep track of the number of failures and tries. failures = tries = 0 # Save the option flags (since option directives can be used # to modify them). original_optionflags = self.optionflags SUCCESS, FAILURE, BOOM = range(3) # `outcome` state check = self._checker.check_output # Process each example. for examplenum, example in enumerate(test.examples): # If REPORT_ONLY_FIRST_FAILURE is set, then supress # reporting after the first failure. quiet = (self.optionflags & REPORT_ONLY_FIRST_FAILURE and failures > 0) # Merge in the example's options. self.optionflags = original_optionflags if example.options: for (optionflag, val) in example.options.items(): if val: self.optionflags |= optionflag else: self.optionflags &= ~optionflag # Record that we started this example. tries += 1 if not quiet: self.report_start(out, test, example) # Use a special filename for compile(), so we can retrieve # the source code during interactive debugging (see # __patched_linecache_getlines). filename = '' % (test.name, examplenum) # Run the example in the given context (globs), and record # any exception that gets raised. (But don't intercept # keyboard interrupts.) try: # Don't blink! This is where the user's code gets run. exec compile(example.source, filename, "single", compileflags, 1) in test.globs self.debugger.set_continue() # ==== Example Finished ==== exception = None except KeyboardInterrupt: raise except: exception = sys.exc_info() self.debugger.set_continue() # ==== Example Finished ==== got = self._fakeout.getvalue() # the actual output self._fakeout.truncate(0) outcome = FAILURE # guilty until proved innocent or insane # If the example executed without raising any exceptions, # verify its output. if exception is None: if check(example.want, got, self.optionflags): outcome = SUCCESS # The example raised an exception: check if it was expected. else: exc_info = sys.exc_info() exc_msg = traceback.format_exception_only(*exc_info[:2])[-1] if not quiet: got += _exception_traceback(exc_info) # If `example.exc_msg` is None, then we weren't expecting # an exception. if example.exc_msg is None: outcome = BOOM # We expected an exception: see whether it matches. elif check(example.exc_msg, exc_msg, self.optionflags): outcome = SUCCESS # Another chance if they didn't care about the detail. elif self.optionflags & IGNORE_EXCEPTION_DETAIL: m1 = re.match(r'[^:]*:', example.exc_msg) m2 = re.match(r'[^:]*:', exc_msg) if m1 and m2 and check(m1.group(0), m2.group(0), self.optionflags): outcome = SUCCESS # Report the outcome. if outcome is SUCCESS: if not quiet: self.report_success(out, test, example, got) elif outcome is FAILURE: if not quiet: self.report_failure(out, test, example, got) failures += 1 elif outcome is BOOM: if not quiet: self.report_unexpected_exception(out, test, example, exc_info) failures += 1 else: assert False, ("unknown outcome", outcome) # Restore the option flags (in case they were modified) self.optionflags = original_optionflags # Record and return the number of failures and tries. self.__record_outcome(test, failures, tries) return failures, tries def __record_outcome(self, test, f, t): """ Record the fact that the given DocTest (`test`) generated `f` failures out of `t` tried examples. """ f2, t2 = self._name2ft.get(test.name, (0,0)) self._name2ft[test.name] = (f+f2, t+t2) self.failures += f self.tries += t __LINECACHE_FILENAME_RE = re.compile(r'[\w\.]+)' r'\[(?P\d+)\]>$') def __patched_linecache_getlines(self, filename, module_globals=None): m = self.__LINECACHE_FILENAME_RE.match(filename) if m and m.group('name') == self.test.name: example = self.test.examples[int(m.group('examplenum'))] return example.source.splitlines(True) elif self.save_linecache_getlines.func_code.co_argcount>1: return self.save_linecache_getlines(filename, module_globals) else: return self.save_linecache_getlines(filename) def run(self, test, compileflags=None, out=None, clear_globs=True): """ Run the examples in `test`, and display the results using the writer function `out`. The examples are run in the namespace `test.globs`. If `clear_globs` is true (the default), then this namespace will be cleared after the test runs, to help with garbage collection. If you would like to examine the namespace after the test completes, then use `clear_globs=False`. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. The output of each example is checked using `DocTestRunner.check_output`, and the results are formatted by the `DocTestRunner.report_*` methods. """ self.test = test if compileflags is None: compileflags = _extract_future_flags(test.globs) save_stdout = sys.stdout if out is None: out = save_stdout.write sys.stdout = self._fakeout # Patch pdb.set_trace to restore sys.stdout during interactive # debugging (so it's not still redirected to self._fakeout). # Note that the interactive output will go to *our* # save_stdout, even if that's not the real sys.stdout; this # allows us to write test cases for the set_trace behavior. save_set_trace = pdb.set_trace self.debugger = _OutputRedirectingPdb(save_stdout) self.debugger.reset() pdb.set_trace = self.debugger.set_trace # Patch linecache.getlines, so we can see the example's source # when we're inside the debugger. self.save_linecache_getlines = linecache.getlines linecache.getlines = self.__patched_linecache_getlines try: return self.__run(test, compileflags, out) finally: sys.stdout = save_stdout pdb.set_trace = save_set_trace linecache.getlines = self.save_linecache_getlines if clear_globs: test.globs.clear() #///////////////////////////////////////////////////////////////// # Summarization #///////////////////////////////////////////////////////////////// def summarize(self, verbose=None): """ Print a summary of all the test cases that have been run by this DocTestRunner, and return a tuple `(f, t)`, where `f` is the total number of failed examples, and `t` is the total number of tried examples. The optional `verbose` argument controls how detailed the summary is. If the verbosity is not specified, then the DocTestRunner's verbosity is used. """ if verbose is None: verbose = self._verbose notests = [] passed = [] failed = [] totalt = totalf = 0 for x in self._name2ft.items(): name, (f, t) = x assert f <= t totalt += t totalf += f if t == 0: notests.append(name) elif f == 0: passed.append( (name, t) ) else: failed.append(x) if verbose: if notests: print len(notests), "items had no tests:" notests.sort() for thing in notests: print " ", thing if passed: print len(passed), "items passed all tests:" passed.sort() for thing, count in passed: print " %3d tests in %s" % (count, thing) if failed: print self.DIVIDER print len(failed), "items had failures:" failed.sort() for thing, (f, t) in failed: print " %3d of %3d in %s" % (f, t, thing) if verbose: print totalt, "tests in", len(self._name2ft), "items." print totalt - totalf, "passed and", totalf, "failed." if totalf: print "***Test Failed***", totalf, "failures." elif verbose: print "Test passed." return totalf, totalt #///////////////////////////////////////////////////////////////// # Backward compatibility cruft to maintain doctest.master. #///////////////////////////////////////////////////////////////// def merge(self, other): d = self._name2ft for name, (f, t) in other._name2ft.items(): if name in d: print "*** DocTestRunner.merge: '" + name + "' in both" \ " testers; summing outcomes." f2, t2 = d[name] f = f + f2 t = t + t2 d[name] = f, t class OutputChecker: """ A class used to check the whether the actual output from a doctest example matches the expected output. `OutputChecker` defines two methods: `check_output`, which compares a given pair of outputs, and returns true if they match; and `output_difference`, which returns a string describing the differences between two outputs. """ def check_output(self, want, got, optionflags): """ Return True iff the actual output from an example (`got`) matches the expected output (`want`). These strings are always considered to match if they are identical; but depending on what option flags the test runner is using, several non-exact match types are also possible. See the documentation for `TestRunner` for more information about option flags. """ # Handle the common case first, for efficiency: # if they're string-identical, always return true. if got == want: return True # The values True and False replaced 1 and 0 as the return # value for boolean comparisons in Python 2.3. if not (optionflags & DONT_ACCEPT_TRUE_FOR_1): if (got,want) == ("True\n", "1\n"): return True if (got,want) == ("False\n", "0\n"): return True # can be used as a special sequence to signify a # blank line, unless the DONT_ACCEPT_BLANKLINE flag is used. if not (optionflags & DONT_ACCEPT_BLANKLINE): # Replace in want with a blank line. want = re.sub('(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER), '', want) # If a line in got contains only spaces, then remove the # spaces. got = re.sub('(?m)^\s*?$', '', got) if got == want: return True # This flag causes doctest to ignore any differences in the # contents of whitespace strings. Note that this can be used # in conjunction with the ELLIPSIS flag. if optionflags & NORMALIZE_WHITESPACE: got = ' '.join(got.split()) want = ' '.join(want.split()) if got == want: return True # The ELLIPSIS flag says to let the sequence "..." in `want` # match any substring in `got`. if optionflags & ELLIPSIS: if _ellipsis_match(want, got): return True # We didn't find any match; return false. return False # Should we do a fancy diff? def _do_a_fancy_diff(self, want, got, optionflags): # Not unless they asked for a fancy diff. if not optionflags & (REPORT_UDIFF | REPORT_CDIFF | REPORT_NDIFF): return False # If expected output uses ellipsis, a meaningful fancy diff is # too hard ... or maybe not. In two real-life failures Tim saw, # a diff was a major help anyway, so this is commented out. # [todo] _ellipsis_match() knows which pieces do and don't match, # and could be the basis for a kick-ass diff in this case. ##if optionflags & ELLIPSIS and ELLIPSIS_MARKER in want: ## return False # ndiff does intraline difference marking, so can be useful even # for 1-line differences. if optionflags & REPORT_NDIFF: return True # The other diff types need at least a few lines to be helpful. return want.count('\n') > 2 and got.count('\n') > 2 def output_difference(self, example, got, optionflags): """ Return a string describing the differences between the expected output for a given example (`example`) and the actual output (`got`). `optionflags` is the set of option flags used to compare `want` and `got`. """ want = example.want # If s are being used, then replace blank lines # with in the actual output string. if not (optionflags & DONT_ACCEPT_BLANKLINE): got = re.sub('(?m)^[ ]*(?=\n)', BLANKLINE_MARKER, got) # Check if we should use diff. if self._do_a_fancy_diff(want, got, optionflags): # Split want & got into lines. want_lines = want.splitlines(True) # True == keep line ends got_lines = got.splitlines(True) # Use difflib to find their differences. if optionflags & REPORT_UDIFF: diff = difflib.unified_diff(want_lines, got_lines, n=2) diff = list(diff)[2:] # strip the diff header kind = 'unified diff with -expected +actual' elif optionflags & REPORT_CDIFF: diff = difflib.context_diff(want_lines, got_lines, n=2) diff = list(diff)[2:] # strip the diff header kind = 'context diff with expected followed by actual' elif optionflags & REPORT_NDIFF: engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK) diff = list(engine.compare(want_lines, got_lines)) kind = 'ndiff with -expected +actual' else: assert 0, 'Bad diff option' # Remove trailing whitespace on diff output. diff = [line.rstrip() + '\n' for line in diff] return 'Differences (%s):\n' % kind + _indent(''.join(diff)) # If we're not using diff, then simply list the expected # output followed by the actual output. if want and got: return 'Expected:\n%sGot:\n%s' % (_indent(want), _indent(got)) elif want: return 'Expected:\n%sGot nothing\n' % _indent(want) elif got: return 'Expected nothing\nGot:\n%s' % _indent(got) else: return 'Expected nothing\nGot nothing\n' class DocTestFailure(Exception): """A DocTest example has failed in debugging mode. The exception instance has variables: - test: the DocTest object being run - excample: the Example object that failed - got: the actual output """ def __init__(self, test, example, got): self.test = test self.example = example self.got = got def __str__(self): return str(self.test) class UnexpectedException(Exception): """A DocTest example has encountered an unexpected exception The exception instance has variables: - test: the DocTest object being run - excample: the Example object that failed - exc_info: the exception info """ def __init__(self, test, example, exc_info): self.test = test self.example = example self.exc_info = exc_info def __str__(self): return str(self.test) class DebugRunner(DocTestRunner): r"""Run doc tests but raise an exception as soon as there is a failure. If an unexpected exception occurs, an UnexpectedException is raised. It contains the test, the example, and the original exception: >>> runner = DebugRunner(verbose=False) >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except UnexpectedException, failure: ... pass >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError We wrap the original exception to give the calling application access to the test and example information. If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' If a failure or error occurs, the globals are left intact: >>> del test.globs['__builtins__'] >>> test.globs {'x': 1} >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... >>> raise KeyError ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) Traceback (most recent call last): ... UnexpectedException: >>> del test.globs['__builtins__'] >>> test.globs {'x': 2} But the globals are cleared if there is no error: >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) (0, 1) >>> test.globs {} """ def run(self, test, compileflags=None, out=None, clear_globs=True): r = DocTestRunner.run(self, test, compileflags, out, False) if clear_globs: test.globs.clear() return r def report_unexpected_exception(self, out, test, example, exc_info): raise UnexpectedException(test, example, exc_info) def report_failure(self, out, test, example, got): raise DocTestFailure(test, example, got) ###################################################################### ## 6. Test Functions ###################################################################### # These should be backwards compatible. # For backward compatibility, a global instance of a DocTestRunner # class, updated by testmod. master = None def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False): """m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), starting with m.__doc__. Unless isprivate is specified, private names are not skipped. Also test examples reachable from dict m.__test__ if it exists and is not None. m.__test__ maps names to functions, classes and strings; function and class docstrings are tested even if the name is private; strings are tested directly, as if they were docstrings. Return (#failures, #tests). See doctest.__doc__ for an overview. Optional keyword arg "name" gives the name of the module; by default use m.__name__. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use m.__dict__. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. This is new in 2.4. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. This is new in 2.3. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Deprecated in Python 2.4: Optional keyword arg "isprivate" specifies a function used to determine whether a name is private. The default function is treat all functions as public. Optionally, "isprivate" can be set to doctest.is_private to skip over functions marked as private using the underscore naming convention; see its docs for details. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. """ global master if isprivate is not None: warnings.warn("the isprivate argument is deprecated; " "examine DocTestFinder.find() lists instead", DeprecationWarning) # If no module was given, then use __main__. if m is None: # DWA - m will still be None if this wasn't invoked from the command # line, in which case the following TypeError is about as good an error # as we should expect m = sys.modules.get('__main__') # Check that we were actually given a module. if not inspect.ismodule(m): raise TypeError("testmod: module required; %r" % (m,)) # If no name was given, then use the module's name. if name is None: name = m.__name__ # Find, parse, and run all tests in the given module. finder = DocTestFinder(_namefilter=isprivate, exclude_empty=exclude_empty) if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) else: runner = DocTestRunner(verbose=verbose, optionflags=optionflags) for test in finder.find(m, name, globs=globs, extraglobs=extraglobs): runner.run(test) if report: runner.summarize() if master is None: master = runner else: master.merge(runner) return runner.failures, runner.tries def testfile(filename, module_relative=True, name=None, package=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, parser=DocTestParser()): """ Test examples in the given file. Return (#failures, #tests). Optional keyword arg "module_relative" specifies how filenames should be interpreted: - If "module_relative" is True (the default), then "filename" specifies a module-relative path. By default, this path is relative to the calling module's directory; but if the "package" argument is specified, then it is relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and should not be an absolute path (i.e., it may not begin with "/"). - If "module_relative" is False, then "filename" specifies an os-specific path. The path may be absolute or relative (to the current working directory). Optional keyword arg "name" gives the name of the test; by default use the file's basename. Optional keyword argument "package" is a Python package or the name of a Python package whose directory should be used as the base directory for a module relative filename. If no package is specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use {}. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Optional keyword arg "parser" specifies a DocTestParser (or subclass) that should be used to extract tests from the files. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. """ global master if package and not module_relative: raise ValueError("Package may only be specified for module-" "relative paths.") # Relativize the path if module_relative: package = _normalize_module(package) filename = _module_relative_path(package, filename) # If no name was given, then use the file's name. if name is None: name = os.path.basename(filename) # Assemble the globals. if globs is None: globs = {} else: globs = globs.copy() if extraglobs is not None: globs.update(extraglobs) if raise_on_error: runner = DebugRunner(verbose=verbose, optionflags=optionflags) else: runner = DocTestRunner(verbose=verbose, optionflags=optionflags) # Read the file, convert it to a test, and run it. s = open(filename).read() test = parser.get_doctest(s, globs, name, filename, 0) runner.run(test) if report: runner.summarize() if master is None: master = runner else: master.merge(runner) return runner.failures, runner.tries def run_docstring_examples(f, globs, verbose=False, name="NoName", compileflags=None, optionflags=0): """ Test examples in the given object's docstring (`f`), using `globs` as globals. Optional argument `name` is used in failure messages. If the optional argument `verbose` is true, then generate output even if there are no failures. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. Optional keyword arg `optionflags` specifies options for the testing and output. See the documentation for `testmod` for more information. """ # Find, parse, and run all tests in the given module. finder = DocTestFinder(verbose=verbose, recurse=False) runner = DocTestRunner(verbose=verbose, optionflags=optionflags) for test in finder.find(f, name, globs=globs): runner.run(test, compileflags=compileflags) ###################################################################### ## 7. Tester ###################################################################### # This is provided only for backwards compatibility. It's not # actually used in any way. class Tester: def __init__(self, mod=None, globs=None, verbose=None, isprivate=None, optionflags=0): warnings.warn("class Tester is deprecated; " "use class doctest.DocTestRunner instead", DeprecationWarning, stacklevel=2) if mod is None and globs is None: raise TypeError("Tester.__init__: must specify mod or globs") if mod is not None and not inspect.ismodule(mod): raise TypeError("Tester.__init__: mod must be a module; %r" % (mod,)) if globs is None: globs = mod.__dict__ self.globs = globs self.verbose = verbose self.isprivate = isprivate self.optionflags = optionflags self.testfinder = DocTestFinder(_namefilter=isprivate) self.testrunner = DocTestRunner(verbose=verbose, optionflags=optionflags) def runstring(self, s, name): test = DocTestParser().get_doctest(s, self.globs, name, None, None) if self.verbose: print "Running string", name (f,t) = self.testrunner.run(test) if self.verbose: print f, "of", t, "examples failed in string", name return (f,t) def rundoc(self, object, name=None, module=None): f = t = 0 tests = self.testfinder.find(object, name, module=module, globs=self.globs) for test in tests: (f2, t2) = self.testrunner.run(test) (f,t) = (f+f2, t+t2) return (f,t) def rundict(self, d, name, module=None): import types m = types.ModuleType(name) m.__dict__.update(d) if module is None: module = False return self.rundoc(m, name, module) def run__test__(self, d, name): import types m = types.ModuleType(name) m.__test__ = d return self.rundoc(m, name) def summarize(self, verbose=None): return self.testrunner.summarize(verbose) def merge(self, other): self.testrunner.merge(other.testrunner) ###################################################################### ## 8. Unittest Support ###################################################################### _unittest_reportflags = 0 def set_unittest_reportflags(flags): """Sets the unittest option flags. The old flag is returned so that a runner could restore the old value if it wished to: >>> old = _unittest_reportflags >>> set_unittest_reportflags(REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) == old True >>> import doctest >>> doctest._unittest_reportflags == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True Only reporting flags can be set: >>> set_unittest_reportflags(ELLIPSIS) Traceback (most recent call last): ... ValueError: ('Only reporting flags allowed', 8) >>> set_unittest_reportflags(old) == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True """ global _unittest_reportflags if (flags & REPORTING_FLAGS) != flags: raise ValueError("Only reporting flags allowed", flags) old = _unittest_reportflags _unittest_reportflags = flags return old class DocTestCase(unittest.TestCase): def __init__(self, test, optionflags=0, setUp=None, tearDown=None, checker=None): unittest.TestCase.__init__(self) self._dt_optionflags = optionflags self._dt_checker = checker self._dt_test = test self._dt_setUp = setUp self._dt_tearDown = tearDown def setUp(self): test = self._dt_test if self._dt_setUp is not None: self._dt_setUp(test) def tearDown(self): test = self._dt_test if self._dt_tearDown is not None: self._dt_tearDown(test) test.globs.clear() def runTest(self): test = self._dt_test old = sys.stdout new = StringIO() optionflags = self._dt_optionflags if not (optionflags & REPORTING_FLAGS): # The option flags don't include any reporting flags, # so add the default reporting flags optionflags |= _unittest_reportflags runner = DocTestRunner(optionflags=optionflags, checker=self._dt_checker, verbose=False) try: runner.DIVIDER = "-"*70 failures, tries = runner.run( test, out=new.write, clear_globs=False) finally: sys.stdout = old if failures: raise self.failureException(self.format_failure(new.getvalue())) def format_failure(self, err): test = self._dt_test if test.lineno is None: lineno = 'unknown line number' else: lineno = '%s' % test.lineno lname = '.'.join(test.name.split('.')[-1:]) return ('Failed doctest test for %s\n' ' File "%s", line %s, in %s\n\n%s' % (test.name, test.filename, lineno, lname, err) ) def debug(self): r"""Run the test case without results and without catching exceptions The unit test framework includes a debug method on test cases and test suites to support post-mortem debugging. The test code is run in such a way that errors are not caught. This way a caller can catch the errors and initiate post-mortem debugging. The DocTestCase provides a debug method that raises UnexpectedException errors if there is an unexepcted exception: >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except UnexpectedException, failure: ... pass The UnexpectedException contains the test, the example, and the original exception: >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' """ self.setUp() runner = DebugRunner(optionflags=self._dt_optionflags, checker=self._dt_checker, verbose=False) runner.run(self._dt_test) self.tearDown() def id(self): return self._dt_test.name def __repr__(self): name = self._dt_test.name.split('.') return "%s (%s)" % (name[-1], '.'.join(name[:-1])) __str__ = __repr__ def shortDescription(self): return "Doctest: " + self._dt_test.name def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, **options): """ Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test case fails. An exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. The `module` argument provides the module to be tested. The argument can be either a module or a module name. If no argument is given, the calling module is used. A number of options may be provided as keyword arguments: setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. """ if test_finder is None: test_finder = DocTestFinder() module = _normalize_module(module) tests = test_finder.find(module, globs=globs, extraglobs=extraglobs) if globs is None: globs = module.__dict__ if not tests: # Why do we want to do this? Because it reveals a bug that might # otherwise be hidden. raise ValueError(module, "has no tests") tests.sort() suite = unittest.TestSuite() for test in tests: if len(test.examples) == 0: continue if not test.filename: filename = module.__file__ if filename[-4:] in (".pyc", ".pyo"): filename = filename[:-1] test.filename = filename suite.addTest(DocTestCase(test, **options)) return suite class DocFileCase(DocTestCase): def id(self): return '_'.join(self._dt_test.name.split('.')) def __repr__(self): return self._dt_test.filename __str__ = __repr__ def format_failure(self, err): return ('Failed doctest test for %s\n File "%s", line 0\n\n%s' % (self._dt_test.name, self._dt_test.filename, err) ) def DocFileTest(path, module_relative=True, package=None, globs=None, parser=DocTestParser(), **options): if globs is None: globs = {} if package and not module_relative: raise ValueError("Package may only be specified for module-" "relative paths.") # Relativize the path. if module_relative: package = _normalize_module(package) path = _module_relative_path(package, path) # Find the file and read it. name = os.path.basename(path) doc = open(path).read() # Convert it to a test, and wrap it in a DocFileCase. test = parser.get_doctest(doc, globs, name, path, 0) return DocFileCase(test, **options) def DocFileSuite(*paths, **kw): """A unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is True, then the given file paths are interpreted as os-independent module-relative paths. By default, these paths are relative to the calling module's directory; but if the "package" argument is specified, then they are relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and may not be an absolute path (i.e., it may not begin with "/"). If "module_relative" is False, then the given file paths are interpreted as os-specific paths. These paths may be absolute or relative (to the current working directory). package A Python package or the name of a Python package whose directory should be used as the base directory for module relative paths. If "package" is not specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. parser A DocTestParser (or subclass) that should be used to extract tests from the files. """ suite = unittest.TestSuite() # We do this here so that _normalize_module is called at the right # level. If it were called in DocFileTest, then this function # would be the caller and we might guess the package incorrectly. if kw.get('module_relative', True): kw['package'] = _normalize_module(kw.get('package')) for path in paths: suite.addTest(DocFileTest(path, **kw)) return suite ###################################################################### ## 9. Debugging Support ###################################################################### def script_from_examples(s): r"""Extract script from text with examples. Converts text with examples to a Python script. Example input is converted to regular code. Example output and all other words are converted to comments: >>> text = ''' ... Here are examples of simple math. ... ... Python has super accurate integer addition ... ... >>> 2 + 2 ... 5 ... ... And very friendly error messages: ... ... >>> 1/0 ... To Infinity ... And ... Beyond ... ... You can use logic if you want: ... ... >>> if 0: ... ... blah ... ... blah ... ... ... ... Ho hum ... ''' >>> print script_from_examples(text) # Here are examples of simple math. # # Python has super accurate integer addition # 2 + 2 # Expected: ## 5 # # And very friendly error messages: # 1/0 # Expected: ## To Infinity ## And ## Beyond # # You can use logic if you want: # if 0: blah blah # # Ho hum """ output = [] for piece in DocTestParser().parse(s): if isinstance(piece, Example): # Add the example's source code (strip trailing NL) output.append(piece.source[:-1]) # Add the expected output: want = piece.want if want: output.append('# Expected:') output += ['## '+l for l in want.split('\n')[:-1]] else: # Add non-example text. output += [_comment_line(l) for l in piece.split('\n')[:-1]] # Trim junk on both ends. while output and output[-1] == '#': output.pop() while output and output[0] == '#': output.pop(0) # Combine the output, and return it. return '\n'.join(output) def testsource(module, name): """Extract the test sources from a doctest docstring as a script. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the doc string with tests to be debugged. """ module = _normalize_module(module) tests = DocTestFinder().find(module) test = [t for t in tests if t.name == name] if not test: raise ValueError(name, "not found in tests") test = test[0] testsrc = script_from_examples(test.docstring) return testsrc def debug_src(src, pm=False, globs=None): """Debug a single doctest docstring, in argument `src`'""" testsrc = script_from_examples(src) debug_script(testsrc, pm, globs) def debug_script(src, pm=False, globs=None): "Debug a test script. `src` is the script, as a string." import pdb # Note that tempfile.NameTemporaryFile() cannot be used. As the # docs say, a file so created cannot be opened by name a second time # on modern Windows boxes, and execfile() needs to open it. srcfilename = tempfile.mktemp(".py", "doctestdebug") f = open(srcfilename, 'w') f.write(src) f.close() try: if globs: globs = globs.copy() else: globs = {} if pm: try: execfile(srcfilename, globs, globs) except: print sys.exc_info()[1] pdb.post_mortem(sys.exc_info()[2]) else: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename) def debug(module, name, pm=False): """Debug a single doctest docstring. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the docstring with tests to be debugged. """ module = _normalize_module(module) testsrc = testsource(module, name) debug_script(testsrc, pm, module.__dict__) ###################################################################### ## 10. Example Usage ###################################################################### class _TestClass: """ A pointless class, for sanity-checking of docstring testing. Methods: square() get() >>> _TestClass(13).get() + _TestClass(-12).get() 1 >>> hex(_TestClass(13).square().get()) '0xa9' """ def __init__(self, val): """val -> _TestClass object with associated value val. >>> t = _TestClass(123) >>> print t.get() 123 """ self.val = val def square(self): """square() -> square TestClass's associated value >>> _TestClass(13).square().get() 169 """ self.val = self.val ** 2 return self def get(self): """get() -> return TestClass's associated value. >>> x = _TestClass(-42) >>> print x.get() -42 """ return self.val __test__ = {"_TestClass": _TestClass, "string": r""" Example of a string object, searched as-is. >>> x = 1; y = 2 >>> x + y, x * y (3, 2) """, "bool-int equivalence": r""" In 2.2, boolean expressions displayed 0 or 1. By default, we still accept them. This can be disabled by passing DONT_ACCEPT_TRUE_FOR_1 to the new optionflags argument. >>> 4 == 4 1 >>> 4 == 4 True >>> 4 > 4 0 >>> 4 > 4 False """, "blank lines": r""" Blank lines can be marked with : >>> print 'foo\n\nbar\n' foo bar """, "ellipsis": r""" If the ellipsis flag is used, then '...' can be used to elide substrings in the desired output: >>> print range(1000) #doctest: +ELLIPSIS [0, 1, 2, ..., 999] """, "whitespace normalization": r""" If the whitespace normalization flag is used, then differences in whitespace are ignored. >>> print range(30) #doctest: +NORMALIZE_WHITESPACE [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] """, } def _test(): r = unittest.TextTestRunner() r.run(DocTestSuite()) if __name__ == "__main__": _test() 0707010006867f000081a4000000000000000000000001513ff56600000dd0000000b500010002ffffffffffffffff0000006b00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyc e?Qc@sdZddlZddlZddlZddlZddlZyddlZWnnXddlZddlm Z dZ dej fdYZ dS(s%Test .dist-info style distributions. iN(tskipIfcCstj|jS(sdedent and left-strip(ttextwraptdedenttlstrip(ts((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pytDALSst TestDistInfocBsDeZdZedekddZdZdZRS(cCsi}x'tj|jD]}|||j=1.1itextrastbaz(R(R t RequirementtparseR R t assertEqualstrequiresR(RRR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyttest_conditional_dependencies%s cCstj|_tjj|jd}tj|ttjj|ddjt dtjj|jd}tj|ttjj|ddjt ddS(Ns%VersionedDistribution-2.718.dist-infotMETADATAsw+sMetadata-Version: 1.2 Name: VersionedDistribution Requires-Dist: splort (4) Provides-Extra: baz Requires-Dist: quux (>=1.1); extra == 'baz' s!UnversionedDistribution.dist-infosMetadata-Version: 1.2 Name: UnversionedDistribution Version: 0.3 Requires-Dist: splort (==4) Provides-Extra: baz Requires-Dist: quux (>=1.1); extra == 'baz' ( ttempfiletmkdtempR tostpathtjointmkdirtopentwriteR(RRR((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pytsetUp0s  !   !cCstj|jdS(N(tshutiltrmtreeR (R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyttearDownIs(t__name__t __module__RRtglobalsRR'R*(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyRs   ( t__doc__R!R(RtunittestRRR tsetuptools.tests.py26compatRRtTestCaseR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_dist_info.pyts       07070100068689000081a4000000000000000000000001513ff56600000a5f000000b500010002ffffffffffffffff0000006d00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z dZ dej fdYZdS(sbuild_ext tests iN(t upload_docs(t Distributions0from setuptools import setup setup(name='foo') tTestUploadDocsTestcBs#eZdZdZdZRS(cCsHtj|_tjj|jd}t|d}|jt|j tj |_ tj |jtjj|jd|_ tj|j ttjj|j dd}|jd|j tjtjj|j dtjdkrDtj|_tjt_t_tj|_tjt_t_ndS(Nssetup.pytwtbuilds index.htmls Hello world.temptys2.6(ttempfiletmkdtemptdirtostpathtjointopentwritetSETUP_PYtclosetgetcwdtold_cwdtchdirt upload_dirtmkdirtsystversiontsitet USER_BASEtold_baseRt USER_SITEtold_site(tselftsetuptf((sg/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pytsetUps$  !    cCsntj|jtj|jtjdkrjtjtj tjtj |j t_ |j t_ ndS(Ns2.6( R RRtshutiltrmtreeRRRRRRRR(R((sg/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyttearDown(s cCspt}t|}|j|_|j}tj|sBttj|}|jdgksltdS(Ns index.html( RRRtcreate_zipfiletzipfilet is_zipfiletAssertionErrortZipFiletnamelist(Rtdisttcmdtzip_filetzip_f((sg/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyttest_create_zipfile1s    (t__name__t __module__RR"R-(((sg/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyR s  (t__doc__RR R RtunittestRR$tsetuptools.command.upload_docsRtsetuptools.distRRtTestCaseR(((sg/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_upload_docs.pyts T07070100068681000081a4000000000000000000000001513ff56600004220000000b500010002ffffffffffffffff0000006e00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl mZmZmZddl mZddlmZddlmZddlmZddlZyKedddlZejdZejd ejd ej e!Z"Wne#k r\e$Z"dZnXd e&fd YZ'd ej(Z)dZ*dej+fdYZ,dej+fdYZ-dej+fdYZ.dej+fdYZ/ddZ0dZ1dZ2dZ3dS(sEasy install Tests iN(t easy_installtget_script_argstmain(tPthDistributions(R(t Distributiontmultiprocessingttest_easy_installtleveltstreamtFakeDistcBseZdZdZRS(cCs|dkriSidd6S(Ntconsole_scriptsteptname((tselftgroup((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyt get_entry_map"s cCsdS(Ntspec((R ((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pytas_requirement's(t__name__t __module__RR(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyR !s s#!%s # EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name' __requires__ = 'spec' import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point('spec', 'console_scripts', 'name')() ) s0from setuptools import setup setup(name='foo') tTestEasyInstallTestcBs,eZdZdZdZdZRS(cCst}t|}t|_tj|_z?|jtj j |jd}|j tj j |Wdt j|jXdS(Nssite.py(RRtFalsetsitepy_installedttempfiletmkdtempt install_dirtinstall_site_pytostpathtjointassert_texiststshutiltrmtree(R tdisttcmdtsitepy((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_install_site_py?s    cCsit}tj}z6gt|jD] }|^q(dd!\}}Wd|t_X|j|tdS(Nii(R tsystplatformRtnextt assertEqualstWANTED(R R"t old_platformtiR tscript((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_get_script_argsKs   6 cCstj}ttjj|dd}|jd|jttjj|dd}|jt|jddl m }d}|j |_ ||_ tj }ztj|tgWdtj|tj||j |_ XdS(Ns setup.cfgtws.[easy_install] find_links = http://example.comssetup.pyi(RcSsDd}|j}d|kr:d|dks:t|n|jS(Ns!Error: a local setup.cfg was usedRt find_links(tcommand_optionstAssertionErrort_old_parse_command_line(R tmsgtopts((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyt_parse_command_lineds   (RRtopenRRRtwritetclosetSETUP_PYtsetuptools.distRtparse_command_lineR3tgetcwdtchdirRR R!(R tdirt setup_cfgtsetup_pyRR6told_wd((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_no_setup_cfgVs$            cCst}t|}d|_t|_ddg|_tjjt j d|_ dg|_ |j |j|jjit|}d|_ddg|_tjjt j d|_ dg|_ |j |jjj}|j|j|ddgdS(NcSstS(N(tTrue(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyt|stlink1tlink2tokcSstS(N(RD(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyREs(RRtcheck_pth_processingRDt no_find_linksR0RRRRRRtargstensure_finalizedR)t package_indext scanned_urlstkeystsort(R R"R#RO((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_no_find_linksws$           (RRR%R.RCRQ(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyR=s !tTestPTHFileWritercBseZdZdZRS(cCsVtdtjg}|j|j |jttj|j|jdS(sba pth file manager should set dirty if a distribution is in site but also the cwd sdoes-not_existN(RRR=RtdirtytaddtPRDistribution(R tpth((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyt!test_add_from_cwd_site_sets_dirtyscCsitjdkrd}nd}td|g}|j|j |jt||j|j dS(Ntnts%/test/location/does-not-have-to-existsc:\does_not_existsdoes-not_exist(RR RRRSRTRU(R tlocationRV((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_add_from_site_is_ignoreds (RRRWRZ(((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyRRs tTestUserInstallTestcBs>eZdZdZdZdZdZdZRS(cCstj|_tjj|jd}t|d}|jt|j tj |_ tj |jt jdkrtj|_tj|_tj|_tjt_tj|_tjt_tjt_ndS(Nssetup.pyR/s2.6(RRR?RRRR7R8R:R9R=told_cwdR>R&tversionteasy_install_pkgt HAS_USER_SITEt old_has_sitet__file__told_filetsitet USER_BASEtold_baset USER_SITEtold_site(R tsetuptf((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pytsetUps      cCstj|jtj|jtjdkrtjtj tjtj |j t_ |j t_ |j t_|jt_ndS(Ns2.6(RR>R\R R!R?R&R]RcRdRfReRgR`R^R_RbRa(R ((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttearDowns   cCsgtt_tjdkrdSt}d|_t|}dg|_|j |j |j ddS(Ns2.6ssetup.pytpysuser should be implied( RDR^R_R&R]Rt script_nameRRKRLt assertTruetuser(R R"R#((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_user_install_implieds      cCsts dStjddS(Nsthis should not break(t _MULTIPROCt_LOGtinfo(R ((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyttest_multiproc_atexitscCsgtt_tjdkrdSt}d|_t|}dg|_|j |j |j ddS(Ns2.6ssetup.pyRlsNOT user should be implied( RR^R_R&R]RRmRRKtinitialize_optionst assertFalseRo(R R"R#((sh/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_easy_install.pyt6test_user_install_not_implied_without_usersite_enableds      c Cstj}tj}tjj|d}t|d}y|jdWn|jnXtjj |tj j d}tjj jtjtj dsJ                  SdP 07070100068679000081a4000000000000000000000001513ff56600000c3a000000b500010002ffffffffffffffff0000006b00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyc e?Qc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZddlmZdZd ejfd YZd ZdS( sdevelop tests iN(tStringIO(tDistutilsError(t bdist_egg(t easy_install(t DistributionsCfrom setuptools import setup setup(name='foo', py_modules=['hi']) tTestDevelopTestcBs#eZdZdZdZRS(cCstj|_tj|_tj|jtdd}|jt |j tdd}|jd|j t j dkrt j|_tjt _t j|_tjt _ndS(Nssetup.pytwshi.pys1 s2.6(ttempfiletmkdtemptdirtostgetcwdtold_cwdtchdirtopentwritetSETUP_PYtclosetsystversiontsitet USER_BASEtold_baset USER_SITEtold_site(tselftf((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pytsetUps      cCsntj|jtj|jtjdkrjtjtj tjtj |j t_ |j t_ ndS(Ns2.6( R R R tshutiltrmtreeR RRRRRRR(R((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyttearDown&s c Csttddddgddddg}tjtjjd d tj}tt_}z|j |j Wd|t_Xtj d \}|j t jd |dS( Nt script_namessetup.pyt script_argsRtnametfoot py_modulesthitbuildtsrctdistsfoo-0.0.0-py[23].\d.egg$(RtdictR tmakedirstpathtjoinRtstdoutRtparse_command_linet run_commandstlistdirt assertTruetretmatch(RR't old_stdouttotcontent((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyttest_bdist_egg/s     (t__name__t __module__RRR6(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyRs  cCs tjtS(N(tunittestt makeSuiteR(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyt test_suiteCs(t__doc__RR R1RRR9RRtdistutils.errorsRtsetuptools.command.bdist_eggRtsetuptools.commandRteasy_install_pkgtsetuptools.distRRtTestCaseRR;(((se/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/test_bdist_egg.pyts <  /07070100068675000081a4000000000000000000000001513ff566000003a3000000b500010002ffffffffffffffff0000006700000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pyc e?Qc@s:ddlZy ejZWnek r5dZnXdS(iNcsfd}|S(Ncsd}r|S|S(Nc_sdS(N((targstkwargs((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pytskip s((tfuncR(t condition(sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pytskippers ((RtreasonR((Rsa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pytskipIfs(tunittestRtAttributeError(((sa/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/tests/py26compat.pyts   07070100068666000081a4000000000000000000000001513ff56500010000000000b500010002ffffffffffffffff0000005a00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui.exeMZ@ !L!This program cannot be run in DOS mode. $b\<&2o&2o&2oIo%2o&3o}2oo"2o/o2o/o42o/oW2o/o'2oRich&2oPELM  N&@@4(@@.text `.rdatah "@@.data+@QD$P@uSUV+WD-jPx 33ۉD$"p~WL$ <\uG <"u~Wj\V 3\F3T$CF;|Å~Wj\VV D$_"F^][YÁ A3ĉ$V$W$τtd$A9](u>u3@8tHF;w>:u5;t}jujQU&Fu9](uE;tu3]8tUP&YtFYe3C98 A4 AE0 A} 5+A0,Y}؅tx5+A,Yu܉}uu;rW+9t;rJ6++5+A+5+A+ 9}u9Et}}؉Eu܋}hp@d@_Yhx@t@OYE}u(8 AjlYu3C}tjSYËUjju ]ËUjju ]jjj jjj ËV*VY;V:VwV:V:V8V57V7h#@E*$A^ËU=D Au3u1h'YY]jXh0@3uEP4@j_}MZf9@u8<@@PEu' f9@ut@v39@Mu3CS?YujXY-ujGYW4] }j&Y0@+AQ>< A=}jY;}j YSY;tPY:]tMj YQPVh@E9uuPE}5E MPQ5YYËeE܉E}uP!EE3@ËeE>xUVuVSPk?YYt| ;u3@;u`3@ AF uNSW^^N 3_@[3^]ËU}t'Vu F tVf f&fY^]A @tyt$Ix  QP-YYu ËUVMEM >t} ^]ËUG @SVt2u,E+M}C>u8*uϰ?d}^[]ËUxA3ʼnES] Vu3W}uu5M3PPPPPt `p F @u^V@ YAttȃ *AA$uttȃ*A@$g3;] C , If90t@@;u+(;u AI8t@;u+\@t2t ƅ-t ƅ+ tƅ Dž++ uSj p vYtuWSj0. tf~bPjEPFPF5u(9t MYuPY|tWSj tYtt `pM_^3[Ð+@)@G)@)@)@)@B*@p+@jThX@e3}EP4@Ej@j ^VyYY;*A5*A0@@ x@$@% @& x8@4@ *A;rf9} E;8X;E;|E[j@j YYtVM *A*A *@@ ``$@% @& `8@4@;rE9=*A|=*Ae~mEtVtQtKu Q@@t%uN@ uNhF P)YYt7F N@Cg5*A8@33@ËeEcËUEV3;uVVVVVE@^]ËUEP A]ËU(A3ʼnESjLjP(0 ,ffffffEMDž0IDžDžX@jT@(PP@u ujM2YhL@PH@M3[ËU5P A*Yt]j2Y]UE3;AtA-rHwj X]ËA]DjY;#]u@AÃuDAà ËUVMQY0^]h8@d5D$l$l$+SVWA1E3PeuEEEEdËMd Y__^[]Q̋US] Vs35AWEE{t N3 8N F3 8E@fMUS[ EMt_I[LDEEt1E|@GE؃u΀}t$t N3 8&N V3 :E_^[]EɋM9csmu)=*At h*A!tUjR*AM '1E 9X thAWӋ*1E MH t N3 8N V3 :EH09S RhAW0UVW3u%1Yu'9T AvV$@;T Avuʋ_^]ËUVW3ju uE u'9T AvV$@;T AvuË_^]ËUVW3u u[1YYu,9E t'9T AvV$@;T Avu_^]ËUVW3uu u%3 u,9Et'9T AvV$@;T Avu_^]j hx@utu=*AuCjYeV73YEt VPX3YYE }u7u jYVj5t)A`@u\@PYjh@E3ۉ]jY]j_};=;A}W+A9tD@ tP=YtE|(+A PD@+A4Y+AGE Ej7YËUSVuF Ȁ3ۀu@t9FW>+~,WPVaYPD ;uF yF N _Ff^[]ËUVuu V5Y/V|YtF @tVP[EYY3^]jh@3}}jDY}3u;5;A+A98t^@ tVPVYY3BU+AH t/9UuPJYtE9}utP/Yu E܉}F3uࡼ+A4V"YYE}EtEwjYjYËVW3X At~t WW&YhA|ܾHA_t ~uPӃhA|^[ËUE4HA@]j h@Z3G}39t)AujhPYYu4HA9tnj Y;u 3Qj YY]9u,hWt YYuWY ] >WYE Ej (YËUEV4HA>uP"YujDY6@^]j h@dM3;v.jX3;E @u WWWWW3M u;u3F3ۉ]wi=*AuKu E;p*Aw7jLY}uH6YEE_];tuWS ;uaVj5t)Ad@;uL9=)At3VYrE;P E3u jY;u E;t U}}M f$ffGfG fG0fG@fGPfG`fGpIuЋ}]U}E3+3+uF@8uE;t':t!.tG;} s.F G;} sF@8uG;} vEhj"3_^[ËUuME MUTu}tMA#E3t3@}tMapËUjjuu ]ËUjjuj]ËUjuuu u?]ËU("A "A"A"A5"A="Af"Af "Af"Af"Af%"Af-"A"AE"AE"AE"A"A"A!A!A !AAAX@!Aj$YjT@h@P@=!Auj$Yh L@PH@-t"t t Ht3øøøøËVWh3FWP3ȋ~~~  ~hA F+ο@Ou@Nu_^ËUA3ʼnESWPvh@3@;rƅ t.;w+@P j R8 CCujv vPWPjjyE3SvWPWPWv SZCDSvWPWPhv S5C$3EtLtL Ƅ@;rVDž3)ЍZ w Lр wL р A;r‹M_3[j h@@ AGptltwhuj nYj Yewhu;5At6tVp@uhAtVYAGh5AuVl@E뎋uj YËUS3SMt$Au$Ax@8]tEMapEAD;FG;v}FF>uыuE}urlj{CgjC CAZf1Af0A@@JuL@;vFF~4C@IuCC Ss3ȋ {95$AXM_^3[jh`@M}_huuE;CWh Y؅Fwh#SuYYEuvhp@uFh=hAtPcY^hS=l@FpAj tYeC$AC$AC $A3E}fLCf E$A@3E=} LA@3E=}A@5Ap@uA=hAtPYASE0j Y%u hAtStYeE~Ã=+AujVY+A3ËUSVu3W;to=HAth;t^9uZ;t9uPAYY;t9uP5AYYYY;tD9u@-P+P+Puj=At9uP?7CYY~PEAt;t 9uPY9_tG;t 9uPYMuVY_^[]ËUSV5l@W}W֋tP֋tP֋tP֋tP֍_PE{At tPփ{t CtPփMu֋P_^[]ËUW}SV5p@W֋tP֋tP֋tP֋tP֍_PE{At tPփ{t CtPփMu֋P^[_]Åt7t3V0;t(W8YtVE>YuAtVYY^3j h@_,AFpt"~ltpluj Yrj YeFl=pAiEEj }YuËUV5A5@օt!AtP5AЅt't@V @u V>Ythd@P(@tuЉEE^]jYËUV5A5@օt!AtP5AЅt't@V @u VYth@P(@tuЉEE^]@V5A@u5%AeYV5A@^áAtP5%A;YЃ AAtP@ Aj h@t@V @uVYEuF\@3G~t$hd@P(@Ӊh@uӉ~pƆCƆKCFhhAj nYevhl@E>j MY}E FlupAFlvlYE3Guj 5Yj ,YËVW\@5AЋuNhjYYt:V5A5%AYЅtjVYY@N V^Y3W@_^ËVujY^jh@uF$tPYF,tPYF4tPYFHN+I;N~WPu <+ EM F yM tt*AA@ tjSSQ>#ƒt%FM3GWEPu * E9}t N E%_[^ËUQQS]VW33};At G}rwj@Y4j@Yu =AAhp@S %AW8 t VVVVVh9%AVj=&A@u&hX@hVN8 t3PPPPPV@Y 2j<@;t$tjEP4A6%YP6S@_^[j^?YtjQ?Yu=Auh)hYYËUQSVW5+A5+A}YY;+ߍCrwW5?CY;sH;s;rPusYYuG;r@Pu]YYt1P4Y+AuVY+AEY3_^[ËVjj V +A+AujX^Ã&3^j h@aeuYEE E}oËUuYH]ËV@@W;stЃ;r_^ËV@@W;stЃ;r_^ËVW3@A6Y(r_^̋UMMZf9t3]ËA<8PEu3ҹ f9H‹]̋UEH<ASVq3WDv} H ;r X;r B(;r3_^[]̋Ujh@h8@dPSVWA1E3PEdeEh@*tUE-@Ph@Pt;@$ЃEMd Y_^[]ËE3=‹ËeE3Md Y_^[]jh0@S @xte3@ËeE<lh=[@'Y4(AËUQQV`FV\tAW}S99tk ;rk ;s99u3t X]u3u `3@N`MM N`H hA=lA;}$k ~\d9=hAlAB߃ ;|]~d=u Fd^=u FdN=u Fd>=u Fd.=u Fd=u Fd=uFdvdjY~d`QӋEYF`[_^ËUE8(A<(A@(AD(A]ËUE tAV9Ptk u ;rk M^;s9Pt3]5@(AYj hP@F3}}؋] LtjY+t"+t+td+uDs}؅ua8(A8(A`w\]ZÃt<t+Ht3PPPPP뮾@(A@(A<(A<(A D(AD(AEPEY3}9Euj9EtPY3Et tuO`MԉG`u@OdMGdu. hAM܋ lAhA9M}Mk W\DE~EuwdSUY]}؃}tjTYSUYt tuEԉG`uEЉGd3ËUEL(A]ËUEX(A]ËUE\(A]jhp@ieu u@E/EE3=Ëe}uj@eEE[ËUE`(A]ËU5`(A|YtuYt3@]3]ËUE8csmu*xu$@= t=!t="t=@uC3]h_@T@3ËVW39=+AuC5+Aub@< wt.t$<"u 3ɅPYtFF< wFu_^Ã=+AuV5< AW3u<=tGVYtujGW!YY= Atˋ5< ASBVSC>=Yt1jSYYtNVSP}. t3PPPPP>u5< A%< A'+A3Y[_^5 A~% AUQMS3VU 9Et ]EE>"u39E"FE<tBU PFYt} t M E FU Mt2}u t utBe>< t< uFN>}t EE3C3FA>\t>"u&u}t F8"u 339EEtIt\BuU tU}u< tK< tGt=Pt#Yt M E FM E  YtFU FVtBU ME^[t ËU S3VW9+Auehh(AVSl)A@+A5( A;tE8uuUEPSS} E =?sJMsB;r6P$Y;t)UEPWV}E H A5 A3_^[ËUp)A SV5@W33;u.֋;t p)A#\@xu jXp)Ap)A;u֋;u3f9t@@f9u@@f9u5@SSS+S@PWSSE։E;t/PJYE;t!SSuPuWSSօu uYY]]W@\t;u@;r8t @8u@8u+@PEY;u V@EuVW+ V@_^[ËU39EjhP@t)Au]3@*A]ËUAeeSWN@;t t УA`VEP@u3u@3@3@3EP@E3E3;uO@ u 5A։5A^_[ËUEu 3]V3;|;*ArVVVVV 3ȃ *AD@^]áA39x)A̋L$t$tNu$$~Ѓ3ƒtAt2t$tt͍AL$+ÍAL$+ÍAL$+ÍAL$+ËUSVu 3W};u;vE;t3E;tvcj^SSSSS0VuME9XfEf;v6;t;v WSV訳 *8]tMap_^[;t2;w,j"^SSSSS0n8]yE`pmE;t8]%E`pM QSWVjMQS] p@;t9] ^M;t\@zD;g;_WSVѲ OUjuuu u|]ËUu M誶EMA%}tMapËUjuYY]VD$ u(L$D$ 3؋D$d$ȋd$Gȋ\$T$ D$ ud$ȋD$r;T$ wr;D$v N+D$T$3+D$T$ ؃ʋӋًȋ^%*ASVWT$D$L$URPQQhi@d5A3ĉD$d%D$0XL$,3p t;T$4t;v.4v\ H {uhC1C1d_^[ËL$At3D$H3Uhp pp> ]D$T$UL$)qqq( ]UVWS33333[_^]Ëj_033333USVWjjhWj@QQ_^[]Ul$RQt$ ]j h@eu;5p*Aw"jdYeVa YEE E)j_YËUVuSW=d@=t)Au!joh轶YY*Aut3@Pu VSYuuFVj5t)A׋؅u.j ^9)AtuBYtu{00_[VY 3^]jh@]uu Yu u SY=*A3}jY}S6YE;;5p*AwIVSP t]5V YE;t'CH;rPSu:$SESP 9}uH;u3Fu u VW5t)Ad@E;t CH;rPSu#SuE.}u1uFu VSj5t)A@u ]jHYË}9=)At,VYP9}ul\@PY_+9}th quFVSj5t)A@uV9)At4V;YtvV+Y 3c|u\@PnYҋUM S3;v(j3X;EsSSSSS 3AMVW9]t u)YVuYYt;s+VjSȬ _^[]ËU h*Al*AkU+P r ;r3]ËUMAVu W+y iDMIMS1UVUU] utJ?vj?ZK;KuB sL!\D u#M!JL! uM!Y] S[MMZU ZRSMJ?vj?Z]]+u]j?u K^;vMJM;v;t^M q;qu; s!tDLu!M!1K!LuM!qM qINM qINu ]}u;M ыYN^qNqN;Nu`LML s%}uʻM DD )}uJM YJꍄ ED0E|)A |*A5@h@H SQ֋ |*A|)A P|)A@ |*A|)A@HC|)AHyCu `|)AxueSjp ֡|)Apj5t)A`@ h*A|)Akl*A+ȍLQHQP+E h*A;|)Avml*At*AE|)A=|*A[_^áx*AV5h*AW3;u4kP5l*AW5t)A@;u3xx*A5h*Al*Ak5l*AhAj5t)Ad@F;tjh hW@F ;uvW5t)A`@뛃N>~h*AF_^ËUQQMASVqW3C}i0Dj?EZ@@Jujhy hW@upU;wC+ GAH@PǀIuˋUEO HAJ HAdD3GFCENCu x!P_^[ËU MASVuW} +Q iDMOI;|9M]UE;;MIM?vj?YM_;_uC sML!\D u&M!ML! uM!YO_YOyM+M}}M OL1?vj?_]][Y]YKYKY;YuWLML s}uϻM DD }uOM YO U MD2LU FBD2<38/] )uNK\3uN] K?vj?^EuN?vj?^O;OuB st!\Du#M!NL! uM!Y] OwqwOquuuN?vj?^M yK{YKYK;KuWLML s}uοM 9DD }uNM yN ED3@_^[ËUh*AMkl*AMSI VW} M 3U t*AS;#U# u ];r;ul*AS;#U# u ];r;u[ {u ];r;u1l*A {u ];r;u؉]u3 S:YKC8tt*ACUt|D#M# u)eHD9#U# uEUiDMLD3#u#Mj _G}MT +MN?M~j?^;J;Ju\ }&M|8Ӊ]#\D\Du3M]! ,OM|8!]u ]M!K]}JzyJzyM yJzQJQJ;Ju^LM L}#} u ;οM |D)} u N {MN 7Mt LMuэN L2uy>u;|)AuM; |*Au%|)AMB_^[ËUSVuW3;uQWWWWWٽ BF t7VV(VOP'}F;t PnY~~ _^[]j h@3M3u3;;uνWWWWWV F @t ~ E6V Y}V*YEEՋuVYYËU8*A3ʼnEE V34809uu3;u'D0*VVVVV貼SW}4*ANJX$('tu0Mu&ۼ30迼VVVVVGC@ tjjjucuYD@l39HP4 @`39 tP@43<9EBD'g (3  ǃx8tP4UM`8jEPKPYt:4+M3@;j@SP<( CDjS@P( 3PPjMQj@QPCD@\j # 3;|;*Ar!8 WWWWW胵ɋ*A L1tP9$Y}D0tuu u. E蘵 蠵8ME Eu$Yjh@訵EuO 3;|;*Ar. SSSSS趴Ћ<*ALtPl#Y]Dt1u"YP@u \@E]9]tʹM谴 ME E#u#YËUS39]urSSSSS3jVu ;uNSSSSSֳ9ur3>uMƛMF9YtH9Ew D u+ȃ+N8]tMap^[ËUju uU ]ËUS3Vu9]u;u9] u3;t9] w襳j^SSSSS0.9]uW};utj^SSSSS0(uME9XuuWu V L}U u@G:tJu@G:tJtMu9]u@;8t}u5x};rEPEPоYYtM9us+E}uZE v:|};r!EPEP茾YYtM9usE +Mt\8]tE`pjPXSj"^SSSSS0ܱ8]tE`pd+΃|Mx};rEPEP YYtM9us+Etj*X8]tMap8]tE`p3_^[ËUEt8uPY]ËUA3ʼnESV3W9)Au8SS3GWhd@hS@t=)A\@xu )A9]~"MEI8t@;uE+H;E}@E)A;]9] u@E 5@39]$SSuuPu ֋;~Cj3Xr7D?=w#;tP Y;t E]9]>Wuuuju օ5@SSWuu u֋ȉM;E t)9];MuuWuu u;~Ej3Xr9D =w";tjPJY;t 3;tAuVWuu u@t"SS9]uSSuuuVSu @EVYuEYY]]9]u@E9] u@E u YEu3!;E SSMQuPu > E;tԋ5@SSuPu u։E;u3~=w8=w!;tP4Y;t 3;tuSW0 uWuuu u։E;u3%uEuPWu uu#uWYuuuuu u@9]t u蘱YE;t 9EtP腱Yƍe_^[M3藕ËUuM葕u(Mu$u uuuuu ( }tMapËUQQA3ʼnE)ASV3W;u:EP3FVhd@V@t5)A4\@xu jX)A)A;]9]u@E5@39] SSuu Pu֋;~<w4D?=w;tPPY;t ؅ti?PjSN WSuu juօtuPSu@ESEYu39]u@E9]u@EuAYu3G;EtSSMQu Pui;t܉u uuu uu@;tV膯YǍe_^[M3蘓ËUuM蒓u$Mu uuuuu }tMapËUVuvvv vvv6v ߮v$׮v(Ϯv,Ǯv0迮v4跮v诮v8觮v<蟮@v@蔮vD茮vH脮vL|vPtvTlvXdv\\v`TvdLvhDvl 9M u H9U t @ff;u9M u8]tMap8]tE`p3^[ËUju u2 ]̍B[Í$d$3D$ST$t :tτtQu WV ؋ ~333ƃu%t%uu^_[3ËB:t6t:t't:tt:tt^_B[ÍB^_[ÍB^_[ÍB^_[%@UUS3;uH{SSSSSz 8tߋM ;t؋;t8tSQR []ËUUVujXEU;uz z S3;|;5*Ar'zzSSSSS CzQW<*AƊHuzuz jwP];9] t7@$EHjYtHuШtUE EШu!#z zSSSSSy4M;rEu|YE;uy yhjSSu|D(ET,AHttI tl9]tg@MED 8]tNL% tC9]t>@M}ED% u$L& t9]t@MED& SMQuP4,@{M;p;MgMD};t M9 u ]EÉ]E;M<< t CAMEH;sA8 u AAM uEmEjEPjEP4,@u \@uE}t?DHt} t ML%;]u} tjjju} t CE9EGD@uC+E}EK xC3@;]rK @AtAu |w*zA;u@AHt$CQ| T%Cu T&C+ؙjRPuE+]Pu Sujh@Eu4\@P!wYME;E tPUzYEEE3;EL0;tMf9 u ]EÉ]E;Eff tf CC@@EM;sHf9 u Ej MEjEPjEP4,@u \@u[}tUDHt(f} tj XfMLML%D& *;]uf} tjjjuf} tj XfCCE9Et@uffCC+]]\@j^;uuu }u0imY]\3_[^jh@uEuEu *u 3;|;*Ar!u0u VVVVVtɋ*A L9t;MAut0tPYuD8tuu u~ E~t t0ME EtuiYËU0S3EVW]]E ]t ]E E]EP Yt SSSSSnrMu@u9EtM+útGHt.Ht&ssj^SSSSS0?sUtuE@}EjY+t7+t*+t+t@u9}EEE E]E#¹;;t0;t,;t==@E/E&E=t=t`;EEEt  A#MxE@tMMMt } tME릨tMujrMrE=@SuuEPuuu ׉EumM#;u+Et%eSuEuPuuu ׉Eu46*AD0 \@PqYqtu@@;uD6*AD0 \@VqYu@;u_q 룃uM@ uMu64Ѓ*AYYMLЃ*AD$ MeHMEtqjW6 E;up8tM6jEP6] u}uERP6 ;tSS6F ;tE0@@}uE#u M EE#;tD=t)=@t"=t)=@t"=t=@uEM#;u E]EE@]E#=@=tw;E;yvv0fE3H&HREEjSS68 tSSS6'#ƒjEP6/ utk}uYEE;bPjSS6 CSSS6#ƒE%=u6Ynj^0d=uSj6X EASS6= EEE+PD=P6 9}ۋ *AD$2M0 *AD$M ʈ8]u!Etȃ *AD }#;u|Etvu@SuEjPuWu @u4\@Pmȃ *AD 6Y6 *A_^[jh@omM3u39u;u mVVVVVlruuj@u uEPEEE};t?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=EncodePointerKERNEL32.DLLDecodePointerFlsFreeFlsSetValueFlsGetValueFlsAllocruntime error TLOSS error SING error DOMAIN error R6034 An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information. R6033 - Attempt to use MSIL code from this assembly during native code initialization This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain. R6032 - not enough space for locale information R6031 - Attempt to initialize the CRT more than once. This indicates a bug in your application. R6030 - CRT not initialized R6028 - unable to initialize heap R6027 - not enough space for lowio initialization R6026 - not enough space for stdio initialization R6025 - pure virtual function call R6024 - not enough space for _onexit/atexit table R6019 - unable to open console device R6018 - unexpected heap error R6017 - unexpected multithread lock error R6016 - not enough space for thread data This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. R6009 - not enough space for environment R6008 - not enough space for arguments R6002 - floating point support not loaded Microsoft Visual C++ Runtime Library ...Runtime Error! Program:  EEE00P('8PW700PP (`h`hhhxppwpp ((((( H h(((( H H  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~HH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSunGetProcessWindowStationGetUserObjectInformationAGetLastActivePopupGetActiveWindowMessageBoxAUSER32.DLLSunMonTueWedThuFriSatJanFebMarAprMayJunJulAugSepOctNovDecCONOUT$.com.exe.bat.cmd.\SystemRootHA@8i@#@%@%@%@%@h5@l5@;@;@k=@7=@>@#@@MA@iA@]G@+K@N@P@P@R@R@eY@ [@[@][@a[@^@H_@__@j@l@y@ށ@@@M@@[@!@]@ܮ@@@\$<Thp$@^r &0@Vbr$2L\r"4FXjv$0@RQGenerateConsoleCtrlEventGetExitCodeProcessdWaitForSingleObjectCreateProcessASetConsoleCtrlHandlerGetModuleFileNameAEnterCriticalSectionLeaveCriticalSectionGetModuleHandleW!Sleep GetProcAddressExitProcessoGetCommandLineA9GetStartupInfoASetHandleCount;GetStdHandleGetFileTypeDeleteCriticalSection-TerminateProcessGetCurrentProcess>UnhandledExceptionFilterSetUnhandledExceptionFilterIsDebuggerPresentGetLastErrorHeapFreeHeapAlloc[GetCPInfoInterlockedIncrementInterlockedDecrementRGetACPGetOEMCPIsValidCodePage4TlsGetValue2TlsAlloc5TlsSetValue3TlsFreeSetLastErrorGetCurrentThreadIdWriteFileLoadLibraryAInitializeCriticalSectionAndSpinCountJFreeEnvironmentStringsAGetEnvironmentStringsKFreeEnvironmentStringsWzWideCharToMultiByteGetEnvironmentStringsWHeapCreateWVirtualFreeTQueryPerformanceCounterfGetTickCountGetCurrentProcessIdOGetSystemTimeAsFileTimeRtlUnwindHeapReAllocTVirtualAllocGetConsoleCPGetConsoleModeAFlushFileBuffersLCMapStringAMultiByteToWideCharLCMapStringW=GetStringTypeA@GetStringTypeWGetLocaleInfoASetFilePointerHeapSizeCCloseHandleWriteConsoleAGetConsoleOutputCPWriteConsoleWSetStdHandlexCreateFileARCompareStringAUCompareStringWSetEnvironmentVariableAKERNEL32.dllhReadFileSetEndOfFile#GetProcessHeapGetFileAttributesA+A+AN@D#@l@\@         ! 5A CPR S WY l m pr   )     abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZhA`y!@~ڣ @ڣ AϢ[@~QQ^ _j21~l@CAAAAAHAh@@p@AAAhA@@ @ @@@@\@$@@@@d@D@@ @!@"@x@y@z@@@^@^@^@^@^@^@^@^@^@^@x h@j@@@@@@@@x@p@h@\@P@H@<@8@4@0@,@(@$@ @@@@@ @@@@@(@@@@@@@@@@@|@p@ A.DA)A)A)A)A)A)A)A)A)AHA. pPSTPDTAA;Zx0Nm:Yw/Mll@d@\@T@07070100068665000081a4000000000000000000000001513ff56500012600000000b500010002ffffffffffffffff0000005d00000000root/usr/local/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/gui-64.exeMZ@ !L!This program cannot be run in DOS mode. $4UUUʓUUҰUPIU-[U-JU-\҃U-NURichUPEdM#  l+@p(` .text `.rdata)*@@.data5 @.pdata ` @@H\$Hl$Ht$H|$ ATAUAVH LH3IHэD HyHcP 33Lc"HXL~eA ,\u'"u ~DƲ\Hˋj H+\H3A,HHI;C|~DƲ\Hˋ5 HHl$HHt$PH|$X"CH\$@IH A^A]A\H\$WH`HH3H$PHH HtH/u@\uH$@L$@LD$@HT$0HHD$ O|$0|$@\H$@L$@LD$@HT$0HHD$ H3H|$@HD$@HHHHȀ9\uHɀ9\tHD$@H;r Hɀ9\uLD$@HT$0H$@LHD$  H$@s HAHH HH$PH3H$H`_H\$Hl$Ht$H|$ ATAUAVH HH3LHPHH 3HA} LE3HetDKHPu+H@t[@8tEtI@\u@"u@u3E@2DtLDz\H H3@t@.H뚅tLDz\H H3AEIcEHI4@t& tKHu;GH\$@Hl$HHt$PH|$XIH A^A]A\H(u !t36H(H\$WH33HHL$pDGh3҉$HD$PHD$XHD$`WH D$phL\$PHD$pL\$HHD$@H|$8H|$0E3E3H3ɉ|$(D$ u(HHH`r3H$H_ËD$`HL$P _HL$PH$Du(H,HH`3H$H_Ë$H$H_H\$Hl$Ht$WATAUH LH3IIcH;HHLLQ}J+H^ CL;CL;{;tHL$0HIЅ~sA}csmu(H=tH 5tIKAHIBIF@SMcMHD$(IF(IMHHD$ BH;>sj>3fIy 3I+9.vTH^KL;r>CL;s6H;r H;sAE u/;t H;t#HT$xIDZIDCMAH;.rL\$@I[0Ik@IsHIA_A^A]A\_H\$H|$ATH H!BH0H;u3H`H;uwnC ucL%HcI<u+JIHuHC HCHC$CI C$CHKH K3H\$0H|$8H A\̅t0SH b HsHcc$H#HcH [@SH B@It HzuA&Bx HH,u H [̅~LH\$Hl$Ht$WH II@LH@?tH\$0Hl$8Ht$@H _H\$Hl$Ht$WH A@@IIHt IxuA7~3MLHHŃ?u=8*uLHֱ?H\$0Hl$8Ht$@H _H\$UVWATAUAVAWHHH3H$3HHL$hHHL$xIMD$`DD$TDD$HD$XD$PdE3I;uA3E3E333H\$ 8$tH$AC@L H HwA;t(t#LcL sIAHMkXMɀC LL PA@8u)A;ttHcHƒHHkXICB8tA3E3E333H\$ 8$tH$A1E3I;t@/ADT$@DT$DAL$A:H$AHA;H$EtkH>teAEt^AEuHLA;tILcIHAMkXM$HI$AEAD$IL$*A;tAD$ IH;|EIHHkXHH;t H;tKCAD$ɃE;DHHtJI;tEHA;t7H3uK@ uKHK.*A;tC .K@HAHHQ  3L$I[ Is(I{0Mc8IA_A^A]H8Hu%*Hd$ E3E333?AH8H @SHd$pHL$t3A L\$pH$H$L\$HHD$PDzH$HT$@HE3Ht;Hd$8HT$@HL$`HL$0HL$XLHL$(H$LHL$ 3 H$H$H$H$H$D$pD$tH$3ɋHL$Hu uH4αHH[H\$Hl$Ht$WH0HH AIH@HtLT$`DLHHLT$ %4L\$`DLHHL\$ hH\$@Hl$HHt$PH0_L 3ID@; t+IЃ-rAw ÁDAFHADH(wHu HHH(H(WHu HHH(@SH 3Hu HHLHtLP;AH [H\$Hl$Ht$WH 3HHd3HHu(9Zv ȯDD;BAG;uHl$8Ht$@HH\$0H _HHXHhHpHx ATH 3HHAE3HHiHHu*9v"MDD;AAGA;uHl$8Ht$@H|$HHH\$0H A\HHXHhHpHx ATH 3HHAHH 3HHu/Ht*9Yv"ǮDD;AAAGA;uHl$8Ht$@H|$HHH\$0H A\H\$Hl$Ht$WATAUH 3IHALLHIg3HHu/Ht*9v":DD;AAGA;uHl$HHt$PHH\$@H A]A\_Ht7SH LH 3uSHfH [H\$Ht$ATH03Nj^\$ ;4}iLcHJ<tPJ At3tƉt$$|1HJ H0H J ALK$É\$ 돹H\$@Ht$HH0A\H\$Ht$WH A3H$<u?At69+y~-HSDNj:;uCyCK HKcHt$8H H\$0H _@SH HHu5,jtcsH;3H [Ht$H|$Ld$AUAVAWH0DE33N3|$ A;=LcH~J<tjJBt`H^J At5Au9A;t%ADd$$EuAtA;ADt$(HJlj|$ n@AADHt$PH|$XLd$`H0A_A^A]ùH\$Ht$H|$ATH L%33I܃{u%HcƺH HH H "t-HHH;|øH\$0Ht$8H|$@H A\HcHI$3H\$Hl$Ht$WH H!H-ZHH7HttHЪH|H'HH;|H Ht {uHH;|H\$0Hl$8Ht$@H _HcHHH H%H\$Ht$H|$AUH HcپH= uNHHL-UI|t{(HHu. 3Z fI|u/H uH 3I\ HbH vHH\$0Ht$8H|$@H A]H\$WH HcH=HH<uuHH H\$0H _H%H\$WH0IHHt23HBHH;s$HHd$ E3E333 ]3]HHHD3HwH PL*Hu-=tHuHt Ht H\$@H0_H\$Hl$Ht$WH0HHHH3HMt!AtH;HY:HIMtAA9t;HH;HˆHÀ:uI88/t8\tHH;sm\HHL$`HtHH;sSHH9uHL$hHt1t+<.t"HH;s(.HHH;sHH9uHGH;vE"3#Hd$ E3E333ɉH\$@Hl$HHt$PH0_H\$Ht$WH@HHL$ AAHD$(DA|utHD$ H@BY#3t|$8t HL$0H\$PHt$XH@_H‹AHE3n̋AE33ZH8Hd$ Y7H8HL$HH LxL\$XE3HT$`HL$XsHD$PH|$PtAHD$8HD$HHD$0HD$@HD$(H8HD$ LL$PLD$XHT$`3s"H$HH$HHHH[H$H\2 ,HHD$hHHD$p(3H K}=vu (\ HFHĈH\$Hl$Ht$WH HYHHL3gE3H}AKAD]D]D] fH=RH+HHuH9HHuH\$0Hl$8Ht$@H _H\$Ht$WHHH3H$pHIHT$Pˤ=3HT$pH;rD$VD$p H|$V)WDD;wA+IJLpDB yHuӋF d$8LD$pD$0FDˉD$(H$p3HD$ ?d$@FV D$8H$p\$0HD$(LL$pD3ɉ\$ d<d$@FV D$8H$p\$0HD$(LL$pA3ɉ\$ .<L$pHN3At pAt pƁHHIHu?3HNDBA@ w B Aw BƁH;rH$pH3L$I[Is I_H\$WH H FtHt Hn HH\$0H; tDHtuHHL$0H;tHHHHD$0H\$0 HuK HH\$8H _@SH@HL$ 3%u%@|$8tSHL$0EuԃuHD$ @뻀|$8t HD$0H@[H\$UVWATAUH@HH3HD$8HI3ۋ;u HL-HIA98'AIH0r_;HT$ 2;HN3A~^ D9d$ HD$&8\$&t-8Xt(8H;w+HT7À II+uH8uHFII+uNt(t tA;t F Df^H~ùf9HN3A?HlmL{HAMDIA8t18Yt,A;wLL2AAAAM;vH8uIMM+u~Dft$t t A;u ^ HVI|HfHI+uH|3HL$8H3H$H@A]A\_^]HHXHpHxL` AUH0AHHD;C \H3H;|HHA :;HAD;$HuHL%I;tL%H  C CC ׉T$ LW}HcDKfAH=‰T$ ׉T$ }HcʊDB *‰T$ |$ }HcϊB0+lj|$ HuH I;tH +u&L%I;tHW3DAH\$@Ht$HH|$PLd$XH0A]H(= u3H(H\$Ht$WH H(HHtyH sH;tmHHta8u\H Ht9u;H(C>HHt9uH(=HH(H0HtG8uBH8HHHH+HPH+H0HXH H;t`ua;HXuH{XHaH9GtHHt 9uMHtHOHt 9u3H HuHH\$0Ht$8H _HHtH HtHHtH0HtHAXAHH9Pt HHtHxt HPHtH IuHX`HAD HHtDH HtDHHtDH0HtDHAXAHH9Pt HHtD Hxt HPHtD H IuHXD`H@SH HHtAHtt@$@$Ƅ$DJ@$Ƅ$DHL$@T$8L$AD$0AHL$@D$(HD$pHD$ 0u8D$Xt HD$P3D$p#ŀ|$Xt HL$PL\$`IkIs I_HHXHhHp HWH HHKHcu K 4@t "3t{HCHKC{C u/3H0H;t%H`H;u i;uH;C+HS+kHBHC$;C~Dŋ!W K?t#tHHHHHkXH H A t3ҋDB:HHKD$0HT$0DC!;D$0H\$8Hl$@Ht$HH _H\$H|$Ll$ AVH0L53I;t Hr<|<u =9aH=AL HI6tHd$ E3E333HA3#u1LH 36tHd$ E3E333H HHLH t/HI;HI+LoII:HI;sTH;HBHH;rI3H;u3HV H;rFIH;t9HHHHIHHKHI3HH\$@Ht$HH|$PH A^A]A\H(HH(H\$WH HCH=<HHtHH;rH\$0H _H\$WH HH=HHtHH;rH\$0H _H\$WH H H HHHuH\$0H _HMZf9t3HcH%#I Hd$ E3E333^H\$`H0A\_^H\$WHPHHHu$Hd$ E3E3333vHtH;sHL$0I耢L\$8A{u|$HHCtHHL$@:HSHH;w BDuHH+ʃH+ـ|$Ht HL$@HCH\$`HP_E3I;tI;vM;uD)M;u?D)E3E333ɉLl$ L\$PI[ Ik(Is0IA]A\_H$HL$0hL\$8HHE9ku LLXD8l$HtHL$@HuHƈHA:t.Hu&HƈHA:t HtHuI;uD)HI;D8.tHuYLaIL;rHT$0'A;tHH;sA+ƨt*E,$*D8l$Ht HL$@Hu\HvOHt+HH;rHT$0A;tHH;s+Ǩt D.D8l$Ht HD$@PDl+D+i"E3E333ɉLl$ ~D8l$HaHL$@PHH+H|YHqHH;rHT$0!A;tHH;s+Ǩt+D.*D8l$HHD$@D8l$HHD$@@UATAUAVAWH`Hl$@H]PHuXH}`HH3HED$3MLMDEDUHDnD;uOLwEͺ3ɉ|$(H|$ lm;t ED-ҽ>lDýxDDDL]DMpD;~5AIA+@88t I;uA+A+A;} DHDMpDȉEpD;\D;SE;DD;uHD`MA҉|$(H|$ AlLcD;<HAA~[3HBIHrLKL?I;w.HAH;wHHZ\H+H|$@HHHtD0HHDMpLEAD|$(H|$ k3;KUL$(HL$ MELkE3HcA;!DUA s;A;;MD$(HExELAHD$ kA;~`3HBHHrQHL6I;w*HAH;wHHW[H+H\$@I;tE3HI;tD0HDUII;tnMELA҉t$(H\$ k3;t?3HL$8DLHL$0;u L$(HL$ D$(HExHD$ AOjHKD91uHOD91uHLD;u HDpDuuHxAh Du3L}xLE;<3LMpЋω\$(H\$ HH;tDMpULAΉ\$(H\$ jLcDMD;uD;A~bIIwYHHw4HYH;w HHHYH+H\$@Ht%HHtD0HDMHu3Mc3H{D]DMpUMD\$(LH\$ JiEu3.LMLÉD$(AL|$ }L3L;DHKD91u(g!DMpUD$(AL|$ h3H;tH5L;t M;tI#HMH3!H]PHuXH}`He A_A^A]A\]H\$Ht$WHpHHL$PIA$D$HL$PD\$@D$8$D$0H$LHD$($DNj։D$ O|$ht HL$`L\$pI[IsI_DL$ UATAUAVAWH@Hl$0H]@HuHH}PHH3HED L3MDLwD;u=LMHqDNjg;t=6|fD xDDD D;&D;D;Cuh;uIEp]xDMXMҋΉ\$(H\$ ,gLcD;A~hHL;wYKL$Hw5HAH;w HHVH+H|$0H;HH;t D(HHH;M3HM蜑DMXMƺDd$(H|$ vf;tLM`DHAwfHOD9)u諶DepHD;uIED`uh;uIEpA"u3U;t$LMXMƋЋΉ\$(H\$ PHH;tLHE`DMXMAAHD$ eH;tHHMH3H]@HuHH}PHeA_A^A]A\]H\$Ht$WH`HHL$@AI$D$HL$@D\$8D$0$D$(H$DLNjHD$ .|$Xt HL$PH\$pHt$xH`_ffLH+Irat6t  IȈHtf IfHt  IHMIuQMItH HHIuIMuI@ HIuIffffffffffffI sBH LT H HALQHD LT IHALQuIqffffHr  D @HuH@L LT L LQLL LT LILQLL LT (H@LILQLL LT LILQuIIq $fffffffffffIIrat6t HɊ IȈtHf Ift H IMIuPMItHH IHuIMuIHɊ IȈuIffffffffffffI sBHD LT H HALQHD L IHALuIsfffffHw H D @uH@LL LT LILQLL LT LILQLL LT H@LILQLL L LILuIIq $HSH HHIHKHKHK HK(HK0ٱH ѱHK@ȱHKH迱HKP趱HKX譱HK`褱HKh蛱HK8蒱HKp艱HKx耱HtHhH\HPHDH8H,H HHHHHHذH̰HH贰H訰H蜰H萰H 脰H(xH0lH8`H@THHHHPH iH;t2?Ht(HHtH QH;tHtHHH #HtDMIH3H\$pHl$xH@A^A]A\_^H8x ~ u1 #Hd$ E3E333$H8H8Hu&ޤHd$ E3E333HLH G3WH8̹Ht uHt rgt_H$gUHL$03AuH$3HD$@HD$0D$0@HD$ H$HD$(UHL$ T蘍HHXHhHpHx ATAUAVHPLHHHEMvMtMuMu*诣Hd$ E3E333Ģ|$HEt A|A$A.LD$03I^A ~LD$0@ͺ2LD$0I@@Ht@+H뾋$@-u@+u@+HESAIA$?Eu(@0tA 8;xt ;XtA&A Au@0u;xt;Xu@kHM@3҃AD@EJAt @̓0At,E@<w A;sA;r"u;vMuH@uMIE3YA@+H둽@u@u:ƃtwu';v#"@t @$MtI]@t߀|$Ht HL$@MtMu@8|$Ht HD$@3L\$PI[ Ik(Is0I{8IA^A]A\H83EL‰D$ H9;u H R3QH8H\$WH HcHtYHu @u ;u@`tHH;tH?Su Q3ۋLHHAHsH MkXBDt ֠3H\$0H _H\$Ht$ L$WATAUH0Hcكu耠38W 3;;HLIL-HkXKDL0u+'8 H|$ E3E333aKDD0t 轟 )ğ8蝟 H|$ E3E333賞H\$`Ht$hH0A]A\_@SH AHt"AtHI֡c3HHCCH [HhH-H3HD$P="fL$@tfH Hu H ֒HHd$ LL$DHT$@APQ=͑Oxu}%QHd$8Hd$0HD$HLD$@A3D$(HD$ 8PH IHt0Hd$ LL$DHT$HDPtfD$@AHL$PH3蹁HhH\$Hl$Ht$WHP3IHHH;tL;t @8*uH;tf)3H\$`Hl$hHt$pHP_HL$0IzL\$0A9ku%H;tf@8l$Ht HD$@HT$0;HL$0D A~0A;|+IH;LǺ D$(H\$ tOHL$0;uHc H;r(@8ot" @8l$H4HL$@#*@8l$Ht HD$@AH;AQLljD$(HD$0H\$ HN;E3H\$Hl$Ht$WH Hڅxi; 'saHcH-3HHHkXHDH<u==ju'tt u NHDH3 ( H\$0Hl$8Ht$@H _H\$Hl$WH xs; skHcH-HHHkXHDDtGH<t@=u)tt u 3MHDH 3a v H\$0Hl$8H _H8uR * ]x1; Ğs)HcH ОHƒHHkXHDtH, Hd$ E3E333 HH8HHXHpHxL` AUH HcLIL-VHkXKt|3 u3O 辡|3 uHL3#D3 蓠tKLHLJH\$0Ht$8H|$@Ld$HH A]HcH ΝHƒHHkXHHLH%hJH\$H|$Ld$AUAVAWH@IEE3AL$ #uA 3|$$H_@LcJHH\$0JH H;C{ u; 蜠{ u HKu DpDt$(C kEu HKICt HK|IHIEu?CL#LK+H.袋.HLIIH?LDDl$ HXH\$0IHf E;lj|$$HKXJiHD$0HttHcL%IЃ I H H;s@L @ ` HXHD$0|$ HcHHHkXIDHADD|$ 9AH\$`H|$hLd$pH@A_A^A]H8H{H3HD$(LD$ AD$&Iu HL$ HL$(H3{H8@USVWATAUAVAWHHl$@H`{H3HE0LE!3IH}LMDDH];HUTH;}HUA5H;}uzEAt`AHcHH;HL HwlHAH;w HH8H+H\$@Ht<NHxELúAω|$(H|$ Ho37VHHtH3HtLc3HMOsLEE̺Aω|$(H\$ )HE3A;M;t;L|$8L|$0D$(DL3ALt$ GA;ID9}u,L|$8L|$0DL3AD|$(L|$ JGA;tWHc׹fHI;tBL|$8L|$0DL3A͉|$(HD$  GA;u HI AtHMHK9u蟗HHM0H3xHeHA_A^A]A\_^[]3DB yLMtt_+uVHHtJHtEHHH Ht2zH;vH <9=uLHtHHHD83H\$0Ht$8H _H\$Ht$H|$ATH0IHH83Hu&ڑHd$ E3E333H'HtH#3Hu#蛑Hd$ E3E333诐zHHHu3fHL$I(nHHuC 81LIHtHd$ E3E333HtL#3۹EH\$@Ht$HH|$PH0A\Hl$WHpHcHL$P}tsbHT$P ~LD$P膫HT$PH@xtHH8|$ht HD$`