config.plugins.epgrefresh.lastscan.value = int(time())
config.plugins.epgrefresh.lastscan.save()
+ # Eventually force autotimer to parse epg
+ if config.plugins.epgrefresh.parse_autotimer.value:
+ removeInstance = False
+ try:
+ # Import Instance
+ from Plugins.Extensions.AutoTimer.plugin import autotimer
+
+ if autotimer is None:
+ removeInstance = True
+ # Create an instance
+ from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
+ autotimer = AutoTimer()
+
+ # Parse EPG
+ autotimer.parseEPG()
+ except Exception, e:
+ print "[EPGRefresh] Could not start AutoTimer:", e
+ finally:
+ # Remove instance if there wasn't one before
+ if removeInstance:
+ autotimer = None
+
# shutdown if we're supposed to go to deepstandby and not recording
if not self.forcedScan and config.plugins.epgrefresh.afterevent.value \
and not Screens.Standby.inTryQuitMainloop:
getConfigListEntry(_("Delay when not in Standby (in m)"), config.plugins.epgrefresh.delay_standby),
getConfigListEntry(_("Force scan even if reciever is in use"), config.plugins.epgrefresh.force),
getConfigListEntry(_("Inherit Services from AutoTimer if available"), config.plugins.epgrefresh.inherit_autotimer),
+ getConfigListEntry(_("Make AutoTimer parse EPG if available"), config.plugins.epgrefresh.parse_autotimer),
getConfigListEntry(_("Shutdown after refresh"), config.plugins.epgrefresh.afterevent),
]
from . import _
# Config
-from Components.config import config, ConfigEnableDisable, ConfigNumber, \
+from Components.config import config, ConfigYesNo, ConfigNumber, \
ConfigSubsection, ConfigClock
# Calculate default begin/end
)
config.plugins.epgrefresh = ConfigSubsection()
-config.plugins.epgrefresh.enabled = ConfigEnableDisable(default = False)
+config.plugins.epgrefresh.enabled = ConfigYesNo(default = False)
config.plugins.epgrefresh.begin = ConfigClock(default = int(begin))
config.plugins.epgrefresh.end = ConfigClock(default = int(end))
config.plugins.epgrefresh.interval = ConfigNumber(default = 2)
config.plugins.epgrefresh.delay_standby = ConfigNumber(default = 10)
-config.plugins.epgrefresh.inherit_autotimer = ConfigEnableDisable(default = False)
-config.plugins.epgrefresh.afterevent = ConfigEnableDisable(default = False)
-config.plugins.epgrefresh.force = ConfigEnableDisable(default = False)
-config.plugins.epgrefresh.wakeup = ConfigEnableDisable(default = False)
+config.plugins.epgrefresh.inherit_autotimer = ConfigYesNo(default = False)
+config.plugins.epgrefresh.afterevent = ConfigYesNo(default = False)
+config.plugins.epgrefresh.force = ConfigYesNo(default = False)
+config.plugins.epgrefresh.wakeup = ConfigYesNo(default = False)
config.plugins.epgrefresh.lastscan = ConfigNumber(default = 0)
+config.plugins.epgrefresh.parse_autotimer = ConfigYesNo(default = False)
del now, begin, end