Пример #1
0
def _load_plugin_info_from_item(pkgdir):
    '''
    Tries really hard to load the plugin info from the specified item.
    '''

    try:
        return importers.yaml_import('info', loadpath=[pkgdir])
    except ImportError:
        try:
            return importers.yaml_load(pkgdir / 'info.yaml')
        except Exception:
            return None
Пример #2
0
def _load_plugin_info_from_item(pkgdir):
    '''
    Tries really hard to load the plugin info from the specified item.
    '''

    try:
        return importers.yaml_import('info', loadpath = [pkgdir])
    except ImportError:
        try:
            return importers.yaml_load(pkgdir / 'info.yaml')
        except Exception:
            return None
Пример #3
0
def _actions():

    global _actions_cached
    global _actions_imported

    if _actions_imported:
        return _actions_cached

    from gui import skin
    try:
        actions = importer.yaml_import('actions', loadpath = [skin.resourcedir()])
    except ImportError:
        actions = {}
    finally:
        _actions_imported = True

    add_actions(actions)
    return _actions_cached
Пример #4
0
def get_notification_info(_cache = []):
    try:
        nots = _cache[0]
    except IndexError:
        pass

        from gui import skin
        mod = importer.yaml_import('notificationview', loadpath = [skin.resourcedir()])

        nots = _process_notifications_list(mod.__content__)

        _cache.append(nots)

    # allow plugins to add their own notification topics here.
    import hooks
    hooks.notify('digsby.notifications.get_topics', nots)

    return nots
Пример #5
0
def _actions():

    global _actions_cached
    global _actions_imported

    if _actions_imported:
        return _actions_cached

    from gui import skin
    try:
        actions = importer.yaml_import('actions',
                                       loadpath=[skin.resourcedir()])
    except ImportError:
        actions = {}
    finally:
        _actions_imported = True

    add_actions(actions)
    return _actions_cached
Пример #6
0
def get_notification_info(_cache=[]):
    try:
        nots = _cache[0]
    except IndexError:
        pass

        from gui import skin
        mod = importer.yaml_import('notificationview',
                                   loadpath=[skin.resourcedir()])

        nots = _process_notifications_list(mod.__content__)

        _cache.append(nots)

    # allow plugins to add their own notification topics here.
    import hooks
    hooks.notify('digsby.notifications.get_topics', nots)

    return nots
Пример #7
0
 def yaml_load(self, yamlname):
     try:
         return importers.yaml_import(yamlname, loadpath=[self.path])
     except ImportError:
         return None
Пример #8
0
 def yaml_load(self, yamlname):
     try:
         return importers.yaml_import(yamlname, loadpath = [self.path])
     except ImportError:
         return None