本文整理汇总了Python中RecordTimer.RecordTimerEntry.repeated方法的典型用法代码示例。如果您正苦于以下问题:Python RecordTimerEntry.repeated方法的具体用法?Python RecordTimerEntry.repeated怎么用?Python RecordTimerEntry.repeated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordTimer.RecordTimerEntry
的用法示例。
在下文中一共展示了RecordTimerEntry.repeated方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: KeyOk
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def KeyOk(self):
sel = self["list"].getCurrent()[0]
if (sel == "searchEPGe2"):
if self.epgserchplugin:
self.epgserchplugin(session=self.session, servicelist=self)
elif (sel == "searchEPG"):
if config.dbp.usevkeyboard.value:
self.session.openWithCallback(self.beginSearch, VirtualKeyBoard, title = _("Enter event to search:"), text = "")
else:
self.session.openWithCallback(self.beginSearch,InputBox, title = _("Enter event to search:"), windowTitle = _("Search in EPG cache"), text="")
elif (sel == "searchEPGLast"):
self.session.open(NEpgSearchLast)
elif (sel == "downloadEPG"):
if self.checkDevice():
self.ref = self.session.nav.getCurrentlyPlayingServiceReference()
if config.nemepg.downskyit.value:
self.downloadItEPG()
elif config.nemepg.downskyuk.value:
self.downloadUkEPG()
elif (sel == "e2LoaderEpg") or (sel == "e2LoaderEpgI"):
self.downIMode = { 'e2LoaderEpg':False, 'e2LoaderEpgI':True }[sel]
msg = _('Do you want download EPG\nusing e2_loadepg?')
self.epgDBox = self.session.openWithCallback(self.downEPG,MessageBox, msg, MessageBox.TYPE_YESNO)
self.epgDBox.setTitle(_("Download EPG"))
elif (sel == "reloadEPG"):
if self.e2Loader:
searchPaths = ['/tmp/%s','/media/usb/%s','/media/cf/%s','/media/hdd/%s']
for path in searchPaths:
epgFile = (path % 'ext.epg.dat')
if fileExists(epgFile):
system("mv " + epgFile + " " + config.nemepg.path.value + "/epg.dat")
msg = _('Load EPG data in Enigma cache from:\n%s/epg.dat.\nPlease Wait...') % config.nemepg.path.value
self.epgRBox = self.session.open(MessageBox, msg, MessageBox.TYPE_INFO)
self.epgRBox.setTitle(_("Loading EPG"))
self.reloadEPGTimer.start(500, False)
elif (sel == "eraseEPG"):
msg = _('Erasing EPG Chache.\nPlease Wait...')
self.epgCBox = self.session.open(MessageBox, msg, MessageBox.TYPE_INFO)
self.epgCBox.setTitle(_("Erasing EPG cache"))
self.clearEPGTimer.start(500, False)
elif (sel == "backupEPG"):
msg = _('Backup Enigma EPG data on:\n%s.\nPlease Wait...') % config.nemepg.path.value
self.epgBBox = self.session.open(MessageBox, msg, MessageBox.TYPE_INFO)
self.epgBBox.setTitle(_("Backing-up EPG"))
self.saveEPGTimer.start(500, False)
elif (sel == "createTIMER"):
serviceref = ServiceReference(getSid(config.nemepg.skyitch.value))
begin = 1239332400
end = 1239333600
name = "Download EPG Daily"
description = "Please do not remove this entry!"
timer = RecordTimerEntry(serviceref, begin, end, name, description, 66, False, 2, 1)
timer.repeated = 127
self.session.openWithCallback(self.finishedAdd, TimerEntry, timer)
elif (sel == "openTIMER"):
self.session.open(TimerEditList)
elif (sel == "epglog"):
self.session.open(dbpShowPanel, '/usr/log/crossepg.log' ,_('EPG Timer log'))
elif (sel == "configEPG"):
self.session.openWithCallback(self.saveConfig, NSetup, "epg")
示例2: addTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def addTimer(session, serviceref, begin, end, name, description, disabled, justplay, afterevent, dirname, tags, repeated, logentries=None, eit=0):
rt = session.nav.RecordTimer
if not dirname:
dirname = preferredTimerPath()
try:
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
disabled,
justplay,
afterevent,
dirname=dirname,
tags=tags)
if repeated:
timer.repeated = 1
else:
timer.repeated = 0
if logentries:
timer.log_entries = logentries
conflicts = rt.record(timer)
if conflicts:
errors = []
for conflict in conflicts:
errors.append(conflict.name)
return {
"result": False,
"message": "Conflicting Timer(s) detected! %s" % " / ".join(errors)
}
except Exception, e:
print e
return {
"result": False,
"message": "Could not add timer '%s'!" % name
}
示例3: addTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def addTimer(session, serviceref, begin, end, name, description, disabled, justplay, afterevent, dirname, tags, repeated, vpsinfo=None, logentries=None, eit=0, always_zap=-1):
serviceref = unquote(serviceref)
rt = session.nav.RecordTimer
print "mao1", dirname
if not dirname:
dirname = preferredTimerPath()
print "mao2", dirname
try:
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
disabled,
justplay,
afterevent,
dirname=dirname,
tags=tags)
timer.repeated = repeated
if logentries:
timer.log_entries = logentries
conflicts = rt.record(timer)
if conflicts:
errors = []
for conflict in conflicts:
errors.append(conflict.name)
return {
"result": False,
"message": _("Conflicting Timer(s) detected! %s") % " / ".join(errors)
}
#VPS
if vpsinfo is not None:
timer.vpsplugin_enabled = vpsinfo["vpsplugin_enabled"]
timer.vpsplugin_overwrite = vpsinfo["vpsplugin_overwrite"]
timer.vpsplugin_time = vpsinfo["vpsplugin_time"]
if always_zap <> -1:
if hasattr(timer,"always_zap"):
timer.always_zap = always_zap == 1
except Exception, e:
print e
return {
"result": False,
"message": _("Could not add timer '%s'!") % name
}
示例4: getTimers
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def getTimers(self):
self._timer_list = []
self._processed_timers = []
baseurl = self.getBaseUrl()
print "[GBIpboxRemoteTimer] get remote timer list"
try:
httprequest = urllib2.urlopen(baseurl + '/web/timerlist')
xmldoc = minidom.parseString(httprequest.read())
timers = xmldoc.getElementsByTagName('e2timer')
for timer in timers:
serviceref = ServiceReference(getValueFromNode(timer, 'e2servicereference'))
begin = int(getValueFromNode(timer, 'e2timebegin'))
end = int(getValueFromNode(timer, 'e2timeend'))
name = getValueFromNode(timer, 'e2name')
description = getValueFromNode(timer, 'e2description')
eit = int(getValueFromNode(timer, 'e2eit'))
disabled = int(getValueFromNode(timer, 'e2disabled'))
justplay = int(getValueFromNode(timer, 'e2justplay'))
afterevent = int(getValueFromNode(timer, 'e2afterevent'))
repeated = int(getValueFromNode(timer, 'e2repeated'))
location = getValueFromNode(timer, 'e2location')
tags = getValueFromNode(timer, 'e2tags').split(" ")
entry = RecordTimerEntry(serviceref, begin, end, name, description, eit, disabled, justplay, afterevent, dirname = location, tags = tags, descramble = 1, record_ecm = 0, isAutoTimer = 0, always_zap = 0)
entry.repeated = repeated
entry.orig = RecordTimerEntry(serviceref, begin, end, name, description, eit, disabled, justplay, afterevent, dirname = location, tags = tags, descramble = 1, record_ecm = 0, isAutoTimer = 0, always_zap = 0)
entry.orig.repeated = repeated
if entry.shouldSkip() or entry.state == TimerEntry.StateEnded or (entry.state == TimerEntry.StateWaiting and entry.disabled):
insort(self._processed_timers, entry)
else:
insort(self._timer_list, entry)
except Exception, e:
print "[GBIpboxRemoteTimer]", e
示例5: editTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def editTimer(self, param):
print "[WebComponents.Timer] editTimer"
# OK first we need to parse all of your Parameters
# For some of them (like afterEvent or justplay) we can use default values
# for others (the serviceReference or the Begin/End time of the timer
# we have to quit if they are not set/have illegal values
if "sRef" not in param:
return (False, "Missing Parameter: sRef")
service_ref = ServiceReference(param["sRef"])
repeated = int(param.get("repeated") or 0)
if "begin" not in param:
return (False, "Missing Parameter: begin")
begin = int(float(param["begin"]))
if "end" not in param:
return (False, "Missing Parameter: end")
end = int(float(param["end"]))
tm = time()
if tm <= begin:
pass
elif tm > begin and tm < end and repeated == 0:
begin = time()
elif repeated == 0:
return (False, "Illegal Parameter value for Parameter begin : '%s'" % begin)
if "name" not in param:
return (False, "Missing Parameter: name")
name = param["name"]
if "description" not in param:
return (False, "Missing Parameter: description")
description = param["description"].replace("\n", " ")
disabled = False # Default to: Enabled
if "disabled" in param:
if param["disabled"] == "1":
disabled = True
else:
# TODO - maybe we can give the user some useful hint here
pass
justplay = False # Default to: Record
if "justplay" in param:
if param["justplay"] == "1":
justplay = True
afterEvent = 3 # Default to Afterevent: Auto
if "afterevent" in param:
if (param["afterevent"] == "0") or (param["afterevent"] == "1") or (param["afterevent"] == "2"):
afterEvent = int(param["afterevent"])
dirname = config.movielist.last_timer_videodir.value
if "dirname" in param and param["dirname"]:
dirname = param["dirname"]
tags = []
if "tags" in param and param["tags"]:
tags = unescape(param["tags"]).split(" ")
delold = 0
if "deleteOldOnSave" in param:
delold = int(param["deleteOldOnSave"])
# Try to edit an existing Timer
if delold:
if "channelOld" in param and param["channelOld"]:
channelOld = ServiceReference(param["channelOld"])
else:
return (False, "Missing Parameter: channelOld")
# We do need all of the following Parameters, too, for being able of finding the Timer.
# Therefore so we can neither use default values in this part nor can we
# continue if a parameter is missing
if "beginOld" not in param:
return (False, "Missing Parameter: beginOld")
beginOld = int(param["beginOld"])
if "endOld" not in param:
return (False, "Missing Parameter: endOld")
endOld = int(param["endOld"])
# let's try to find the timer
try:
for timer in self.recordtimer.timer_list + self.recordtimer.processed_timers:
if str(timer.service_ref) == str(channelOld):
if int(timer.begin) == beginOld:
if int(timer.end) == endOld:
# we've found the timer we've been searching for
# Let's apply the new values
timer.service_ref = service_ref
timer.begin = int(begin)
timer.end = int(end)
timer.name = name
timer.description = description
timer.disabled = disabled
timer.justplay = justplay
#.........这里部分代码省略.........
示例6: editTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def editTimer(self, param):
print "[WebComponents.Timer] editTimer"
#OK first we need to parse all of your Parameters
#For some of them (like afterEvent or justplay) we can use default values
#for others (the serviceReference or the Begin/End time of the timer
#we have to quit if they are not set/have illegal values
if 'serviceref' in param:
param['sRef'] = str(param['serviceref'])
if 'sRef' not in param:
return ( False, "Missing Parameter: sRef" )
service_ref = ServiceReference(param['sRef'])
repeated = int(param.get('repeated') or 0)
if 'begin' not in param:
return ( False, "Missing Parameter: begin" )
begin = int(float(param['begin']))
if 'end' not in param:
return ( False, "Missing Parameter: end" )
end = int(float(param['end']))
tm = time()
if tm <= begin:
pass
elif tm > begin and tm < end and repeated == 0:
begin = time()
elif repeated == 0:
return ( False, "Illegal Parameter value for Parameter begin : '%s'" % begin )
if 'name' not in param:
return ( False, "Missing Parameter: name" )
name = param['name']
if 'description' not in param:
return ( False, "Missing Parameter: description" )
description = param['description'].replace("\n", " ")
disabled = False #Default to: Enabled
if 'disabled' in param:
if param['disabled'] == "1":
disabled = True
else:
#TODO - maybe we can give the user some useful hint here
pass
justplay = False #Default to: Record
if 'justplay' in param:
if param['justplay'] == "1":
justplay = True
afterEvent = 3 #Default to Afterevent: Auto
if 'afterevent' in param:
if (param['afterevent'] == "0") or (param['afterevent'] == "1") or (param['afterevent'] == "2"):
afterEvent = int(param['afterevent'])
dirname = preferredTimerPath()
if 'dirname' in param and param['dirname']:
dirname = param['dirname']
tags = []
if 'tags' in param and param['tags']:
tags = unescape(param['tags']).split(' ')
delold = 0
if 'deleteOldOnSave' in param:
delold = int(param['deleteOldOnSave'])
#Try to edit an existing Timer
if delold:
if 'channelOld' in param and param['channelOld']:
channelOld = ServiceReference(param['channelOld'])
else:
return ( False, "Missing Parameter: channelOld" )
# We do need all of the following Parameters, too, for being able of finding the Timer.
# Therefore so we can neither use default values in this part nor can we
# continue if a parameter is missing
if 'beginOld' not in param:
return ( False, "Missing Parameter: beginOld" )
beginOld = int(param['beginOld'])
if 'endOld' not in param:
return ( False, "Missing Parameter: endOld" )
endOld = int(param['endOld'])
#let's try to find the timer
try:
for timer in self.__recordtimer.timer_list + self.__recordtimer.processed_timers:
if str(timer.service_ref) == str(channelOld):
if int(timer.begin) == beginOld:
if int(timer.end) == endOld:
#we've found the timer we've been searching for
#Delete the old entry
self.__recordtimer.removeEntry(timer)
old = timer
#.........这里部分代码省略.........
示例7: addTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def addTimer(
session,
serviceref,
begin,
end,
name,
description,
disabled,
justplay,
afterevent,
dirname,
tags,
repeated,
logentries=None,
eit=0,
):
recordHandler = NavigationInstance.instance.RecordTimer
msgTimeout = config.plugins.skyrecorder.msgtimeout.value
if not dirname:
try:
dirname = config.plugins.skyrecorder.anytimefolder.value
except Exception:
dirname = preferredTimerPath()
print "mao1", dirname
try:
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
disabled,
justplay,
afterevent,
dirname=dirname,
tags=tags,
)
timer.repeated = repeated
if logentries:
timer.log_entries = logentries
print "rrgggg"
conflicts = recordHandler.record(timer)
if conflicts:
errors = []
for conflict in conflicts:
errors.append(conflict.name)
print "duuuupppppppeeeeee"
return {"result": False, "message": "Conflicting Timer(s) detected! %s" % " / ".join(errors)}
except Exception, e:
print "adupppeee"
print e
return {"result": False, "message": "Could not add timer '%s'!" % name}
示例8: editTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def editTimer(self, param):
print "[WebComponents.Timer] editTimer"
#OK first we need to parse all of your Parameters
#For some of them (like afterEvent or justplay) we can use default values
#for others (the serviceReference or the Begin/End time of the timer
#we have to quit if they are not set/have illegal values
if 'sRef' not in param:
return ( False, _("Missing Parameter: sRef") )
service_ref = ServiceReference(param['sRef'])
repeated = int(param.get('repeated') or 0)
if 'begin' not in param:
return ( False, _("Missing Parameter: begin") )
begin = int(float(param['begin']))
if 'end' not in param:
return ( False, _("Missing Parameter: end") )
end = int(float(param['end']))
tm = int( time() )
if tm <= begin:
pass
elif tm > begin and tm < end and repeated == 0:
pass
elif repeated == 0:
return ( False, _("Illegal Parameter value for Parameter begin : '%s'") % begin )
if 'applyMargin' in param:
if param['applyMargin'] == "1":
begin -= config.recording.margin_before.value * 60
end += config.recording.margin_after.value * 60
if 'name' not in param:
return ( False, _("Missing Parameter: name") )
name = param['name']
if 'description' not in param:
return ( False, _("Missing Parameter: description") )
description = param['description'].replace("\n", " ")
eit = param.get("eit", None)
if eit is None or eit.strip() == "":
eit = 0
else:
try: eit = int(eit)
except ValueError: return ( False, _("Illegal Parameter value for Parameter eit : '%s'") % eit )
print "[WebComponents.Sources.Timer]: eit=%d" %eit
if eit != 0:
#check if the given event exists, if it doesn't the timer may be already running
epgcache = eEPGCache.getInstance()
event = epgcache.lookupEventId(eServiceReference(param['sRef']), eit)
if event:
eit = event.getEventId()
#TODO add some subservice handling
else:
print "[WebComponents.Sources.Timer] event not found, will be ignored"
disabled = False #Default to: Enabled
if 'disabled' in param:
if param['disabled'] == "1":
disabled = True
else:
#TODO - maybe we can give the user some useful hint here
pass
justplay = False #Default to: Record
if 'justplay' in param:
if param['justplay'] == "1":
justplay = True
if not justplay and not config.misc.recording_allowed.value:
return (False, _("Recording is currently disabled!"))
afterEvent = 3 #Default to Afterevent: Auto
if 'afterevent' in param:
if (param['afterevent'] == "0") or (param['afterevent'] == "1") or (param['afterevent'] == "2"):
afterEvent = int(param['afterevent'])
dirname = preferredTimerPath()
if 'dirname' in param and param['dirname']:
dirname = param['dirname']
tags = []
if 'tags' in param and param['tags']:
tags = unescape(param['tags']).split(' ')
delold = 0
if 'deleteOldOnSave' in param:
delold = int(param['deleteOldOnSave'])
#Try to edit an existing Timer
if delold:
if 'channelOld' in param and param['channelOld']:
channelOld = ServiceReference(param['channelOld'])
else:
return ( False, _("Missing Parameter: channelOld") )
#.........这里部分代码省略.........
示例9: addTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def addTimer(session, serviceref, begin, end, name, description, disabled, justplay, afterevent, dirname, tags, repeated, vpsinfo=None, logentries=None, eit=0, always_zap=-1):
rt = session.nav.RecordTimer
if not dirname:
dirname = preferredTimerPath()
try:
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
disabled,
justplay,
afterevent,
dirname=dirname,
tags=tags)
timer.repeated = repeated
if logentries:
timer.log_entries = logentries
conflicts = rt.record(timer)
if conflicts:
errors = []
conflictinfo = []
for conflict in conflicts:
errors.append(conflict.name)
conflictinfo.append({
"serviceref": str(conflict.service_ref),
"servicename": conflict.service_ref.getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', ''),
"name": conflict.name,
"begin" : conflict.begin,
"end" : conflict.end,
"realbegin":strftime("%d.%m.%Y %H:%M", (localtime(float(conflict.begin)))),
"realend":strftime("%d.%m.%Y %H:%M", (localtime(float(conflict.end))))
})
return {
"result": False,
"message": _("Conflicting Timer(s) detected! %s") % " / ".join(errors),
"conflicts" : conflictinfo
}
#VPS
if vpsinfo is not None:
timer.vpsplugin_enabled = vpsinfo["vpsplugin_enabled"]
timer.vpsplugin_overwrite = vpsinfo["vpsplugin_overwrite"]
timer.vpsplugin_time = vpsinfo["vpsplugin_time"]
if always_zap <> -1:
if hasattr(timer,"always_zap"):
timer.always_zap = always_zap == 1
except Exception, e:
print e
return {
"result": False,
"message": _("Could not add timer '%s'!") % name
}
示例10: addTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import repeated [as 别名]
def addTimer(serviceref, begin, end, name, description, eit, disabled, dirname, vpsSettings, tags, logentries=None):
recordHandler = NavigationInstance.instance.RecordTimer
# config.plugins.serienRec.seriensubdir
# if not dirname:
# try:
# dirname = config.plugins.serienRec.savetopath.value
# except Exception:
# dirname = preferredTimerPath()
try:
try:
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
disabled=disabled,
justplay=config.plugins.serienRec.justplay.value,
zapbeforerecord=config.plugins.serienRec.zapbeforerecord.value,
justremind=config.plugins.serienRec.justremind.value,
afterEvent=int(config.plugins.serienRec.afterEvent.value),
dirname=dirname)
except Exception:
sys.exc_clear()
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
disabled,
config.plugins.serienRec.justplay.value | config.plugins.serienRec.justremind.value,
afterEvent=int(config.plugins.serienRec.afterEvent.value),
dirname=dirname,
tags=None)
timer.repeated = 0
# Add tags
timerTags = timer.tags[:]
timerTags.append('SerienRecorder')
if len(tags) != 0:
timerTags.extend(tags)
timer.tags = timerTags
# If eit = 0 the VPS plugin won't work properly for this timer, so we have to disable VPS in this case.
if SerienRecorder.VPSPluginAvailable and eit is not 0:
timer.vpsplugin_enabled = vpsSettings[0]
timer.vpsplugin_overwrite = timer.vpsplugin_enabled and (not vpsSettings[1])
if logentries:
timer.log_entries = logentries
timer.log(0, "[SerienRecorder] Timer angelegt")
conflicts = recordHandler.record(timer)
if conflicts:
errors = []
for conflict in conflicts:
errors.append(conflict.name)
return {
"result": False,
"message": "In Konflikt stehende Timer vorhanden! %s" % " / ".join(errors)
}
except Exception, e:
print "[%s] <%s>" % (__name__, e)
return {
"result": False,
"message": "Timer konnte nicht angelegt werden '%s'!" % e
}