Example #1
0
def get_content_mappings(app_path):
    """
    Gets the content mappings for the specified app.
    """
    content_mappings = []
    content_module = get_module('%s.axl.content' % app_path)
    from axilent.hooks import ContentMapping
    for name, attribute in inspect.getmembers(content_module):
        if inspect.isclass(attribute) and issubclass(attribute,ContentMapping) and not attribute is ContentMapping:
            content_mappings.append(attribute()) # Add instantiation of content mapping class
    return content_mappings
Example #2
0
def get_content_mappings(app_path):
    """
    Gets the content mappings for the specified app.
    """
    content_mappings = []
    content_module = get_module('%s.axl.content' % app_path)
    from axilent.hooks import ContentMapping
    for name, attribute in inspect.getmembers(content_module):
        if inspect.isclass(attribute) and issubclass(
                attribute, ContentMapping) and not attribute is ContentMapping:
            content_mappings.append(
                attribute())  # Add instantiation of content mapping class
    return content_mappings
Example #3
0
def register_apps():
    """
    Main registration method.
    """
    for app_path in settings.INSTALLED_APPS:
        if app_path != 'axilent': # don't load yourself
            try:
                channel_module = get_module('%s.axl.channels' % app_path)
                load_channels(app_path,channel_module)
            except ImportError:
                pass # no channels defined
            
            try:
                trigger_module = get_module('%s.axl.triggers' % app_path)
                load_triggers(app_path,trigger_module)
            except ImportError:
                pass # no triggers defined
            
            try:
                content_module = get_module('%s.axl.content' % app_path)
                load_content(app_path,content_module)
            except ImportError:
                pass # no content mappings defined
Example #4
0
def register_apps():
    """
    Main registration method.
    """
    for app_path in settings.INSTALLED_APPS:
        if app_path != 'axilent':  # don't load yourself
            try:
                channel_module = get_module('%s.axl.channels' % app_path)
                load_channels(app_path, channel_module)
            except ImportError:
                pass  # no channels defined

            try:
                trigger_module = get_module('%s.axl.triggers' % app_path)
                load_triggers(app_path, trigger_module)
            except ImportError:
                pass  # no triggers defined

            try:
                content_module = get_module('%s.axl.content' % app_path)
                load_content(app_path, content_module)
            except ImportError:
                pass  # no content mappings defined