1 #######################################################################
3 # Series Plugin for Enigma-2
4 # Coded by betonme (c) 2012 <glaserfrank(at)gmail.com>
5 # Support: http://www.i-have-a-dreambox.com/wbb2/thread.php?threadid=TBD
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 #######################################################################
19 # for localized messages
23 from Components.config import *
25 import NavigationInstance
26 from enigma import eTimer
27 from time import localtime
28 #from ServiceReference import ServiceReference
31 from SeriesPlugin import getInstance, refactorTitle, refactorDescription
32 from SeriesPluginTimer import SeriesPluginTimer
33 from Logger import splog
40 def startIndependent():
42 instance = SeriesPluginIndependent()
45 def stopIndependent():
46 #Rename to closeInstance
48 # TEST Does this really stop the process
54 for timer in NavigationInstance.instance.RecordTimer.timer_list:
57 splog("SeriesPluginIndependent: Skip running timer", timer.name)
61 splog("SeriesPluginIndependent: Skip justplay timer", timer.name)
65 splog("SeriesPluginIndependent: Skip repeating timer", timer.name)
68 if not config.plugins.seriesplugin.independent_retry.value:
69 splog("SeriesPluginIndependent: timer retry is disabled")
70 if hasattr(timer, 'serieslookupdone') and timer.serieslookupdone:
71 splog("SeriesPluginIndependent: Skip timer retry", timer.name)
74 #Maybe later add a series whitelist xml
75 SeriesPluginTimer(timer, timer.name, timer.begin, timer.end)
77 timer.serieslookupdone = True
79 except Exception as e:
80 splog("SeriesPluginIndependent: run exception " + str(e))
83 #######################################################
85 class SeriesPluginIndependent(object):
90 self.etimer = eTimer()
91 self.etimer_conn = self.etimer.timeout.connect(self.run)
92 cycle = int(config.plugins.seriesplugin.independent_cycle.value)
94 self.etimer.start( (cycle * 60 * 1000) )
95 # Start timer as single shot, just for testing
96 #self.etimer.start( 10, True )
99 splog("SeriesPluginIndependent: run", strftime("%a, %d %b %Y %H:%M:%S", localtime()) )