当前位置: 首页>>代码示例>>Python>>正文


Python RecordTimerEntry.vpsplugin_time方法代码示例

本文整理汇总了Python中RecordTimer.RecordTimerEntry.vpsplugin_time方法的典型用法代码示例。如果您正苦于以下问题:Python RecordTimerEntry.vpsplugin_time方法的具体用法?Python RecordTimerEntry.vpsplugin_time怎么用?Python RecordTimerEntry.vpsplugin_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecordTimer.RecordTimerEntry的用法示例。


在下文中一共展示了RecordTimerEntry.vpsplugin_time方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addTimer

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import vpsplugin_time [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
		}
开发者ID:Leatherface75,项目名称:enigma2pc,代码行数:58,代码来源:timers.py

示例2: addTimer

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import vpsplugin_time [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
		}
开发者ID:HDMU,项目名称:e2openplugin-OpenWebif,代码行数:64,代码来源:timers.py


注:本文中的RecordTimer.RecordTimerEntry.vpsplugin_time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。