本文整理汇总了Python中RecordTimer.RecordTimerEntry.calculateFilename方法的典型用法代码示例。如果您正苦于以下问题:Python RecordTimerEntry.calculateFilename方法的具体用法?Python RecordTimerEntry.calculateFilename怎么用?Python RecordTimerEntry.calculateFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordTimer.RecordTimerEntry
的用法示例。
在下文中一共展示了RecordTimerEntry.calculateFilename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import calculateFilename [as 别名]
#.........这里部分代码省略.........
newEntry.log(501, msg)
modified += 1
else:
msg = "[AutoTimer] AutoTimer modification not allowed for timer %s because conflicts or double timer." % (newEntry.name)
doLog(msg)
if oldEntry:
self.setOldTimer(newEntry, oldEntry)
doLog("[AutoTimer] conflict for modification timer %s detected return to old timer" % (newEntry.name))
continue
else:
msg = "[AutoTimer] AutoTimer modification not allowed for timer: %s ." % (newEntry.name)
doLog(msg)
continue
else:
newEntry = RecordTimerEntry(ServiceReference(serviceref), begin, end, name, shortdesc, eit)
newAT = True
msg = "[AutoTimer] Try to add new timer based on AutoTimer %s." % (timer.name)
doLog(msg)
newEntry.log(500, msg)
# Mark this entry as AutoTimer
newEntry.flags.add("autotimer")
# Apply afterEvent
if timer.hasAfterEvent():
afterEvent = timer.getAfterEventTimespan(localtime(end))
if afterEvent is None:
afterEvent = timer.getAfterEvent()
if afterEvent is not None:
newEntry.afterEvent = afterEvent
newEntry.dirname = dest
newEntry.calculateFilename()
newEntry.justplay = timer.justplay
newEntry.vpsplugin_enabled = timer.vps_enabled
newEntry.vpsplugin_overwrite = timer.vps_overwrite
newEntry.conflict_detection = timer.conflict_detection
newEntry.always_zap = timer.always_zap
newEntry.zap_wakeup = timer.zap_wakeup
tags = timer.tags[:]
if config.plugins.autotimer.add_autotimer_to_tags.value:
if 'AutoTimer' not in tags:
tags.append('AutoTimer')
if config.plugins.autotimer.add_name_to_tags.value:
tagname = timer.name.strip()
if tagname:
tagname = tagname[0].upper() + tagname[1:].replace(" ", "_")
if tagname not in tags:
tags.append(tagname)
newEntry.tags = tags
if oldExists and newAT is None:
if self.isResolvedConflict(newEntry):
recordHandler.timeChanged(newEntry)
else:
if oldEntry:
self.setOldTimer(newEntry, oldEntry)
doLog("[AutoTimer] rechecking - conflict for timer %s detected return to old timer" % (newEntry.name))
continue
elif newAT:
newAT = newEntry
conflictString = ""
if similarTimer:
conflictString = similardict[eit].conflictString
示例2: parseTimer
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import calculateFilename [as 别名]
#.........这里部分代码省略.........
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)
# 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
# Apply afterEvent
if timer.hasAfterEvent():
afterEvent = timer.getAfterEventTimespan(localtime(end))
if afterEvent is None:
afterEvent = timer.getAfterEvent()
if afterEvent is not None:
newEntry.afterEvent = afterEvent
newEntry.dirname = dest
newEntry.calculateFilename()
newEntry.justplay = timer.justplay
newEntry.vpsplugin_enabled = timer.vps_enabled
newEntry.vpsplugin_overwrite = timer.vps_overwrite
tags = timer.tags[:]
if config.plugins.autotimer.add_autotimer_to_tags.value:
if TAG not in tags:
tags.append(TAG)
if config.plugins.autotimer.add_name_to_tags.value:
tagname = timer.name.strip()
if tagname:
tagname = tagname[0].upper() + tagname[1:].replace(" ", "_")
if tagname not in tags:
tags.append(tagname)
newEntry.tags = tags
if oldExists:
# XXX: this won't perform a sanity check, but do we actually want to do so?
recordHandler.timeChanged(newEntry)
else:
conflictString = ""
if similarTimer:
conflictString = similardict[eit].conflictString
msg = "[AutoTimer] Try to add similar Timer because of conflicts with %s." % (conflictString)
doLog(msg)
newEntry.log(504, msg)
# Try to add timer
conflicts = recordHandler.record(newEntry)
if conflicts: