Skip to content
woob_lint.py 1.03 KiB
Newer Older
import logging
import os
import sys

Roger Philibert's avatar
Roger Philibert committed
from woob.core import Woob
# Hint: use this script with file:///path/to/local/modules/ in sources.list
# if you want to correctly check all modules.


logging.basicConfig()
hydrargyrum's avatar
hydrargyrum committed
woob = Woob()
woob.modules_loader.load_all()
modules_without_tests = []
modules_without_icons = []
hydrargyrum's avatar
hydrargyrum committed
for name, module in woob.modules_loader.loaded.items():
    path = module.package.__path__[0]
    if not os.path.exists(os.path.join(path, 'test.py')):
        modules_without_tests.append(name)
    if not os.path.exists(os.path.join(path, 'favicon.png')) and \
hydrargyrum's avatar
hydrargyrum committed
       not os.path.exists(os.path.join(woob.repositories.icons_dir, '%s.png' % name)) and \
       not module.icon:
        modules_without_icons.append(name)
if modules_without_tests:
    print('\nModules without tests: %s' % ', '.join(sorted(modules_without_tests)))
if modules_without_icons:
    print('\nModules without icons: %s' % ', '.join(sorted(modules_without_icons)))
if modules_without_tests or modules_without_icons: