do not ask before installing a module

This commit is contained in:
Romain Bignon 2012-01-19 10:50:27 +01:00
commit fd22eb5367
2 changed files with 3 additions and 6 deletions

View file

@ -274,10 +274,7 @@ class ConsoleApplication(BaseApplication):
raise ModuleLoadError(name, 'Module does not exist') raise ModuleLoadError(name, 'Module does not exist')
if not minfo.is_installed(): if not minfo.is_installed():
print 'Module "%s" is available but not installed.' % minfo.name print 'Module "%s" is available but not installed.' % minfo.name
if self.ask('Do you want to install it now?', default=True): self.install_module(minfo)
self.install_module(minfo)
else:
return 1
module = self.weboob.modules_loader.get_or_load_module(name) module = self.weboob.modules_loader.get_or_load_module(name)
config = module.config config = module.config
else: else:

View file

@ -228,7 +228,7 @@ class BackendCfg(QDialog):
params.pop('_enabled', None) params.pop('_enabled', None)
info = self.weboob.repositories.get_module_info(name) info = self.weboob.repositories.get_module_info(name)
if info and (info.is_installed() or self.askInstallModule(info)): if info and (info.is_installed() or self.installModule(info)):
backend = self.weboob.modules_loader.get_or_load_module(bname) backend = self.weboob.modules_loader.get_or_load_module(bname)
for key, value in backend.config.load(self.weboob, bname, name, params, nofail=True).iteritems(): for key, value in backend.config.load(self.weboob, bname, name, params, nofail=True).iteritems():
try: try:
@ -266,7 +266,7 @@ class BackendCfg(QDialog):
warning('Module not found') warning('Module not found')
return return
if not minfo.is_installed() and not self.askInstallModule(minfo): if not minfo.is_installed() and not self.installModule(minfo):
self.editBackend(None) self.editBackend(None)
return return