qt: display a dialog to ask user to update repositories at run if error

This commit is contained in:
Romain Bignon 2013-03-26 09:53:17 +01:00
commit 0a603ff42a
2 changed files with 35 additions and 3 deletions

View file

@ -36,6 +36,9 @@ from weboob.tools.log import getLogger
__all__ = ['Weboob']
class VersionsMismatchError(ConfigError):
pass
class Weboob(object):
"""
The main class of Weboob, used to manage backends and call methods.
@ -196,7 +199,7 @@ class Weboob(object):
if not self.repositories.check_repositories():
self.logger.error(u'Repositories are not consistent with the sources.list')
raise ConfigError(u'Versions mismatch, please run "weboob-config update"')
raise VersionsMismatchError(u'Versions mismatch, please run "weboob-config update"')
for instance_name, module_name, params in self.backends_config.iter_backends():
if '_enabled' in params and not params['_enabled'].lower() in ('1', 'y', 'true', 'on', 'yes') or \