From 36f1e50acc58cf57a0197e4df9b936ee41023d41 Mon Sep 17 00:00:00 2001 From: dream-alpha Date: Sat, 18 May 2024 11:39:01 +0200 Subject: [PATCH] 0.5.0 --- CONTROL/control | 2 +- src/EasyMenu.py | 68 ++++++++++++++++-- src/TvSpielfilmView.py | 2 +- src/TvSpielfilmchannel.py | 41 ++++++----- src/TvSpielfilmmain.py | 117 +++---------------------------- src/TvSpielfilmsearch.py | 9 +-- src/Version.py | 2 +- src/_tvdict.py | 112 +++++++++++++++++++++++++++++ src/tools.py | 50 +------------ src/tvspielfilmsetup.py | 17 +++-- src/tvspielfilmtipps.py | 53 ++------------ src/tvspielfilmtvprogramm.py | 66 ++--------------- src/tvspielfilmtvprogrammfavo.py | 76 ++------------------ 13 files changed, 231 insertions(+), 384 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 917d5d1..d3cf0ea 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,6 +1,6 @@ Description: TVMagazineCockpit Maintainer: dream-alpha Package: enigma2-plugin-extensions-tvmagazinecockpit -Version: 0.4.1 +Version: 0.5.0 Architecture: all Depends: enigma2-plugin-skincomponents-extMultiListSelection diff --git a/src/EasyMenu.py b/src/EasyMenu.py index d376115..edabcd4 100644 --- a/src/EasyMenu.py +++ b/src/EasyMenu.py @@ -1,13 +1,21 @@ from Screens.ChoiceBox import ChoiceBox from .__init__ import _ from .Debug import logger +from .tvspielfilmsetup import TvSpielfilmstartSetup +from .tvspielfilmsetup import TvSpielfilmmainSetup +from .tvspielfilmsetup import TvSpielfilmsearchSetup +from .TvSpielfilmchannel import TvSpielfilmchannel +from .tvconfig import make_default_string, read_ServiceReference +from ._tvdict import _changed, _channelreference, _tv_config -class EasyMenu(ChoiceBox): - def __init__(self, session, title='Tv Spielfilm', alist=None, keys=None, selection=0, skin_name=None, windowTitle=_('Easy-Selection'), allow_cancel=True, titlebartext=_("Input")): +class EasyMenu(): + def __init__(self, csel): + logger.info("...") + self.csel = csel + + def openEasyMenu(self, session): logger.info("...") - if skin_name is None: - skin_name = [] alist = [] alist.append((_("Tv Spielfilm Main"), 'main')) alist.append((_("Tv Spielfilm Tipps"), 'tipps')) @@ -16,8 +24,54 @@ def __init__(self, session, title='Tv Spielfilm', alist=None, keys=None, selecti alist.append((_("Tv Spielfilm Programm Favo"), 'programmfavo')) alist.append((_("Tv Spielfilm search"), 'search')) alist.append(('--', '--')) - alist.append(('Tv Spielfilm Start ' + _("Setup"), 'startsetup')) - alist.append(('Tv Spielfilm Main ' + _("Setup"), 'mainsetup')) + alist.append(('Tv Spielfilm Start' + ' ' + _("Setup"), 'startsetup')) + alist.append(('Tv Spielfilm Main' + ' ' + _("Setup"), 'mainsetup')) + alist.append(('Tv Spielfilm Search' + ' ' + _("Setup"), 'searchsetup')) alist.append((_('Favourites') + '/' + _('Bouquets') + ' ' + _("Setup"), 'tvchannel')) - ChoiceBox.__init__(self, session, title=title, list=alist, keys=keys, selection=selection, skin_name=skin_name, windowTitle=windowTitle, allow_cancel=allow_cancel, titlebartext=titlebartext) + session.openWithCallback(self.openEasyMenuCallback, ChoiceBox, title='Tv Spielfilm', list=alist, windowTitle=_('Easy-Selection'), allow_cancel=True, titlebartext=_("Input")) + + def openEasyMenuCallback(self, next_screen=None): + logger.info("...") + if next_screen: + if next_screen[1] == 'main': + self.close('main') + elif next_screen[1] == 'tipps': + self.close('tipps') + elif next_screen[1] == 'programm': + self.close('programm') + elif next_screen[1] == 'programmsky': + self.close('programmsky') + elif next_screen[1] == 'programmfavo': + self.close('programmfavo') + elif next_screen[1] == 'search': + self.key_search() + elif next_screen[1] == 'tvchannel': + self.session.open(TvSpielfilmchannel) + elif next_screen[1] == 'startsetup': + self.session.open(TvSpielfilmstartSetup) + elif next_screen[1] == "mainsetup": + self.session.openWithCallback(self.key_menu_back, TvSpielfilmmainSetup) + elif next_screen[1] == "searchsetup": + self.session.open(TvSpielfilmsearchSetup) + elif next_screen[1] == "tvchannel": + self.session.openWithCallback(self.key_channel_back, TvSpielfilmchannel) + + def key_menu_back(self, changed=False): + logger.info("...") + if changed: + _changed['config'] = True + self.csel["liste"].clearList() + if not _channelreference: + read_ServiceReference() + make_default_string() + if _tv_config.get('time').get('default'): + text = _tv_config.get('time').get(_tv_config.get('time').get('default')).get('disname', '') + self.csel["key_blue"].setText(text) + self.update_Title() + + def key_channel_back(self, changed=False): + logger.info("...") + if changed: + _changed['config'] = True + make_default_string() diff --git a/src/TvSpielfilmView.py b/src/TvSpielfilmView.py index 1af31a5..8e1cb3f 100755 --- a/src/TvSpielfilmView.py +++ b/src/TvSpielfilmView.py @@ -83,7 +83,7 @@ def makebigpixmap(self, myfile=None): self["bigpixmap"].instance.setPixmap(gPixmapPtr()) scale = AVSwitch().getFramebufferScale() size = self['bigpixmap'].instance.size() - self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "# 00000000")) + self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000")) self.picload.startDecode(myfile) def createsetup(self): diff --git a/src/TvSpielfilmchannel.py b/src/TvSpielfilmchannel.py index 9016caa..70db291 100644 --- a/src/TvSpielfilmchannel.py +++ b/src/TvSpielfilmchannel.py @@ -18,7 +18,7 @@ from .tvconfig import write_channels, channels_file_name, _premode, write_error_log from .tvconfig import read_channel_list, is_in_fovo, write_default_channels, configdefaultchannelsuser, read_channel_list_favo from .tvconfig import read_default_channels, read_file_tvdefault, checkvideomode, prevideodict -from ._tvdict import _tv_config, _channelcache, _tv_config_config +from ._tvdict import _tv_config, _channelcache, _tv_config_config, _changed from .tvspielfilmsetup import TvSpielfilmservice from .__init__ import _ from .MYList import MYList @@ -73,7 +73,6 @@ def __init__(self, session): self[myx].hide() self["message"] = Label() self.listtype = '' - self.change = {'fovo': False, 'default': False, 'config': False} self.masterliste = {} self.masterliste['favourites'] = read_channel_list_favo() self.masterliste['defaultchannels'] = [] @@ -90,14 +89,14 @@ def keyUp(self): self["liste"].moveSelection("moveUp") self["liste"].list.insert(self['liste'].getIndex(), self["liste"].list.pop(currindex)) if self.listtype in 'blue': - self.change['fovo'] = True + _changed['fovo'] = True elif self.listtype in 'yellow': - self.change['default'] = True + _changed['default'] = True return except Exception: self["actionsmove"].setEnabled(False) - self.change['fovo'] = False - self.change['default'] = False + _changed['fovo'] = False + _changed['default'] = False def keyDown(self): logger.info("...") @@ -108,14 +107,14 @@ def keyDown(self): self["liste"].moveSelection("moveDown") self["liste"].list.insert(self['liste'].getIndex(), self["liste"].list.pop(currindex)) if self.listtype in 'blue': - self.change['fovo'] = True + _changed['fovo'] = True elif self.listtype in 'yellow': - self.change['default'] = True + _changed['default'] = True return except Exception: self["actionsmove"].setEnabled(False) - self.change['fovo'] = False - self.change['default'] = False + _changed['fovo'] = False + _changed['default'] = False def key_red(self): logger.info("...") @@ -275,13 +274,13 @@ def menuCallback(self, answer): elif answer == "addfavo": self.masterliste['favourites'].append([curr[0], curr[1], curr[2], curr[3]]) _channelcache['favo'] = {curr[1]: len(self.masterliste['favourites']) + 1} - self.change['fovo'] = True + _changed['fovo'] = True self['liste'].modifyEntryVal(self['liste'].index, is_in_fovo(curr[1]), 4) elif answer == "delfavo": self.masterliste['favourites'].remove(curr) if curr[1] in _channelcache['favo']: del _channelcache['favo'][curr[1]] - self.change['fovo'] = True + _changed['fovo'] = True self.key_blue() elif answer == "delfavoall": text = _('all') + ' ' + _("Favourites") + ' ' + _('Delete') @@ -297,7 +296,7 @@ def SaveCallback(ress=None): tmpcurr[2] = cvmode.ename tmpcurr[3] = cvmode.eservice self['liste'].modifyEntry(self['liste'].index, tmpcurr) - self.change['default'] = True + _changed['default'] = True self.session.openWithCallback(SaveCallback, TvSpielfilmservice, curr[5]) elif answer == "zaptest": @@ -332,7 +331,7 @@ def del_curr(self, res=False): if pathExists(filename): os_remove(filename) _channelcache['bouq'].clear() - self.change['config'] = True + _changed['config'] = True self.key_green() def del_all_favo(self, res=False): @@ -343,8 +342,8 @@ def del_all_favo(self, res=False): os_remove(channels_file_name('favourites')) del self.masterliste['favourites'][:] _channelcache['favo'].clear() - self.change['fovo'] = True - self.change['config'] = True + _changed['fovo'] = True + _changed['config'] = True self.key_blue() def key_ok(self): @@ -533,7 +532,7 @@ def replaceservice(service): else: result.sort(key=lambda x: x[5]) write_channels(filename, result) - self.change['config'] = True + _changed['config'] = True _channelcache['bouq'].clear() self["liste"].style = "channel_bouquet" @@ -550,16 +549,16 @@ def cleanname(self, msg): def close_(self): logger.info("...") - if self.change['default'] and self.masterliste['defaultchannels']: + if _changed['default'] and self.masterliste['defaultchannels']: write_default_channels(configdefaultchannelsuser, self.masterliste['defaultchannels']) - if self.change['fovo']: - self.change['config'] = True + if _changed['fovo']: + _changed['config'] = True _channelcache['favo'].clear() write_channels(channels_file_name('favourites'), self.masterliste['favourites'], 'favourites') if self.masterliste['notfound']: write_error_log(self.masterliste['notfound']) self.masterliste.clear() - self.close(self.change['config']) + self.close(_changed['config']) def createSummary(self): logger.info("...") diff --git a/src/TvSpielfilmmain.py b/src/TvSpielfilmmain.py index 180929f..dc6123f 100755 --- a/src/TvSpielfilmmain.py +++ b/src/TvSpielfilmmain.py @@ -12,30 +12,27 @@ from Components.UsageConfig import preferredTimerPath from Downloader import headers_gzip, MygetPage, http_failed, MyDeferredSemaphore, _downloads as _state_ from tools import listmainindex as mindex, tvspielfilm_parse -from tvconfig import read_tvconfig, write_tvconfig, make_default_string, read_ServiceReference, make_order_string -from _tvdict import _tv_config, _channelcache, _channelreference, _pixmap_cache +from tvconfig import read_tvconfig, write_tvconfig, make_order_string +from _tvdict import _changed, _tv_config, _channelcache, _channelreference, _pixmap_cache from enigma import eEPGCache from enigma import eServiceReference from ServiceReference import ServiceReference from RecordTimer import RecordTimerEntry, parseEvent -from .tvspielfilmsetup import TvSpielfilmstartSetup -from .tvspielfilmsetup import TvSpielfilmmainSetup -from .tvspielfilmsetup import TvSpielfilmsearchSetup from .MYSimpleSummary import MYSimpleSummary from .EasyMenu import EasyMenu from .__init__ import _ from .MYList import MYList from .TvSpielfilmView import TvSpielfilmView from .ZapUtils import Zap_Service -from .TvSpielfilmchannel import TvSpielfilmchannel from .Debug import logger -class TvSpielfilmmain(Screen): +class TvSpielfilmmain(Screen, EasyMenu): def __init__(self, session): logger.info("...") self.skinName = "TvSpielfilmmain" Screen.__init__(self, session) + EasyMenu.__init__(self, self) self["actions"] = ActionMap( ["TVS_Actions", 'NumberActions'], { @@ -50,12 +47,7 @@ def __init__(self, session): "menu": self.showMenu, "info": self.show_info_Menu, "0": self.key_easymenu, - "1": self.key_main, - "2": self.key_tipps, - "3": self.key_programm, - "4": self.key_programmsky, - "5": self.key_programmfavo, - "6": self.key_search + "1": self.key_search } ) self["key_red"] = StaticText("Jetzt im TV") @@ -63,12 +55,11 @@ def __init__(self, session): self["key_yellow"] = StaticText("22:00 im TV") self["key_blue"] = StaticText("") - self["liste"] = MYList([]) + self["liste"] = MYList() self["searchdate"] = Label() self["message"] = Label() self["message"].hide() self.download = MyDeferredSemaphore(tokens=10) - self.change = {'fovo': False, 'default': False, 'config': False} self.mytimecount = 1 mytime = int(nowtime()) self["searchdate"].text = strftime("< %A, %d. %b %y >", localtime(mytime)) @@ -120,7 +111,7 @@ def key_green(self): logger.info("...") self.start_key(('', 'prime')) - def key_yellow(self): + def key_yellow(self, _epgsearch=None): logger.info("...") self.start_key(('', '22')) @@ -272,11 +263,6 @@ def showMenu(self): options.append(('Spielfilme im TV', 'spielfilme')) options.append(('Serien im TV', 'serien')) options.append(('Kinderprogramm', 'kinder')) - options.append(('--', '--')) - options.append((_("Setup"), 'key_menu')) - options.append((_("Setup") + ' ' + _('Favourites') + '/' + _('Bouquets'), 'key_channel')) - options.append((_("Setup") + ' ' + _('Search'), 'key_searchSetup')) - options.append(('Tv Spielfilm Start ' + _("Setup"), 'key_StartSetup')) self.session.openWithCallback( self.start_key, @@ -396,26 +382,6 @@ def finishedAdd(self, answer): # print "Timeredit aborted" pass - def key_main(self): - logger.info("...") - self.close("main") - - def key_tipps(self): - logger.info("...") - self.close("tipps") - - def key_programm(self): - logger.info("...") - self.close("programm") - - def key_programmsky(self): - logger.info("...") - self.close("programmsky") - - def key_programmfavo(self): - logger.info("...") - self.close("programmfavo") - def key_search(self): logger.info("...") curr = self["liste"].getCurrent() @@ -423,52 +389,8 @@ def key_search(self): self.close("search", curr[mindex['tvsearch']].decode('utf-8').encode('utf-8')) def key_easymenu(self): - def DlgCallback(nex_screen=None): - logger.info("...") - if nex_screen: - if nex_screen[1] == 'main': - self.key_main() - elif nex_screen[1] == 'tipps': - self.key_tipps() - elif nex_screen[1] == 'programm': - self.key_programm() - elif nex_screen[1] == 'programmsky': - self.key_programmsky() - elif nex_screen[1] == 'programmfavo': - self.key_programmfavo() - elif nex_screen[1] == 'search': - self.key_search() - elif nex_screen[1] == 'startsetup': - self.session.open(TvSpielfilmstartSetup) - elif nex_screen[1] == "mainsetup": - self.key_menu() - elif nex_screen[1] == "tvchannel": - self.key_channel() - logger.info("...") - self.session.openWithCallback(DlgCallback, EasyMenu) - - def key_menu(self): - logger.info("...") - self.session.openWithCallback(self.key_menu_back, TvSpielfilmmainSetup) - - def key_channel(self): - logger.info("...") - self.session.openWithCallback(self.key_channel_back, TvSpielfilmchannel) - - def key_searchSetup(self): - logger.info("...") - self.session.open(TvSpielfilmsearchSetup) - - def key_StartSetup(self): - logger.info("...") - self.session.open(TvSpielfilmstartSetup) - - def key_channel_back(self, changed=False): - logger.info("...") - if changed: - self.change['config'] = True - make_default_string() + self.openEasyMenu(self.session) def start_key(self, answer): logger.info("...") @@ -525,32 +447,11 @@ def start_key(self, answer): _tv_config['channel']['uservaluechannel']['disname'] = curr[mindex['channel']] _tv_config['channel']['default'] = _tv_config['channel']['uservaluechannel']['name'] self.download_page() - elif answer == "key_menu": - self.key_menu() - elif answer == "key_channel": - self.key_channel() - elif answer == "key_searchSetup": - self.key_searchSetup() - elif answer == "key_StartSetup": - self.key_StartSetup() - - def key_menu_back(self, changed=False): - logger.info("...") - if changed: - self.change['config'] = True - self["liste"].clearList() - if not _channelreference: - read_ServiceReference() - make_default_string() - if _tv_config.get('time').get('default'): - text = _tv_config.get('time').get(_tv_config.get('time').get('default')).get('disname', '') - self["key_blue"].setText(text) - self.update_Title() def __onClose__(self): logger.info("...") _state_['state'] = False - if self.change['config']: + if _changed['config']: write_tvconfig() if _pixmap_cache: _pixmap_cache.clear() diff --git a/src/TvSpielfilmsearch.py b/src/TvSpielfilmsearch.py index 21a2e7a..03d8aeb 100755 --- a/src/TvSpielfilmsearch.py +++ b/src/TvSpielfilmsearch.py @@ -37,8 +37,8 @@ def __init__(self, session, searchstr=""): "ok": self.key_ok, "cancel": self.close, "blue": self.key_blue, - "yellow": self.key_yellow2, - "green": self.key_green, + "yellow": self.key_yellow, + # "green": self.key_green, "red": self.key_red, "info": self.show_info_Menu, "menu": self.showMenu @@ -182,7 +182,7 @@ def key_blue(self): logger.info("...") self.session.openWithCallback(self.search_back, NTIVirtualKeyBoard, title=_("Enter text to search for"), text=self.search_val) - def key_yellow2(self, epgsearch=None): + def key_yellow(self, epgsearch=None): logger.info("...") options = [] self.savehistory = True @@ -208,9 +208,6 @@ def key_yellow2(self, epgsearch=None): type=MessageBox.TYPE_INFO ) - def key_green(self): - logger.info("...") - def key_yellow_Callback(self, answer): logger.info("...") if answer and answer[0]: diff --git a/src/Version.py b/src/Version.py index 7b44d3d..579f897 100644 --- a/src/Version.py +++ b/src/Version.py @@ -21,6 +21,6 @@ PLUGIN = "TVMagazineCockpit" ID = "TVC" -VERSION = "0.4.1" +VERSION = "0.5.0" COPYRIGHT = "2018-2024 by dream-alpha" LICENSE = "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version." diff --git a/src/_tvdict.py b/src/_tvdict.py index e75cd1f..5fd1c1b 100644 --- a/src/_tvdict.py +++ b/src/_tvdict.py @@ -1,3 +1,4 @@ +_changed = {'fovo': False, 'default': False, 'config': False} _channeldict = dict() _channelreference = dict() @@ -11,3 +12,114 @@ _pixmap_cache = dict() _tvresulu = dict() _tvmastres = dict() + +listtippsindex = {} +listtippsindex['channel'] = 0 +listtippsindex['time'] = 1 +listtippsindex['title'] = 2 +listtippsindex['titled'] = 3 +listtippsindex['neu'] = 4 +listtippsindex['tipp'] = 5 +listtippsindex['rating'] = 6 +listtippsindex['channelurl'] = 7 +listtippsindex['sendungpng'] = 8 +listtippsindex['id'] = 9 +listtippsindex['sendungurl'] = 10 +listtippsindex['channelpix'] = 11 +listtippsindex['sendungpngurl'] = 12 +listtippsindex['dict'] = 13 +listtippsindex['end'] = 14 + +listtippsempty = [''] * listtippsindex['end'] +listtippsempty[listtippsindex['sendungpng']] = None +listtippsempty[listtippsindex['channelpix']] = None +listtippsempty[listtippsindex['dict']] = {} + +listprogindex = {} +listprogindex['channel'] = 0 +listprogindex['channelpix'] = 1 +listprogindex['programmpixurl'] = 2 +listprogindex['time'] = 3 +listprogindex['title'] = 4 +listprogindex['title2'] = 5 +listprogindex['channelurl'] = 6 +listprogindex['index'] = 7 +listprogindex['id'] = 8 +listprogindex['reslist'] = 10 +listprogindex['listend'] = 11 + +listprog = [''] * listprogindex['listend'] +listprog[listprogindex['channelpix']] = None +listprog[listprogindex['index']] = 0 +listprog[listprogindex['reslist']] = [] + +listprogresindex = {} +listprogresindex['time'] = 0 +listprogresindex['title'] = 1 +listprogresindex['subtitle'] = 2 +listprogresindex['daumen'] = 3 +listprogresindex['tipp'] = 4 +listprogresindex['neu'] = 5 +listprogresindex['channelurl'] = 6 +listprogresindex['acttheme'] = 7 + +listprogresindex['genre'] = 8 +listprogresindex['category'] = 9 +listprogresindex['trailer'] = 10 +listprogresindex['id'] = 11 +listprogresindex['rating'] = 12 +listprogresindex['index'] = 13 +listprogresindex['listend'] = 14 + +listprogres = [''] * listprogresindex['listend'] +listprogres[listprogresindex['daumen']] = None +listprogres[listprogresindex['trailer']] = None +listprogres[listprogresindex['index']] = 0 + +listmainindex = {} +listmainindex['channel'] = 0 +listmainindex['time'] = 1 +listmainindex['date'] = 2 +listmainindex['title'] = 3 +listmainindex['genre'] = 4 +listmainindex['category'] = 5 +listmainindex['rating'] = 6 +listmainindex['daumen'] = 7 +listmainindex['datastart'] = 8 +listmainindex['dataend'] = 9 +listmainindex['senderurl'] = 10 +listmainindex['channelpix'] = 11 +listmainindex['id'] = 12 +listmainindex['urlsendung'] = 13 +listmainindex['progress'] = 14 +listmainindex['progresspix'] = 15 +listmainindex['progresspro'] = 16 +listmainindex['remaining'] = 17 +listmainindex['duration'] = 18 +listmainindex['neu'] = 19 +listmainindex['tipp'] = 20 +listmainindex['description'] = 21 +listmainindex['trailer'] = 22 +listmainindex['preview'] = 23 +listmainindex['tvsearch'] = 24 +listmainindex['index'] = 25 +listmainindex['listend'] = 26 + +mastxval_list = [''] * listmainindex['listend'] +mastxval_list[listmainindex['daumen']] = None +mastxval_list[listmainindex['channelpix']] = None +mastxval_list[listmainindex['progress']] = -1 +mastxval_list[listmainindex['progresspix']] = None +mastxval_list[listmainindex['trailer']] = None +mastxval_list[listmainindex['preview']] = None +mastxval_list[listmainindex['tipp']] = '' +mastxval_list[listmainindex['index']] = 0 + +category = {} +category['SP'] = 'Spielfilm' +category['SE'] = 'Serie' +category['RE'] = 'Report' +category['U'] = 'Unterhaltung' +category['KIN'] = 'Kinder' +category['SPO'] = 'Sport' +category['AND'] = 'Nachrichten' diff --git a/src/tools.py b/src/tools.py index f7f8361..4b2e851 100644 --- a/src/tools.py +++ b/src/tools.py @@ -2,50 +2,11 @@ from time import strftime, localtime, time as nowtime from Tools.LoadPixmap import LoadPixmap, pixmap_cache as org_pixmap_cache from Tools.Directories import pathExists -from ._tvdict import _tv_config, _channelreference, _pixmap_cache, _tv_config_config +from ._tvdict import _tv_config, _channelreference, _pixmap_cache, _tv_config_config, listmainindex, mastxval_list, category from .ConfigInit import plugindir from .__init__ import _ -listmainindex = {} -listmainindex['channel'] = 0 -listmainindex['time'] = 1 -listmainindex['date'] = 2 -listmainindex['title'] = 3 -listmainindex['genre'] = 4 -listmainindex['category'] = 5 -listmainindex['rating'] = 6 -listmainindex['daumen'] = 7 -listmainindex['datastart'] = 8 -listmainindex['dataend'] = 9 -listmainindex['senderurl'] = 10 -listmainindex['channelpix'] = 11 -listmainindex['id'] = 12 -listmainindex['urlsendung'] = 13 -listmainindex['progress'] = 14 -listmainindex['progresspix'] = 15 -listmainindex['progresspro'] = 16 -listmainindex['remaining'] = 17 -listmainindex['duration'] = 18 -listmainindex['neu'] = 19 -listmainindex['tipp'] = 20 -listmainindex['description'] = 21 -listmainindex['trailer'] = 22 -listmainindex['preview'] = 23 -listmainindex['tvsearch'] = 24 -listmainindex['index'] = 25 -listmainindex['listend'] = 26 - -mastxval_list = [''] * listmainindex['listend'] -mastxval_list[listmainindex['daumen']] = None -mastxval_list[listmainindex['channelpix']] = None -mastxval_list[listmainindex['progress']] = -1 -mastxval_list[listmainindex['progresspix']] = None -mastxval_list[listmainindex['trailer']] = None -mastxval_list[listmainindex['preview']] = None -mastxval_list[listmainindex['tipp']] = '' -mastxval_list[listmainindex['index']] = 0 - next_page_liste = mastxval_list[:] next_page_liste[listmainindex['channel']] = '>>>' next_page_liste[listmainindex['title']] = _('Next page') + '\t' + _("Select") @@ -68,15 +29,6 @@ data_point['title2'] = 11 data_point['listend'] = 11 -category = {} -category['SP'] = 'Spielfilm' -category['SE'] = 'Serie' -category['RE'] = 'Report' -category['U'] = 'Unterhaltung' -category['KIN'] = 'Kinder' -category['SPO'] = 'Sport' -category['AND'] = 'Nachrichten' - def Load_My_Pixmap(path): if path == '': diff --git a/src/tvspielfilmsetup.py b/src/tvspielfilmsetup.py index 40d4ad1..939404a 100644 --- a/src/tvspielfilmsetup.py +++ b/src/tvspielfilmsetup.py @@ -12,7 +12,7 @@ from ServiceReference import ServiceReference from .tvconfig import _premode, write_tvconfig_search, read_tvconfig_search, read_tvconfig, \ read_ServiceReference, write_tvconfig -from ._tvdict import _tv_config, _channelcache, _channelreference, _tv_config_search, _tv_config_config, _pixmap_cache +from ._tvdict import _changed, _tv_config, _channelcache, _channelreference, _tv_config_search, _tv_config_config, _pixmap_cache from .MYSimpleSummary import MYSimpleSummary from .MYSimpleChannelSelection import MYSimpleChannelSelection from .__init__ import _ @@ -95,7 +95,7 @@ def firststart(self): def _createSetup(self): logger.info("...") entries = [] - entries.append(getConfigListEntry(_('Tv Spielfilm') + ' ' + _('Start') + ' ' + _('Screen'), config.plugins.tvspielfilm.startscreen)) + entries.append(getConfigListEntry(_('Tv Spielfilm') + ' ' + _('Start') + ' ' + _('Screen'), config.plugins.tvmagazinecockpit.startscreen)) self["config"].list = entries @@ -131,8 +131,7 @@ def _createSetup(self): logger.info("...") if 'channel' not in _tv_config: read_tvconfig() - self.change = {'channel': _tv_config['channel']['default']} - self.change['picondir'] = _tv_config_config.get('picondir', '') + _changed['picondir'] = _tv_config_config.get('picondir', '') self.settings.channel = NoSave(self.make_ConfigSelection('channel', 'alle')) self.settings.order = NoSave(self.make_ConfigSelection('order', 'Zeit')) @@ -145,7 +144,7 @@ def _createSetup(self): choices.append((', '.join((_premode[1], _premode[2], _premode[0])), 'HD')) choices.append((', '.join((_premode[2], _premode[1], _premode[0])), 'UHD')) self.settings.premode = NoSave(ConfigSelection(default=default, choices=choices)) - self.change['premode'] = default + _changed['premode'] = default entries = [] entries.append(getConfigListEntry(_('Channel Selection'), self.settings.channel)) @@ -233,7 +232,7 @@ def keySave(self): _tv_config['category']['Kinder']['value'] = self.settings.Kinder.value _tv_config['category']['Sport']['value'] = self.settings.Sport.value - if self.change['channel'] != self.settings.channel.value: + if _changed['channel'] != self.settings.channel.value: _channelcache['favo'].clear() _channelcache['bouq'].clear() _channelreference.clear() @@ -276,9 +275,9 @@ def _createSetup(self): entries.append(getConfigListEntry(' ')) entries.append(getConfigListEntry(_('Plugins') + ' ' + _('show'))) - entries.append(getConfigListEntry(_('Button') + ' ' + _('EPG') + ' ' + _('blue'), config.plugins.tvspielfilm.showepgblue)) - entries.append(getConfigListEntry(_('Button') + ' ' + _('Channel') + ' ' + _('red'), config.plugins.tvspielfilm.showchannelred)) - entries.append(getConfigListEntry(_('Button') + ' ' + _('Eventview') + ' ' + _('blue'), config.plugins.tvspielfilm.showeventview)) + entries.append(getConfigListEntry(_('Button') + ' ' + _('EPG') + ' ' + _('blue'), config.plugins.tvmagazinecockpit.showepgblue)) + entries.append(getConfigListEntry(_('Button') + ' ' + _('Channel') + ' ' + _('red'), config.plugins.tvmagazinecockpit.showchannelred)) + entries.append(getConfigListEntry(_('Button') + ' ' + _('Eventview') + ' ' + _('blue'), config.plugins.tvmagazinecockpit.showeventview)) self["config"].list = entries diff --git a/src/tvspielfilmtipps.py b/src/tvspielfilmtipps.py index 573e840..ffd97bb 100755 --- a/src/tvspielfilmtipps.py +++ b/src/tvspielfilmtipps.py @@ -8,7 +8,7 @@ from enigma import eSlider from Downloader import _headers_jpeg, headers_gzip, MygetPage, MydownloadPage, http_failed from tools import Piconchannelname, mastxval_list, listmainindex as mindex -from _tvdict import _channelreference, _pixmap_cache +from _tvdict import _channelreference, _pixmap_cache, listtippsindex, listtippsempty from tvconfig import read_ServiceReference from Tools.LoadPixmap import LoadPixmap from Components.ActionMap import ActionMap @@ -18,11 +18,9 @@ from Components.Sources.StaticText import StaticText from .EasyMenu import EasyMenu from .TvSpielfilmView import TvSpielfilmView -from .TvSpielfilmchannel import TvSpielfilmchannel from .MultiList import MultiList from .MultiListSummary import MultiListSummary from .MYSimpleSummary import MYSimpleSummary -from .tvspielfilmsetup import TvSpielfilmstartSetup, TvSpielfilmmainSetup from .__init__ import _ from .Debug import logger from .XMLTipps import XMLTipps @@ -44,11 +42,12 @@ def postWidgetCreate(self, instance): instance.setBorderWidth(0) -class TvSpielfilmTipps(Screen): +class TvSpielfilmTipps(Screen, EasyMenu): def __init__(self, session): logger.info("...") Screen.__init__(self, session) # self.skinName = "TvSpielfilmTipps" + EasyMenu.__init__(self, self) self["actions"] = ActionMap( ["TVS_Actions", "NumberActions"], { @@ -319,30 +318,8 @@ def key_programmfavo(self): self.close("programmfavo") def key_easymenu(self): - def DlgCallback(nex_screen=None): - logger.info("...") - if nex_screen: - if nex_screen[1] == 'main': - self.key_red() - elif nex_screen[1] == 'tipps': - self.key_tipps() - elif nex_screen[1] == 'programm': - self.key_green() - elif nex_screen[1] == 'programmsky': - self.key_programmsky() - elif nex_screen[1] == 'programmfavo': - self.key_programmfavo() - elif nex_screen[1] == 'search': - self.key_yellow() - elif nex_screen[1] == 'startsetup': - self.session.open(TvSpielfilmstartSetup) - elif nex_screen[1] == "mainsetup": - self.session.open(TvSpielfilmmainSetup) - elif nex_screen[1] == "tvchannel": - self.session.open(TvSpielfilmchannel) - logger.info("...") - self.session.openWithCallback(DlgCallback, EasyMenu) + self.openEasyMenu(self.session) def key_cancel(self): self.close("programm") @@ -354,28 +331,6 @@ def __onClose__(self): _pixmap_cache.clear() -listtippsindex = {} -listtippsindex['channel'] = 0 -listtippsindex['time'] = 1 -listtippsindex['title'] = 2 -listtippsindex['titled'] = 3 -listtippsindex['neu'] = 4 -listtippsindex['tipp'] = 5 -listtippsindex['rating'] = 6 -listtippsindex['channelurl'] = 7 -listtippsindex['sendungpng'] = 8 -listtippsindex['id'] = 9 -listtippsindex['sendungurl'] = 10 -listtippsindex['channelpix'] = 11 -listtippsindex['sendungpngurl'] = 12 -listtippsindex['dict'] = 13 -listtippsindex['end'] = 14 - -listtippsempty = [''] * listtippsindex['end'] -listtippsempty[listtippsindex['sendungpng']] = None -listtippsempty[listtippsindex['channelpix']] = None -listtippsempty[listtippsindex['dict']] = {} - listvalues = ['today'] diff --git a/src/tvspielfilmtvprogramm.py b/src/tvspielfilmtvprogramm.py index c1e71c9..f0e6367 100755 --- a/src/tvspielfilmtvprogramm.py +++ b/src/tvspielfilmtvprogramm.py @@ -17,13 +17,10 @@ from .Downloader import _headers_jpeg, headers_gzip, MygetPage, MydownloadPage, http_failed from .tools import Load_My_Pixmap, Piconchannelname, mastxval_list, listmainindex as mindex from .tvconfig import read_ServiceReference -from ._tvdict import _channelreference, _pixmap_cache, _tvresulu, _tvmastres +from ._tvdict import _channelreference, _pixmap_cache, _tvresulu, _tvmastres, listprogindex, listprogres, listprogresindex from .ConfigInit import plugindir from .MultiListSummary import MultiListSummary from .MYSimpleSummary import MYSimpleSummary -from .TvSpielfilmchannel import TvSpielfilmchannel -from .tvspielfilmsetup import TvSpielfilmmainSetup -from .tvspielfilmsetup import TvSpielfilmstartSetup from .TvSpielfilmView import TvSpielfilmView from .EasyMenu import EasyMenu from .MultiList import MultiList @@ -83,11 +80,12 @@ def createSummary(self): return MYSimpleSummary -class TvSpielfilmTvProgramm(Screen): +class TvSpielfilmTvProgramm(Screen, EasyMenu): def __init__(self, session, programmtyp='tv-sender'): logger.info("...") self.skinName = "TvSpielfilmTvProgramm" Screen.__init__(self, session) + EasyMenu.__init__(self, self) self["actions"] = ActionMap( ["TVS_Actions", "NumberActions"], @@ -377,30 +375,8 @@ def key_programmfavo(self): self.close("programmfavo") def key_easymenu(self): - def DlgCallback(nex_screen=None): - logger.info("...") - if nex_screen: - if nex_screen[1] == 'main': - self.key_red() - elif nex_screen[1] == 'tipps': - self.key_tipps() - elif nex_screen[1] == 'programm': - self.key_green() - elif nex_screen[1] == 'programmsky': - self.key_programmsky() - elif nex_screen[1] == 'programmfavo': - self.key_programmfavo() - elif nex_screen[1] == 'search': - self.key_yellow() - elif nex_screen[1] == 'startsetup': - self.session.open(TvSpielfilmstartSetup) - elif nex_screen[1] == "mainsetup": - self.session.open(TvSpielfilmmainSetup) - elif nex_screen[1] == "tvchannel": - self.session.open(TvSpielfilmchannel) - - logger.info("...") - self.session.openWithCallback(DlgCallback, EasyMenu) + logger.info("...") + self.openEasyMenu(self.session) def backval(self, val=None): logger.info("...") @@ -516,38 +492,6 @@ def __init__(self, session): self.skinName = "TvSpielfilmTvProgramm" -listprogindex = {} -listprogindex['channel'] = 0 -listprogindex['channelpix'] = 1 -listprogindex['programmpixurl'] = 2 -listprogindex['time'] = 3 -listprogindex['title'] = 4 -listprogindex['title2'] = 5 -listprogindex['channelurl'] = 6 -listprogindex['index'] = 7 -listprogindex['id'] = 8 -listprogindex['reslist'] = 10 -listprogindex['listend'] = 11 - -listprog = [''] * listprogindex['listend'] -listprog[listprogindex['channelpix']] = None -listprog[listprogindex['index']] = 0 -listprog[listprogindex['reslist']] = [] - -listprogresindex = {} -listprogresindex['time'] = 0 -listprogresindex['title'] = 1 -listprogresindex['subtitle'] = 2 -listprogresindex['daumen'] = 3 -listprogresindex['tipp'] = 4 -listprogresindex['neu'] = 5 -listprogresindex['channelurl'] = 6 -listprogresindex['listend'] = 8 - -listprogres = [''] * listprogresindex['listend'] -listprogres[listprogresindex['daumen']] = None - - def tvsenderparser(masresult): def clean(res): logger.info("...") diff --git a/src/tvspielfilmtvprogrammfavo.py b/src/tvspielfilmtvprogrammfavo.py index 300c5f2..abb40b2 100755 --- a/src/tvspielfilmtvprogrammfavo.py +++ b/src/tvspielfilmtvprogrammfavo.py @@ -16,14 +16,11 @@ from .Downloader import _headers_jpeg, headers_gzip, MygetPage, MydownloadPage, http_failed, MyDeferredSemaphore, _downloads as _state_ from .tools import Load_My_Pixmap, Piconchannelname, mastxval_list, listmainindex as mindex from .tvconfig import read_ServiceReference, read_channel_favo_prog -from ._tvdict import _channelreference, _pixmap_cache +from ._tvdict import _channelreference, _pixmap_cache, listprogindex, listprogres, listprogresindex from .ConfigInit import plugindir from .MultiListSummary import MultiListSummary from .MYSimpleSummary import MYSimpleSummary -from .TvSpielfilmchannel import TvSpielfilmchannel from .TvSpielfilmView import TvSpielfilmView -from .tvspielfilmsetup import TvSpielfilmstartSetup -from .tvspielfilmsetup import TvSpielfilmmainSetup from .EasyMenu import EasyMenu from .__init__ import _ from .MultiList import MultiList @@ -88,12 +85,12 @@ def createSummary(self): return MYSimpleSummary -class TvSpielfilmTvProgrammFavo(Screen): +class TvSpielfilmTvProgrammFavo(Screen, EasyMenu): def __init__(self, session): logger.info("...") - # self.skinName = "TvSpielfilmTvProgramm" Screen.__init__(self, session) self.skinName = "TvSpielfilmTvProgramm" + EasyMenu.__init__(self, self) self["actions"] = ActionMap( ["TVS_Actions", "NumberActions"], { @@ -506,30 +503,8 @@ def key_programmfavo(self): self.close("programmfavo") def key_easymenu(self): - def DlgCallback(nex_screen=None): - logger.info("...") - if nex_screen: - if nex_screen[1] == 'main': - self.key_red() - elif nex_screen[1] == 'tipps': - self.key_tipps() - elif nex_screen[1] == 'programm': - self.key_green() - elif nex_screen[1] == 'programmsky': - self.key_programmsky() - elif nex_screen[1] == 'programmfavo': - self.key_programmfavo() - elif nex_screen[1] == 'search': - self.key_yellow() - elif nex_screen[1] == 'startsetup': - self.session.open(TvSpielfilmstartSetup) - elif nex_screen[1] == "mainsetup": - self.session.open(TvSpielfilmmainSetup) - elif nex_screen[1] == "tvchannel": - self.session.openWithCallback(self.key_channel_back, TvSpielfilmchannel) - - logger.info("...") - self.session.openWithCallback(DlgCallback, EasyMenu) + logger.info("...") + self.openEasyMenu(self.session) def backval(self, val=None): logger.info("...") @@ -654,47 +629,6 @@ def __onClose__(self): _downloads.clear() -listprogindex = {} -listprogindex['channel'] = 0 -listprogindex['channelpix'] = 1 -listprogindex['programmpixurl'] = 2 -listprogindex['time'] = 3 -listprogindex['title'] = 4 -listprogindex['title2'] = 5 -listprogindex['channelurl'] = 6 -listprogindex['index'] = 7 -listprogindex['id'] = 8 -listprogindex['reslist'] = 10 -listprogindex['listend'] = 11 - -listprog = [''] * listprogindex['listend'] -listprog[listprogindex['channelpix']] = None -listprog[listprogindex['index']] = 0 -listprog[listprogindex['reslist']] = [] - -listprogresindex = {} -listprogresindex['time'] = 0 -listprogresindex['title'] = 1 -listprogresindex['subtitle'] = 2 -listprogresindex['daumen'] = 3 -listprogresindex['tipp'] = 4 -listprogresindex['neu'] = 5 -listprogresindex['channelurl'] = 6 -listprogresindex['acttheme'] = 7 - -listprogresindex['genre'] = 8 -listprogresindex['category'] = 9 -listprogresindex['trailer'] = 10 -listprogresindex['id'] = 11 -listprogresindex['rating'] = 12 -listprogresindex['index'] = 13 -listprogresindex['listend'] = 14 - -listprogres = [''] * listprogresindex['listend'] -listprogres[listprogresindex['daumen']] = None -listprogres[listprogresindex['trailer']] = None -listprogres[listprogresindex['index']] = 0 - _masterdict = {} _downloads = {} _downloads['pages'] = []