本文整理汇总了Python中RecordTimer.RecordTimerEntry.isAutoTimer方法的典型用法代码示例。如果您正苦于以下问题:Python RecordTimerEntry.isAutoTimer方法的具体用法?Python RecordTimerEntry.isAutoTimer怎么用?Python RecordTimerEntry.isAutoTimer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordTimer.RecordTimerEntry
的用法示例。
在下文中一共展示了RecordTimerEntry.isAutoTimer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import isAutoTimer [as 别名]
#.........这里部分代码省略.........
doLog("Skipping an event because a timer on same service exists")
skipped.append((name, begin, end, serviceref, timer.name, getLog()))
continue
# We want to search for possible doubles
if timer.avoidDuplicateDescription >= 2:
for rtimer in chain.from_iterable( itervalues(timerdict) ):
if not rtimer.disabled:
if self.checkDuplicates(timer, name, rtimer.name, shortdesc, rtimer.description, extdesc, rtimer.extdesc ):
oldExists = True
doLog("We found a timer (any service) with same description, skipping event")
break
if oldExists:
doLog("Skipping an event because a timer on any service exists")
skipped.append((name, begin, end, serviceref, timer.name, getLog()))
continue
if timer.checkCounter(timestamp):
doLog("Not adding new timer because counter is depleted.")
skipped.append((name, begin, end, serviceref, timer.name, getLog()))
continue
# Append to timerlist and abort if simulating
timers.append((name, begin, end, serviceref, timer.name, getLog()))
if simulateOnly:
continue
if newEntry is not None:
# Abort if we don't want to modify timers or timer is repeated
if config.plugins.autotimer.refresh.value == "none" or newEntry.repeated:
doLog("Won't modify existing timer because either no modification allowed or repeated timer")
continue
if hasattr(newEntry, "isAutoTimer"):
msg = "[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name)
doLog(msg)
newEntry.log(501, msg)
elif config.plugins.autotimer.add_autotimer_to_tags.value and TAG in newEntry.tags:
msg = "[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name)
doLog(msg)
newEntry.log(501, msg)
else:
if config.plugins.autotimer.refresh.value != "all":
doLog("Won't modify existing timer because it's no timer set by us")
continue
msg = "[AutoTimer] Warning, AutoTimer %s messed with a timer which might not belong to it: %s ." % (timer.name, newEntry.name)
doLog(msg)
newEntry.log(501, msg)
modified += 1
if allow_modify:
self.modifyTimer(newEntry, name, shortdesc, begin, end, serviceref, eit)
msg = "[AutoTimer] AutoTimer modified timer: %s ." % (newEntry.name)
doLog(msg)
newEntry.log(501, msg)
else:
msg = "[AutoTimer] AutoTimer modification not allowed for timer: %s ." % (newEntry.name)
doLog(msg)
else:
newEntry = RecordTimerEntry(ServiceReference(serviceref), begin, end, name, shortdesc, eit)
msg = "[AutoTimer] Try to add new timer based on AutoTimer %s." % (timer.name)
doLog(msg)
newEntry.log(500, msg)
示例2: parseTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import isAutoTimer [as 别名]
#.........这里部分代码省略.........
break
# We found no timer we want to edit
if newEntry is None:
# But there is a match
if oldExists:
continue
# We want to search for possible doubles
if timer.avoidDuplicateDescription >= 2:
for rtimer in chain.from_iterable( itervalues(timerdict) ):
if not rtimer.disabled:
if self.checkDuplicates(timer, name, rtimer.name, shortdesc, rtimer.description, extdesc, rtimer.extdesc ):
oldExists = True
print("[AutoTimer] We found a timer (any service) with same description, skipping event")
break
if oldExists:
continue
if timer.checkCounter(timestamp):
print("[AutoTimer] Not adding new timer because counter is depleted.")
continue
# Append to timerlist and abort if simulating
timers.append((name, begin, end, serviceref, timer.name))
if simulateOnly:
continue
if newEntry is not None:
# Abort if we don't want to modify timers or timer is repeated
if config.plugins.autotimer.refresh.value == "none" or newEntry.repeated:
print("[AutoTimer] Won't modify existing timer because either no modification allowed or repeated timer")
continue
if hasattr(newEntry, "isAutoTimer"):
newEntry.log(501, "[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name))
else:
if config.plugins.autotimer.refresh.value != "all":
print("[AutoTimer] Won't modify existing timer because it's no timer set by us")
continue
newEntry.log(501, "[AutoTimer] Warning, AutoTimer %s messed with a timer which might not belong to it: %s ." % (timer.name, newEntry.name))
modified += 1
self.modifyTimer(newEntry, name, shortdesc, begin, end, serviceref, eit)
newEntry.log(501, "[AutoTimer] AutoTimer modified timer: %s ." % (newEntry.name))
else:
newEntry = RecordTimerEntry(ServiceReference(serviceref), begin, end, name, shortdesc, eit)
newEntry.log(500, "[AutoTimer] Try to add new timer based on AutoTimer %s." % (timer.name))
# Mark this entry as AutoTimer (only AutoTimers will have this Attribute set)
# It is only temporarily, after a restart it will be lost,
# because it won't be stored in the timer xml file
newEntry.isAutoTimer = True
if getSeasonAndEpisode is not None and timer.series_labeling:
sp_timer = getSeasonAndEpisode(newEntry, name, evtBegin, evtEnd)
if sp_timer:
newEntry = sp_timer
name = newEntry.name
print("[AutoTimer SeriesPlugin] Returned name %s" % (name))
shortdesc = newEntry.description
print("[AutoTimer SeriesPlugin] Returned description %s" % (shortdesc))
if timer.checkFilter(name, shortdesc, extdesc, dayofweek):
continue
示例3: parseEPG
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import isAutoTimer [as 别名]
#.........这里部分代码省略.........
continue
"shortdesc": info.getInfoString(movieref, iServiceInformation.sDescription),
"extdesc": event.getExtendedDescription() or '' # XXX: does event.getExtendedDescription() actually return None on no description or an empty string?
for movieinfo in moviedict.get(dest, ()):
if movieinfo.get("name") == name \
and movieinfo.get("shortdesc") == shortdesc:
# Some channels indicate replays in the extended descriptions
# If the similarity percent is higher then 0.8 it is a very close match
extdescM = movieinfo.get("extdesc")
if ( len(extdesc) == len(extdescM) and extdesc == extdescM ) \
or ( 0.8 < SequenceMatcher(lambda x: x == " ",extdesc, extdescM).ratio() ):
print("[AutoTimer] We found a matching recorded movie, skipping event:", name)
movieExists = True
break
if movieExists:
continue
# Initialize
newEntry = None
oldExists = False
# Check for double Timers
# We first check eit and if user wants us to guess event based on time
# we try this as backup. The allowed diff should be configurable though.
for rtimer in recorddict.get(serviceref, ()):
if rtimer.eit == eit or config.plugins.autotimer.try_guessing.value and getTimeDiff(rtimer, evtBegin, evtEnd) > ((duration/10)*8):
oldExists = True
# Abort if we don't want to modify timers or timer is repeated
if config.plugins.autotimer.refresh.value == "none" or rtimer.repeated:
print("[AutoTimer] Won't modify existing timer because either no modification allowed or repeated timer")
break
if hasattr(rtimer, "isAutoTimer"):
rtimer.log(501, "[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name))
else:
if config.plugins.autotimer.refresh.value != "all":
print("[AutoTimer] Won't modify existing timer because it's no timer set by us")
break
rtimer.log(501, "[AutoTimer] Warning, AutoTimer %s messed with a timer which might not belong to it." % (timer.name))
newEntry = rtimer
modified += 1
# Modify values saved in timer
newEntry.name = name
newEntry.description = shortdesc
newEntry.begin = int(begin)
newEntry.end = int(end)
newEntry.service_ref = ServiceReference(serviceref)
break
elif timer.avoidDuplicateDescription >= 1 \
and not rtimer.disabled \
and rtimer.name == name \
and rtimer.description == shortdesc:
# Some channels indicate replays in the extended descriptions
# If the similarity percent is higher then 0.8 it is a very close match
if ( len(extdesc) == len(rtimer.extdesc) and extdesc == rtimer.extdesc ) \
or ( 0.8 < SequenceMatcher(lambda x: x == " ",extdesc, rtimer.extdesc).ratio() ):
oldExists = True
print("[AutoTimer] We found a timer (similar service) with same description, skipping event")
break
# We found no timer we want to edit
示例4: parseEPG
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import isAutoTimer [as 别名]
#.........这里部分代码省略.........
begin, end = timer.applyOffset(begin, end)
else:
# Apply E2 Offset
begin -= config.recording.margin_before.value * 60
end += config.recording.margin_after.value * 60
# Eventually change service to alternative
if timer.overrideAlternatives:
serviceref = timer.getAlternative(serviceref)
total += 1
# Append to timerlist and abort if simulating
timers.append((name, begin, end, serviceref, timer.name))
if simulateOnly:
continue
# Initialize
newEntry = None
oldExists = False
# Check for double Timers
# We first check eit and if user wants us to guess event based on time
# we try this as backup. The allowed diff should be configurable though.
for rtimer in recorddict.get(serviceref, ()):
if rtimer.eit == eit or config.plugins.autotimer.try_guessing.value and getTimeDiff(rtimer, begin, end) > ((duration/10)*8):
oldExists = True
# Abort if we don't want to modify timers or timer is repeated
if config.plugins.autotimer.refresh.value == "none" or rtimer.repeated:
print "[AutoTimer] Won't modify existing timer because either no modification allowed or repeated timer"
break
if hasattr(rtimer, "isAutoTimer"):
print "[AutoTimer] Modifying existing AutoTimer!"
else:
if config.plugins.autotimer.refresh.value != "all":
print "[AutoTimer] Won't modify existing timer because it's no timer set by us"
break
print "[AutoTimer] Warning, we're messing with a timer which might not have been set by us"
newEntry = rtimer
modified += 1
# Modify values saved in timer
newEntry.name = name
newEntry.description = description
newEntry.begin = int(begin)
newEntry.end = int(end)
newEntry.service_ref = ServiceReference(serviceref)
break
elif timer.avoidDuplicateDescription == 1 and not rtimer.disabled and rtimer.name == name and rtimer.description == description:
oldExists = True
print "[AutoTimer] We found a timer with same description, skipping event"
break
# We found no timer we want to edit
if newEntry is None:
# But there is a match
if oldExists:
continue
# We want to search for possible doubles
if timer.avoidDuplicateDescription == 2:
示例5: parseEPG
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import isAutoTimer [as 别名]
#.........这里部分代码省略.........
serviceref = timer.getAlternative(serviceref)
total += 1
# Append to timerlist and abort if simulating
timers.append((evtInfo.name, begin, end, serviceref, timer.name))
if simulateOnly:
continue
# Check for existing recordings in directory
if timer.avoidDuplicateDescription == 3 and self.checkMovies(evtInfo, dest):
continue
# Initialize
newEntry = None
oldExists = False
# Check for double Timers
# We first check eit and if user wants us to guess event based on time
# we try this as backup. The allowed diff should be configurable though.
for rtimer in recorddict.get(serviceref, ()):
if rtimer.eit == eit or config.plugins.autotimer.try_guessing.value and getTimeDiff(rtimer, begin, end) > ((duration/10)*8):
oldExists = True
# Abort if we don't want to modify timers or timer is repeated
if config.plugins.autotimer.refresh.value == "none":
print "[AutoTimer] Won't modify existing timer because no modification allowed"
break
if rtimer.repeated:
print "[AutoTimer] Won't modify existing timer because repeated timer"
break
if hasattr(rtimer, "isAutoTimer"):
rtimer.log(501, "[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name,))
else:
if config.plugins.autotimer.refresh.value != "all":
print "[AutoTimer] Won't modify existing timer because it's no timer set by us"
break
rtimer.log(501, "[AutoTimer] Warning, AutoTimer %s messed with a timer which might not belong to it." % (timer.name,))
newEntry = rtimer
modified += 1
# Modify values saved in timer
newEntry.name = evtInfo.name
newEntry.description = evtInfo.shortDescription
newEntry.begin = int(begin)
newEntry.end = int(end)
newEntry.service_ref = ServiceReference(serviceref)
break
elif timer.avoidDuplicateDescription >= 1 and self.normalizeRecordTimer(rtimer) == evtInfo:
oldExists = True
print "[AutoTimer] We found a timer with same service and description, skipping event"
break
# We found no timer we want to edit
if newEntry is None:
# But there is a match
if oldExists:
continue
# We want to search for possible doubles
if timer.avoidDuplicateDescription >= 2 and self.isEventInList(evtInfo, recorddict, self.normalizeRecordTimer):