def setRefreshTimer(self, tocall):
# Add refresh Timer
now = localtime()
begin = mktime(
(now.tm_year, now.tm_mon, now.tm_mday,
config.plugins.epgrefresh.begin.value[0],
config.plugins.epgrefresh.begin.value[1],
0, now.tm_wday, now.tm_yday, now.tm_isdst)
)
# If the last scan was finished before our timespan begins/began and
# timespan began in the past fire the timer once (timer wouldn't do so
# by itself)
if config.plugins.epgrefresh.lastscan.value < begin and begin < time():
tocall()
refreshTimer = EPGRefreshTimerEntry(begin, tocall, nocheck = True)
i = 0
while i < 7:
refreshTimer.setRepeated(i)
i += 1
# We can be sure that whenever this function is called the timer list
# was wiped, so just add a new timer
self.addTimerEntry(refreshTimer)
评论列表
文章目录