aboutsummaryrefslogtreecommitdiff
path: root/src/plugin.py
blob: a2d8f264062fbbb957a23000e45746f504ca9521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from Plugins.Plugin import PluginDescriptor

import CurlyTx
from . import config
from Components.config import config

 
def main(session, **kwargs):
    reload(CurlyTx)
    try:
        session.open(CurlyTx.CurlyTx)
    except:
        import traceback
        traceback.print_exc()

def menuHook(menuid):
    if menuid == "mainmenu" and config.plugins.CurlyTx.menuMain.value:
        return [(config.plugins.CurlyTx.menuTitle.value, main, "curlytx", 1)]
    return [ ]

 
def Plugins(**kwargs):
    return [
        PluginDescriptor(name = config.plugins.CurlyTx.menuTitle.value,
                         description = "View remote text files",
                         where = [PluginDescriptor.WHERE_PLUGINMENU],
                         fnc = main),
        PluginDescriptor(name = config.plugins.CurlyTx.menuTitle.value,
                         description = "View remote text files",
                         where=PluginDescriptor.WHERE_MENU,
                         fnc = menuHook),
        ]