本文整理汇总了Python中RecordTimer.RecordTimerEntry.dontSave方法的典型用法代码示例。如果您正苦于以下问题:Python RecordTimerEntry.dontSave方法的具体用法?Python RecordTimerEntry.dontSave怎么用?Python RecordTimerEntry.dontSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordTimer.RecordTimerEntry
的用法示例。
在下文中一共展示了RecordTimerEntry.dontSave方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: recordNow
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import dontSave [as 别名]
def recordNow(session, infinite):
rt = session.nav.RecordTimer
serviceref = session.nav.getCurrentlyPlayingServiceReference().toString()
try:
event = session.nav.getCurrentService().info().getEvent(0)
except Exception:
event = None
if not event and not infinite:
return {
"result": False,
"message": "No event found! Not recording!"
}
if event:
(begin, end, name, description, eit) = parseEvent(event)
begin = time()
msg = "Instant record for current Event started"
else:
name = "instant record"
description = ""
eit = 0
if infinite:
begin = time()
end = begin + 3600 * 10
msg = "Infinite Instant recording started"
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
False,
False,
0,
dirname=preferredInstantRecordPath()
)
timer.dontSave = True
if rt.record(timer):
return {
"result": False,
"message": "Timer conflict detected! Not recording!"
}
return {
"result": True,
"message": msg
}
示例2: recordNow
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import dontSave [as 别名]
def recordNow(self, param):
if not config.misc.recording_allowed.value:
return (False, _("Recording is currently disabled!"))
limitEvent = True
if param == "undefinitely" or param == "infinite":
ret = (True, "Infinite Instant recording started")
limitEvent = False
else:
ret = ( True, "Instant record for current Event started" )
serviceref = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference().toString())
event = None
try:
service = self.session.nav.getCurrentService()
event = service.info().getEvent(0)
except Exception:
print "[Webcomponents.Timer] recordNow Exception!"
begin = time()
end = begin + 3600 * 10
name = "instant record"
description = ""
eventid = 0
if event is not None:
curEvent = parseEvent(event)
name = curEvent[2]
description = curEvent[3]
eventid = curEvent[4]
if limitEvent:
end = curEvent[1]
else:
if limitEvent:
ret = ( False, "No event found! Not recording!" )
if ret[0]:
location = preferredInstantRecordPath()
timer = RecordTimerEntry(serviceref, begin, end, name, description, eventid, False, False, 0, dirname=location)
timer.dontSave = True
recRet = self.recordtimer.record(timer)
if recRet is not None:
# a conflict is rather unlikely, but this can also indicate a non-recordable service
ret = (False, "Timer conflict detected! Not recording!" )
return ret
示例3: recordNow
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import dontSave [as 别名]
def recordNow(self, param):
limitEvent = True
if param == "undefinitely" or param == "infinite":
ret = (True, "Infinite Instant recording started")
limitEvent = False
else:
ret = (True, "Instant record for current Event started")
serviceref = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference().toString())
event = None
try:
service = self.session.nav.getCurrentService()
event = service.info().getEvent(0)
except Exception:
print "[Webcomponents.Timer] recordNow Exception!"
begin = time()
end = begin + 3600 * 10
name = "instant record"
description = ""
eventid = 0
if event is not None:
curEvent = parseEvent(event)
name = curEvent[2]
description = curEvent[3]
eventid = curEvent[4]
if limitEvent:
end = curEvent[1]
else:
if limitEvent:
ret = (False, "No event found! Not recording!")
if ret[0]:
location = config.movielist.last_videodir.value
timer = RecordTimerEntry(
serviceref, begin, end, name, description, eventid, False, False, 0, dirname=location
)
timer.dontSave = True
self.recordtimer.record(timer)
return ret
示例4: recordNow
# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import dontSave [as 别名]
def recordNow(session, infinite):
rt = session.nav.RecordTimer
serviceref = session.nav.getCurrentlyPlayingServiceReference().toString()
try:
event = session.nav.getCurrentService().info().getEvent(0)
except Exception:
event = None
if not event and not infinite:
return {
"result": False,
"message": _("No event found! Not recording!")
}
if event:
(begin, end, name, description, eit) = parseEvent(event)
begin = time()
msg = _("Instant record for current Event started")
else:
name = "instant record"
description = ""
eit = 0
if infinite:
begin = time()
end = begin + 3600 * 10
msg = _("Infinite Instant recording started")
timer = RecordTimerEntry(
ServiceReference(serviceref),
begin,
end,
name,
description,
eit,
False,
False,
0,
dirname=preferredInstantRecordPath()
)
timer.dontSave = True
if rt.record(timer):
return {
"result": False,
"message": _("Timer conflict detected! Not recording!")
}
nt = {
"serviceref": str(timer.service_ref),
"servicename": timer.service_ref.getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', ''),
"eit": timer.eit,
"name": timer.name,
"begin": timer.begin,
"end": timer.end,
"duration": timer.end - timer.begin
}
return {
"result": True,
"message": msg,
"newtimer": nt
}