Permalink
Browse files

try to unify the yes statement + fixes

  • Loading branch information...
1 parent ef4ba92 commit 52bfe1df3c8aaba4dc98c4c1663945f23b949e58 @fdev31 committed Jul 7, 2011
Showing with 10 additions and 9 deletions.
  1. +1 −1 pyg/inst.py
  2. +1 −1 pyg/parser/_opts.py
  3. +6 −5 pyg/parser/parser.py
  4. +2 −2 tests/features/check.feature
View
@@ -327,7 +327,7 @@ def uninstall(self):
for d in to_del:
logger.info(d)
logger.indent -= 8
- do_it = logger.ask('Proceed', bool=('remove files', 'cancel'), dont_ask=self.yes)
+ do_it = logger.ask('Proceed', bool=('remove files', 'cancel'), dont_ask=args_manager['install']['yes'])
if do_it:
for d in to_del:
try:
View
@@ -72,7 +72,7 @@ def _install_package_from_name(package, ignore=False):
return vcs(package, tempdir).install()
return Installer(package).install()
-def install_func(packname, req_file, editable, ignore):
+def install_func(packname, req_file, editable, ignore, yes):
check_and_exit()
if editable:
if len(packname) > 1:
View
@@ -55,11 +55,13 @@ def init_parser(version=None):
@arg('--no-scripts', action='store_true', help='Do not install scripts')
@arg('--no-data', action='store_true', help='Do not install data files')
@arg('--force-egg-install', action='store_true', help='Allow installing eggs with a different Python version')
+ @arg('-y', '--yes', action='store_true', help='Do not ask confirmation for the upgrade')
def install(args):
'''
Install a package
'''
+ args_manager['install']['yes'] = args.yes
args_manager['install']['no_deps'] = args.no_deps
args_manager['install']['upgrade'] = args.upgrade
args_manager['install']['no_scripts'] = args.no_scripts
@@ -82,7 +84,7 @@ def install(args):
## name of one of the packages to install
args_manager['install']['ignore'] = True
opts.install_func(args.packname, args.req_file, args.editable,
- args_manager['install']['ignore'])
+ args_manager['install']['ignore'], args_manager['install']['yes'])
@arg('packname', nargs='+')
@arg('-r', '--req-file', metavar='<path>', help='Uninstall all the packages listed in the given requirement file')
@@ -93,10 +95,10 @@ def remove(args):
Remove a package
'''
- args_manager['remove']['yes'] = args.yes
+ args_manager['install']['yes'] = args.yes
args_manager['remove']['info'] = args.info
opts.remove_func(args.packname, args.req_file,
- args_manager['remove']['yes'], args_manager['remove']['info'])
+ args_manager['install']['yes'], args_manager['remove']['info'])
@arg('packname')
@arg('-i', '--index-url', default='http://pypi.python.org/pypi', metavar='<url>', help='Base URL of Python Package Index (default to %(default)s)')
@@ -190,8 +192,7 @@ def update(args):
args_manager['install']['packages_url'] = args.index_url + '/simple'
args_manager['install']['index_url'] = args.index_url + '/pypi'
- if args.yes:
- args_manager['update']['yes'] = True
+ args_manager['install']['yes'] = args.yes
opts.update_func(args)
@command
@@ -2,9 +2,9 @@ Feature: check
Scenario: Install grin and bottle
Given I use "standard" environment
- Given I execute pyg install bottle
+ Given I execute pyg install -y bottle
Then the return code is 0
- Given I execute pyg install grin
+ Given I execute pyg install -y grin
Then the return code is 0
Scenario: Check Uninstalled packages

3 comments on commit 52bfe1d

This is really interesting! You should open a pull request!

Owner

fdev31 replied Jul 11, 2011

That's not working properly yet :P
In fact I suppose I have to understand the whole process better before trying to refactor that, now I have some time to spend, I'll check the pack command :)

Owner

fdev31 replied Jul 11, 2011

I'll open some issue just now so we can discuss things I've seen while trying to refactor....

Please sign in to comment.