Commit bd0e565b authored by Domen Kožar's avatar Domen Kožar

Merge pull request #77 from rvanlaar/patch-1

PEP8 changes for bootstrap.py
parents ef7d2ad3 ee709cfb
...@@ -18,7 +18,11 @@ The script accepts buildout command-line options, so you can ...@@ -18,7 +18,11 @@ The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file. use the -c option to specify an alternate configuration file.
""" """
import os, shutil, sys, tempfile import os
import shutil
import sys
import tempfile
from optparse import OptionParser from optparse import OptionParser
tmpeggs = tempfile.mkdtemp() tmpeggs = tempfile.mkdtemp()
...@@ -61,7 +65,8 @@ options, args = parser.parse_args() ...@@ -61,7 +65,8 @@ options, args = parser.parse_args()
to_reload = False to_reload = False
try: try:
import pkg_resources, setuptools import pkg_resources
import setuptools
if not hasattr(pkg_resources, '_distribute'): if not hasattr(pkg_resources, '_distribute'):
to_reload = True to_reload = True
raise ImportError raise ImportError
...@@ -73,7 +78,8 @@ except ImportError: ...@@ -73,7 +78,8 @@ except ImportError:
except ImportError: except ImportError:
from urllib2 import urlopen from urllib2 import urlopen
exec(urlopen('http://python-distribute.org/distribute_setup.py').read(), ez) exec(urlopen('http://python-distribute.org/distribute_setup.py').read(),
ez)
setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True) setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True)
ez['use_setuptools'](**setup_args) ez['use_setuptools'](**setup_args)
...@@ -113,6 +119,7 @@ if version is None and not options.accept_buildout_test_releases: ...@@ -113,6 +119,7 @@ if version is None and not options.accept_buildout_test_releases:
# Figure out the most recent final version of zc.buildout. # Figure out the most recent final version of zc.buildout.
import setuptools.package_index import setuptools.package_index
_final_parts = '*final-', '*final' _final_parts = '*final-', '*final'
def _final_version(parsed_version): def _final_version(parsed_version):
for part in parsed_version: for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts): if (part[:1] == '*') and (part not in _final_parts):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment