Esempio n. 1
0
def connectors():
    from django.conf import settings

    for app in settings.INSTALLED_APPS:
        try:
            get_module_attrs(app, 'connector')
        except NoModuleError:
            pass
Esempio n. 2
0
def _load_paths(leaf_module):
    paths = []

    for app in SUB_APPLICATIONS:
        try:
            paths.extend(
                get_module_attrs(
                    'turbion.bits.%s' % app,
                    leaf_module
                )['__path__']
            )
        except NoModuleError:
            pass

    return paths
Esempio n. 3
0
def tests():
    from django.test import TestCase
    test_classes = {}

    for app in SUB_APPLICATIONS:
        try:
            test_classes.update(
                get_module_attrs(
                    'turbion.bits.%s' % app,
                    'tests',
                    lambda attr: isinstance(attr, type) and issubclass(attr, TestCase)
                )
            )
        except NoModuleError:
            pass

    return test_classes
Esempio n. 4
0
def models():
    from django.db.models import Model
    model_classes = {}

    for app in SUB_APPLICATIONS:
        try:
            model_classes.update(
                get_module_attrs(
                    'turbion.bits.%s' % app,
                    'models',
                    lambda attr: isinstance(attr, type) and issubclass(attr, Model)
                )
            )
        except NoModuleError:
            pass

    return model_classes
Esempio n. 5
0
def indexes():
    for app in SUB_APPLICATIONS:
        try:
            get_module_attrs('turbion.bits.%s' % app, 'index')
        except NoModuleError:
            pass