support repositories to manage backends (closes #747)

This commit is contained in:
Romain Bignon 2012-01-03 12:10:21 +01:00
commit 14a7a1d362
410 changed files with 1079 additions and 297 deletions

View file

@ -4,4 +4,4 @@ cd ..
# grep will return 0 only if it founds something, but our script
# wants to return 0 when it founds nothing!
pyflakes weboob scripts/* | grep -v redefinition && exit 1 || exit 0
pyflakes weboob modules contrib scripts/* | grep -v redefinition && exit 1 || exit 0

View file

@ -1,19 +1,28 @@
#!/usr/bin/env python
from weboob.core.modules import ModulesLoader
# Hint: use this script with file:///path/to/local/modules/ in sources.list
# if you want to correctly check all modules.
from weboob.core import Weboob
import weboob.backends
import os
loader = ModulesLoader()
loader.load_all()
backends_without_icons = [name for name, backend in loader.loaded.iteritems() if backend.icon_path is None]
if backends_without_icons:
print 'Backends without icons: %s' % backends_without_icons
weboob = Weboob()
weboob.modules_loader.load_all()
backends_without_tests = []
for name, backend in loader.loaded.iteritems():
if not os.path.exists(os.path.join(weboob.backends.__path__[0], name, 'test.py')):
backends_without_icons = []
for name, backend in weboob.modules_loader.loaded.iteritems():
path = backend.package.__path__[0]
if not os.path.exists(os.path.join(path, 'test.py')):
backends_without_tests.append(name)
if not os.path.exists(os.path.join(path, 'favicon.png')) and \
not os.path.exists(os.path.join(weboob.repositories.icons_dir, '%s.png' % name)) and \
not backend.icon:
backends_without_icons.append(name)
if backends_without_tests:
print 'Backends without tests: %s' % backends_without_tests
if backends_without_icons:
print 'Backends without icons: %s' % backends_without_icons