Fixing pep8 errors

This commit is contained in:
Jon Wayne Parrott 2014-08-30 21:25:03 -04:00
parent acf8634e8f
commit 12ff251d2d
2 changed files with 19 additions and 6 deletions

View File

@ -52,8 +52,9 @@ class InstallCommand(Command):
metavar='dir',
default=None,
help='Install packages into <dir>. '
'By default this will not replace existing files/folders in <dir>.'
'Use --upgrade to replace existing packages in <dir> with new versions.'
'By default this will not replace existing files/folders in '
'<dir>. Use --upgrade to replace existing packages in <dir> '
'with new versions.'
)
cmd_opts.add_option(
@ -350,10 +351,19 @@ class InstallCommand(Command):
target_item_dir = os.path.join(options.target_dir, item)
if os.path.exists(target_item_dir):
if not options.upgrade:
logger.warn('Target directory %s already exists. Specify --upgrade to force replacement.' % target_item_dir)
logger.warn(
'Target directory %s already exists. Specify '
'--upgrade to force replacement.'
% target_item_dir
)
continue
if not os.path.isdir(target_item_dir):
logger.warn('Target directory %s already exists and is not a directory. Please remove in order for replacement.' % target_item_dir)
logger.warn(
'Target directory %s already exists and is '
'not a directory. Please remove in order '
'for replacement.'
% target_item_dir
)
continue
shutil.rmtree(target_item_dir)

View File

@ -532,11 +532,14 @@ def test_install_package_with_target(script):
assert not Path('scratch') / 'target' / 'initools' in result.files_updated
# Test upgrade call, check that new version is installed
result = script.pip('install', '--upgrade', '-t', target_dir, "initools==0.2")
result = script.pip('install', '--upgrade', '-t',
target_dir, "initools==0.2")
assert Path('scratch') / 'target' / 'initools' in result.files_updated, (
str(result)
)
assert Path('scratch') / 'target' / 'INITools-0.2-py%s.egg-info' % pyversion in result.files_created, (
egg_folder = (
Path('scratch') / 'target' / 'INITools-0.2-py%s.egg-info' % pyversion)
assert egg_folder in result.files_created, (
str(result)
)