diff --git a/weboob/core/modules.py b/weboob/core/modules.py index ce1cf288..553565c7 100644 --- a/weboob/core/modules.py +++ b/weboob/core/modules.py @@ -117,11 +117,12 @@ class ModulesLoader(object): except ImportError: return for path in weboob.backends.__path__: - regexp = re.compile('^%s/([\w\d_]+)$' % path) + self.logger.debug( 'Backend path: %s' % path ) for root, dirs, files in os.walk(path): - m = regexp.match(root) - if m and '__init__.py' in files: - yield m.group(1) + self.logger.debug( 'Walking on %s' % root ) + if os.path.dirname( root ) == path and '__init__.py' in files: + s = os.path.basename( root ) + yield s def load_all(self): for existing_module_name in self.iter_existing_module_names(): diff --git a/weboob/tools/application/formatters/iformatter.py b/weboob/tools/application/formatters/iformatter.py index 9cb7fca6..75c25778 100644 --- a/weboob/tools/application/formatters/iformatter.py +++ b/weboob/tools/application/formatters/iformatter.py @@ -20,6 +20,8 @@ from __future__ import with_statement import os import sys +import subprocess + try: import tty, termios except ImportError: @@ -83,7 +85,7 @@ class IFormatter(object): # XXX if stdin is not a tty, it seems that the command fails. if os.isatty(sys.stdout.fileno()) and os.isatty(sys.stdin.fileno()): - self.termrows = int(os.popen('stty size', 'r').read().split()[0]) + self.termrows = int( subprocess.Popen('stty size', stdout=subprocess.PIPE).communicate()[0].split()[0]) def after_format(self, formatted): if self.outfile != sys.stdout: