예제 #1
0
    def __init__(self, session, hostName):
        Screen.__init__(self, session)

        self.onChangedEntry = []
        self.list = []
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=session,
                                  on_change=self.changedEntry)
        self.hostName = hostName
        self.setup_title = _("Configuration of %s") % self.hostName

        self["key_green"] = Label(_("Save"))
        self["key_red"] = Label(_("Cancel"))
        self["key_blue"] = Label(_('Virtual Keyboard'))

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "cancel": self.keyCancel,
                "green": self.keySave,
                "ok": self.keySave,
                "red": self.keyCancel,
                "blue": self.keyVirtualKeyBoard,
            }, -2)

        self.host = __import__('forums.forum' + hostName, globals(), locals(),
                               ['GetConfigList'], -1)
        self.runSetup()
        self.onLayoutFinish.append(self.layoutFinished)
예제 #2
0
    def __init__(self, session):
        Screen.__init__(self, session)
        
        self.onChangedEntry = [ ]
        self.list = [ ]
        ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
        self.setup_title = _("Boards Reader settings")

        self["key_green"] = Label(_("Save"))
        self["key_red"] = Label(_("Cancel"))
        self["actions"] = ActionMap(["SetupActions", "ColorActions"],
            {
                "cancel": self.keyCancel,
                "green": self.keySave,
                "ok": self.keyOK,
                "red": self.keyCancel,
            }, -2)

        global gListOfHostsNames
        # prepar config entries for hosts Enabling/Disabling
        self.listConfigHostsEntries = []
        for hostName in gListOfHostsNames:
            exec( 'self.listConfigHostsEntries.append(getConfigListEntry( "%s" , config.plugins.BoardReader.host' % _("Press OK to set %s options") % hostName + hostName + '))' )
        
        self.firstHostIdx = -1
        self.runSetup()
        self.onLayoutFinish.append(self.layoutFinished)
예제 #3
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self.onChangedEntry = []
        self.list = []
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=session,
                                  on_change=self.changedEntry)
        self.setup_title = _("Boards Reader settings")

        self["key_green"] = Label(_("Save"))
        self["key_red"] = Label(_("Cancel"))
        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "cancel": self.keyCancel,
                "green": self.keySave,
                "ok": self.keyOK,
                "red": self.keyCancel,
            }, -2)

        global gListOfHostsNames
        # prepar config entries for hosts Enabling/Disabling
        self.listConfigHostsEntries = []
        for hostName in gListOfHostsNames:
            exec(
                'self.listConfigHostsEntries.append(getConfigListEntry( "%s" , config.plugins.BoardReader.host'
                % _("Press OK to set %s options") % hostName + hostName + '))')

        self.firstHostIdx = -1
        self.runSetup()
        self.onLayoutFinish.append(self.layoutFinished)
예제 #4
0
    def __init__(self, session, hostName):
        Screen.__init__(self, session)
        
        self.onChangedEntry = [ ]
        self.list = [ ]
        ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
        self.hostName = hostName
        self.setup_title = _("Configuration of %s") % self.hostName

        self["key_green"] = Label(_("Save"))
        self["key_red"] = Label(_("Cancel"))
        self["key_blue"] = Label(_('Virtual Keyboard'))

        self["actions"] = ActionMap(["SetupActions", "ColorActions"],
            {
                "cancel": self.keyCancel,
                "green": self.keySave,
                "ok": self.keySave,
                "red": self.keyCancel,
                "blue": self.keyVirtualKeyBoard,
            }, -2)

        self.host = __import__('forums.forum' + hostName, globals(), locals(), ['GetConfigList'], -1)
        self.runSetup()
        self.onLayoutFinish.append(self.layoutFinished)
예제 #5
0
    def runSetup(self):

        self.list = []
        self.list.append(getConfigListEntry(_("Forum selection style:"), config.plugins.BoardReader.SelectFromList))
        self.list.append(getConfigListEntry(_("Display last posts on top:"), config.plugins.BoardReader.PostsInReverseOrder))
        self.list.append(getConfigListEntry(_("Show plugin on the Extensions menu?"), config.plugins.BoardReader.showinextensions))
        self.list.append(getConfigListEntry(_("Show plugin in main menu?"), config.plugins.BoardReader.showinMainMenu))
        self.list.append(getConfigListEntry("   ", config.plugins.BoardReader.separator))
        self.firstHostIdx = len(self.list)
        
        for hostConfItem in  self.listConfigHostsEntries:
            self.list.append( hostConfItem )
        
        self["config"].list = self.list
        self["config"].setList(self.list)
예제 #6
0
def startIPTVfromMenu(menuid, **kwargs):
    #if menuid == "system":
        #return [(_("Configure Boards Client"), mainSetup, "boardsclient_config", None)]
    #el
    if menuid == "mainmenu" and config.plugins.BoardReader.showinMainMenu.value == True:
        return [(_("Boards Client"), main, "boardsclient_main", None)]
    else:
        return []
예제 #7
0
    def selectHost(self):
    
        self.host = None
        self.hostName = ''
        self.nextSelIndex = 0
        self.prevSelList = []
        self.categoryList = []
        self.currList = []
        self.currSelectedItemName = ""
        self.json_installed = False
        try:
            import simplejson
            self.json_installed = True
        except:
            pass
        try:
            import json as simplejson
            self.json_installed = True
        except:
            pass

        options = [] 
        hostsList = GetHostsList()
        brokenHostList = []
        for hostName in hostsList:
            hostEnabled  = False
            try:
                exec('if config.plugins.BoardReader.host' + hostName + '.value: hostEnabled = True')
            except:
                hostEnabled = False
            if True == hostEnabled:
                if not config.plugins.BoardReader.devHelper.value:
                    try:
                        _temp = __import__('forums.forum' + hostName, globals(), locals(), ['gettytul'], -1)
                        title = _temp.gettytul()
                        printDBG('host name "%s"' % hostName)
                    except:
                        printDBG('get host name exception for host "%s"' % hostName)
                        brokenHostList.append('host'+hostName)
                        continue # do not use default name if import name will failed
                else:
                    _temp = __import__('forums.forum' + hostName, globals(), locals(), ['gettytul'], -1)
                    title = _temp.gettytul()
                    printDBG('host name "%s"' % hostName)
                options.extend(((title, hostName),))
        options.sort()
        
        #if len(brokenHostList) > 0:
        #    self.session.open(MessageBox, "Poniższe playery są niepoprawne lub brakuje im pewnych modułów.\n" + '\n'.join(brokenHostList), type = MessageBox.TYPE_INFO, timeout = 10 )
     
        options.extend(((_("Config"), "config"),))
        from playerselector import PlayerSelectorWidget

        self.session.openWithCallback(self.selectHostCallback, PlayerSelectorWidget, list = options)
        return
예제 #8
0
 def keyVirtualKeyBoard(self):
     try:
         if isinstance(self["config"].getCurrent()[1], ConfigText):
             from Screens.VirtualKeyBoard import VirtualKeyBoard
             text = self["config"].getCurrent()[1].value
             self.session.openWithCallback(self.keyVirtualKeyBoardCallBack,
                                           VirtualKeyBoard,
                                           title=(_("Select value")),
                                           text=text)
     except:
         pass
예제 #9
0
    def runSetup(self):

        self.list = []
        self.list.append(
            getConfigListEntry(_("Forum selection style:"),
                               config.plugins.BoardReader.SelectFromList))
        self.list.append(
            getConfigListEntry(_("Display last posts on top:"),
                               config.plugins.BoardReader.PostsInReverseOrder))
        self.list.append(
            getConfigListEntry(_("Show plugin on the Extensions menu?"),
                               config.plugins.BoardReader.showinextensions))
        self.list.append(
            getConfigListEntry(_("Show plugin in main menu?"),
                               config.plugins.BoardReader.showinMainMenu))
        self.list.append(
            getConfigListEntry("   ", config.plugins.BoardReader.separator))
        self.firstHostIdx = len(self.list)

        for hostConfItem in self.listConfigHostsEntries:
            self.list.append(hostConfItem)

        self["config"].list = self.list
        self["config"].setList(self.list)
예제 #10
0
    def runSetup(self):

        # WYGLAD
        self.list = [ getConfigListEntry(_("Show icons:"), config.plugins.BoardReader.showcover) ]
        if config.plugins.BoardReader.showcover.value:
            self.list.append(getConfigListEntry(_("    Delete icons:"), config.plugins.BoardReader.deleteIcons))
        self.list.append(getConfigListEntry(_("Cache folder:"), config.plugins.BoardReader.SciezkaCache))
        self.list.append(getConfigListEntry(_("Temp folder:"), config.plugins.BoardReader.NaszaTMP))
        
        self.list.append(getConfigListEntry(_("Show plugin on the Extensions menu?"), config.plugins.BoardReader.showinextensions))
        self.list.append(getConfigListEntry(_("Show plugin in main menu?"), config.plugins.BoardReader.showinMainMenu))
        #self.list.append(getConfigListEntry("Wyświetlać aktualizację w głównym menu?", config.plugins.BoardReader.AktualizacjaWmenu))
        self.list.append(getConfigListEntry(_("Enable DEBUG?"), config.plugins.BoardReader.debugprint))
        self.list.append(getConfigListEntry(_("Disable secured mode? (error ends with GS)"), config.plugins.BoardReader.devHelper))
        self.list.append(getConfigListEntry(_("Clean folder during update?"), config.plugins.BoardReader.cleanup))
        
        self.firstHostIdx = len(self.list)
        
        for hostConfItem in  self.listConfigHostsEntries:
            self.list.append( hostConfItem )
        
        self["config"].list = self.list
        self["config"].setList(self.list)
예제 #11
0
 def back_pressed(self):
     try:
         if not self.isNotInWorkThread():
             self.workThread.Thread._Thread__stop()
             self["statustext"].setText(_("Action cancelled!"))
             return
     except:
         return
         
     if self.visible:
                    
         if len(self.prevSelList) > 0:
             self.nextSelIndex = self.prevSelList.pop()
             self.categoryList.pop()
             printDBG( "back_pressed prev sel index %s" % self.nextSelIndex )
             self.requestListFromHost('Previous')
         else:
             #There is no prev categories, so exit
             #self.close()
             self.selectHost()
     else:
         self.showWindow()
         
     return
예제 #12
0
 def layoutFinished(self):
     self.setTitle(_("Configuration of %s") % self.hostName)
예제 #13
0
def Plugins(**kwargs):
    list = [PluginDescriptor(name=_("Boards Client"), description=_("Various forums client"), where = [PluginDescriptor.WHERE_PLUGINMENU], icon="logo.png", fnc=main)] # always show in plugin menu
    list.append(PluginDescriptor(name=_("Boards Client"), description=_("Various forums client"), where = PluginDescriptor.WHERE_MENU, fnc=startIPTVfromMenu))
    if config.plugins.BoardReader.showinextensions.value:
        list.append (PluginDescriptor(name=_("Boards Client"), description=_("Various forums client"), where = [PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main))
    return list
예제 #14
0
 def layoutFinished(self):
     self.setTitle(_("Boards Reader settings"))
예제 #15
0
#
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigNothing, NoSave, ConfigYesNo, Config, ConfigInteger, ConfigSubList, ConfigText, getConfigListEntry, configfile
from Components.ConfigList import ConfigListScreen
from libs.tools import removeAllIconsFromPath, GetHostsList, IsHostEnabled, TranslateTXT as _
from confighost import ConfigHostMenu

config.plugins.BoardReader = ConfigSubsection()
config.plugins.BoardReader.separator = NoSave(ConfigNothing())
config.plugins.BoardReader.showinextensions = ConfigYesNo(default=True)
config.plugins.BoardReader.showinMainMenu = ConfigYesNo(default=False)
config.plugins.BoardReader.PostsInReverseOrder = ConfigYesNo(default=True)
config.plugins.BoardReader.SelectFromList = ConfigSelection(
    default="list", choices=[("list", _("List")), ("picons", _("Picons"))])

########################################################
# Generate list of hosts options for Enabling/Disabling
########################################################
gListOfHostsNames = []
gListOfHostsNames = GetHostsList()
for hostName in gListOfHostsNames:
    try:
        print("Set default options for host '%s'" % hostName)
        # as default all hosts are enabled
        exec('config.plugins.BoardReader.host' + hostName +
             ' = ConfigYesNo(default = True)')
    except:
        print("Options import for host '%s' EXEPTION" % hostName)
예제 #16
0
 def keyVirtualKeyBoard(self):
     try:
         if isinstance( self["config"].getCurrent()[1], ConfigText ):
             from Screens.VirtualKeyBoard import VirtualKeyBoard
             text = self["config"].getCurrent()[1].value
             self.session.openWithCallback(self.keyVirtualKeyBoardCallBack, VirtualKeyBoard, title = (_("Select value")), text = text)
     except:
         pass
예제 #17
0
 def layoutFinished(self):
     self.setTitle(_("Boards Client config"))
예제 #18
0
 def startSearchProcedure(self, searchTypes):
     if searchTypes:
         self.session.openWithCallback(self.selectSearchTypeCallback, ChoiceBox, title = "Wybierz typ wyszukiwania", list = searchTypes)
     else:
         self.searchType = None
         self.session.openWithCallback(self.enterPatternCallBack, VirtualKeyBoard, title = (_("WprowadŸz wzorzec")), text = self.searchPattern)
예제 #19
0
 def layoutFinished(self):
     self.setTitle(_("Configuration of %s") % self.hostName)
예제 #20
0
    def __init__(self, session):
        Screen.__init__(self, session)
        
        # remember old
        self.showcoverOld = config.plugins.BoardReader.showcover.value
        self.SciezkaCacheOld = config.plugins.BoardReader.SciezkaCache.value

        self.onChangedEntry = [ ]
        self.list = [ ]
        ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
        self.setup_title = "Settings config"

        self["key_green"] = Label(_("Save"))
        self["key_red"] = Label(_("Cancel"))
        self["key_blue"] = Label('VK')
        self.iptvtools_GetGITversion = ''
        try:
            import tarfile 
            UpdateAvailable = True
        except:
            UpdateAvailable = False

        if UpdateAvailable == True:
            try:
                from _version import version as wersja
                from libs.tools import GetGITversion as iptvtools_GetGITversion
                self.iptvtools_GetGITversion = iptvtools_GetGITversion()
                if iptvtools_GetGITversion() == wersja:
                    UpdateAvailable = False
            except:
                pass
        if UpdateAvailable == True:
            self["key_yellow"] = Label(_('Update'))
            self["actions"] = ActionMap(["SetupActions", "ColorActions"],
                {
                    "cancel": self.keyCancel,
                    "green": self.keySave,
                    "ok": self.keyOK,
                    "red": self.keyCancel,
                    "blue": self.keyVirtualKeyBoard,
                    "yellow": self.keyUpdate,
                }, -2)
        else:
            self["key_yellow"] = Label(_('v. up-2-date'))
            self["actions"] = ActionMap(["SetupActions", "ColorActions"],
                {
                    "cancel": self.keyCancel,
                    "green": self.keySave,
                    "ok": self.keyOK,
                    "red": self.keyCancel,
                    "blue": self.keyVirtualKeyBoard,
                }, -2)

        global gListOfHostsNames
        # prepar config entries for hosts Enabling/Disabling
        self.listConfigHostsEntries = []
        for hostName in gListOfHostsNames:
            exec( 'self.listConfigHostsEntries.append(getConfigListEntry( "%s" , config.plugins.BoardReader.host' % _("Press OK to set %s options") % hostName + hostName + '))' )
        
        self.firstHostIdx = -1
        self.runSetup()
        self.onLayoutFinish.append(self.layoutFinished)
예제 #21
0
#  BoardsReader 2015 by j00zek 2015
#
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigNothing, NoSave, ConfigYesNo, Config, ConfigInteger, ConfigSubList, ConfigText, getConfigListEntry, configfile
from Components.ConfigList import ConfigListScreen
from libs.tools import removeAllIconsFromPath, GetHostsList, IsHostEnabled, TranslateTXT as _
from confighost import ConfigHostMenu

config.plugins.BoardReader = ConfigSubsection()
config.plugins.BoardReader.separator = NoSave(ConfigNothing())
config.plugins.BoardReader.showinextensions = ConfigYesNo(default = True)
config.plugins.BoardReader.showinMainMenu = ConfigYesNo(default = False)
config.plugins.BoardReader.PostsInReverseOrder = ConfigYesNo(default = True)
config.plugins.BoardReader.SelectFromList = ConfigSelection(default = "list", choices = [("list", _("List")),("picons", _("Picons"))]) 

########################################################
# Generate list of hosts options for Enabling/Disabling
########################################################
gListOfHostsNames = [] 
gListOfHostsNames = GetHostsList()
for hostName in gListOfHostsNames:
    try:
        print("Set default options for host '%s'" % hostName)
        # as default all hosts are enabled
        exec('config.plugins.BoardReader.host' + hostName + ' = ConfigYesNo(default = True)')
    except:
        print("Options import for host '%s' EXEPTION" % hostName)

class ConfigMenu(Screen, ConfigListScreen):
예제 #22
0
 def layoutFinished(self):
     self.setTitle(_("Boards Reader settings"))
예제 #23
0
 def selectSearchTypeCallback(self, ret = None):
     if ret:
         self.searchType = ret[1]
         self.session.openWithCallback(self.enterPatternCallBack, VirtualKeyBoard, title = (_("WprowadŸz wzorzec")), text = self.searchPattern)
     else:
         pass
예제 #24
0
#  Konfigurator dla iptv 2013
#  autorzy: j00zek, samsamsam
#
#aktualizacja
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.Label import Label
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigDirectory, ConfigYesNo, Config, ConfigInteger, ConfigSubList, ConfigText, getConfigListEntry, configfile
from Components.ConfigList import ConfigListScreen
from libs.tools import removeAllIconsFromPath, printDBG, GetHostsList, IsHostEnabled, TranslateTXT as _
from confighost import ConfigHostMenu

config.plugins.BoardReader = ConfigSubsection()
config.plugins.BoardReader.showcover = ConfigYesNo(default = True)
config.plugins.BoardReader.deleteIcons = ConfigSelection(default = "0", choices = [("0", _("always")),("1", _("after day")),("3", _("after 3 days")),("7", _("after week")),("30", _("after month")),("-1", _("never"))]) 
config.plugins.BoardReader.showinextensions = ConfigYesNo(default = True)
config.plugins.BoardReader.showinMainMenu = ConfigYesNo(default = False)
config.plugins.BoardReader.NaszaSciezka = ConfigText(default = "/hdd/movie/", fixed_size = False)
config.plugins.BoardReader.AktualizacjaWmenu = ConfigYesNo(default = False)
config.plugins.BoardReader.devHelper = ConfigYesNo(default = False)

config.plugins.BoardReader.SciezkaCache = ConfigText(default = "/tmp/IPTVCache/", fixed_size = False)
config.plugins.BoardReader.NaszaTMP = ConfigText(default = "/tmp/", fixed_size = False)

config.plugins.BoardReader.debugprint = ConfigSelection(default = "", choices = [("", "no"),("console", "yes, on console"),("debugfile", "yes, in /tmp/iptv.dbg file")]) 

#icons
config.plugins.BoardReader.IconsSize = ConfigSelection(default = "100", choices = [("135", "135x135"),("120", "120x120"),("100", "100x100")]) 
config.plugins.BoardReader.numOfRow = ConfigSelection(default = "0", choices = [("1", "1"),("2", "2"),("3", "3"),("4", "4"),("0", "auto")])
config.plugins.BoardReader.numOfCol = ConfigSelection(default = "0", choices = [("1", "1"),("2", "2"),("3", "3"),("4", "4"),("5", "5"),("6", "6"),("7", "7"),("8", "8"),("0", "auto")])