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


Python RecordTimerEntry.log方法代码示例

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


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

示例1: program_seek_vps_multiple_closed

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]
	def program_seek_vps_multiple_closed(self, retval):
		self.program_seek_vps_multiple_started = -1
		
		self.found_vps_multiple = sorted(self.found_vps_multiple)
		
		for evt_begin, evt_id, evt in self.found_vps_multiple:
			# eigenen Timer überprüfen, wenn Zeiten nicht überschrieben werden dürfen
			if not self.timer.vpsplugin_overwrite and evt_begin <= self.timer.end:
				self.next_events.append(evt_id)
				self.timer.log(0, "[VPS] add event_id "+ str(evt_id))
			
			else:
				canbeadded = True
				evt_begin += 60
				evt_end = evt.getBeginTime() + evt.getDuration() - 60
				now = time()
				
				for checktimer in self.session.nav.RecordTimer.timer_list:
					if checktimer == self.timer:
						continue
					if (checktimer.begin - now) > 3600*24:
						break
					if checktimer.service_ref.ref.toCompareString() == self.timer.service_ref.ref.toCompareString() or checktimer.service_ref.ref.toCompareString() == self.rec_ref.toCompareString():	
						if checktimer.begin <= evt_begin and checktimer.end >= evt_end:
							if not checktimer.vpsplugin_enabled or not checktimer.vpsplugin_overwrite:
								canbeadded = False
							
							# manuell angelegter Timer mit VPS
							if checktimer.vpsplugin_enabled and checktimer.name == "" and checktimer.vpsplugin_time is not None:
								checktimer.eit = evt_id
								checktimer.name = evt.getEventName()
								checktimer.description = evt.getShortDescription()
								checktimer.vpsplugin_time = None
								checktimer.log(0, "[VPS] changed timer (found same PDC-Time as in other VPS-recording)")
								canbeadded = False
								break

				
				if canbeadded:
					newevent_data = parseEvent(evt)
					newEntry = RecordTimerEntry(ServiceReference(self.rec_ref), *newevent_data)
					newEntry.vpsplugin_enabled = True
					newEntry.vpsplugin_overwrite = True
					newEntry.log(0, "[VPS] added this timer (found same PDC-Time as in other VPS-recording)")
					
					# Wenn kein Timer-Konflikt auftritt, wird der Timer angelegt.
					NavigationInstance.instance.RecordTimer.record(newEntry)
开发者ID:BAZANT,项目名称:enigma2-plugins-sh4,代码行数:49,代码来源:Vps.py

示例2: check_and_add_event

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]
	def check_and_add_event(self, neweventid):
		if not config.plugins.vps.allow_seeking_multiple_pdc.value:
			return
		
		epgcache = eEPGCache.getInstance()
		evt = epgcache.lookupEventId(self.rec_ref, neweventid)
		
		if evt:
			evt_begin = evt.getBeginTime() + 60
			evt_end = evt.getBeginTime() + evt.getDuration() - 60
			
			if evt_begin < self.timer.begin:
				return
			
			for checktimer in self.session.nav.RecordTimer.timer_list:
				if checktimer == self.timer:
					continue
				if (checktimer.begin - evt_begin) > 3600*2:
					break
				
				compareString = checktimer.service_ref.ref.toCompareString()
				if compareString == self.timer.service_ref.ref.toCompareString() or compareString == self.rec_ref.toCompareString():	
					if checktimer.eit == neweventid:
						return
					
					if checktimer.begin <= evt_begin and checktimer.end >= evt_end:
						if checktimer.vpsplugin_enabled is None or not checktimer.vpsplugin_enabled:
							return
						
						# manuell angelegter Timer mit VPS
						if checktimer.name == "" and checktimer.vpsplugin_time is not None:
							checktimer.eit = neweventid
							checktimer.name = evt.getEventName()
							checktimer.description = evt.getShortDescription()
							checktimer.vpsplugin_time = None
							checktimer.log(0, "[VPS] changed timer (found same PDC-Time as in other VPS-recording)")
							return
			
			# eigenen Timer überprüfen, wenn Zeiten nicht überschrieben werden dürfen
			if not self.timer.vpsplugin_overwrite and evt_begin <= self.timer.end:
				check_already_existing = [x for (x,y) in self.next_events if y == neweventid]
				if len(check_already_existing) > 0:
					start = check_already_existing.pop()
					if start == evt_begin:
						return
					else:
						self.next_events.remove( (start, neweventid) )
						self.timer.log(0, "[VPS] delete event_id "+ str(neweventid) +" because of delay "+ str(evt_begin - start))
					
				self.next_events.append( (evt_begin, neweventid) )
				self.next_events = sorted(self.next_events)
				self.timer.log(0, "[VPS] add event_id "+ str(neweventid))
				
			else:
				newevent_data = parseEvent(evt)
				newEntry = RecordTimerEntry(ServiceReference(self.rec_ref), *newevent_data)
				newEntry.vpsplugin_enabled = True
				newEntry.vpsplugin_overwrite = True
				newEntry.dirname = self.timer.dirname
				newEntry.log(0, "[VPS] added this timer (found same PDC-Time as in other VPS-recording)")
				
				# Wenn kein Timer-Konflikt auftritt, wird der Timer angelegt.
				res = NavigationInstance.instance.RecordTimer.record(newEntry)
				self.timer.log(0, "[VPS] added another timer, res "+ str(res))
开发者ID:Haehnchen,项目名称:enigma2-plugins,代码行数:66,代码来源:Vps.py

示例3: __init__

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]
class vps_timer:
	def __init__(self, timer, session):
		self.timer = timer
		self.session = session
		self.program = eConsoleAppContainer()
		self.dataAvail_conn = self.program.dataAvail.connect(self.program_dataAvail)
		self.appClosed_conn = self.program.appClosed.connect(self.program_closed)
		self.program_running = False
		self.program_try_search_running = False
		self.activated_auto_increase = False
		self.simulate_recordService = None
		self.demux = -1
		self.rec_ref = None
		self.found_pdc = False
		self.dont_restart_program = False
		self.org_timer_end = 0
		self.org_timer_begin = 0
		self.max_extending_timer = 4*3600
		self.next_events = [ ]
		self.new_timer_copy = None
		self.pausing = False
	
	
	def program_closed(self, retval):
		self.timer.log(0, "[VPS] stop monitoring (process terminated)")
		if self.program_running or self.program_try_search_running:
			self.program_running = False
			self.program_try_search_running = False
			self.stop_simulation()
	
	def program_dataAvail(self, str):
		if self.timer is None or self.timer.state == TimerEntry.StateEnded or self.timer.cancelled:
			self.program_abort()
			self.stop_simulation()
			return
		if self.timer.vpsplugin_enabled == False or config.plugins.vps.enabled.value == False:
			if self.activated_auto_increase:
				self.timer.autoincrease = False
			self.program_abort()
			self.stop_simulation()
			return
		
		lines = str.split("\n")
		for line in lines:
			data = line.split()
			if len(data) == 0:
				continue
			
			self.timer.log(0, "[VPS] " + line)
			
			if data[0] == "RUNNING_STATUS":
				if data[1] == "0": # undefined
					if data[2] == "FOLLOWING":
						data[1] = "1"
					else:
						data[1] = "4"
				
				if data[1] == "1": # not running
					# Wenn der Eintrag im Following (Section_Number = 1) ist,
					# dann nicht beenden (Sendung begann noch gar nicht)
					if data[2] == "FOLLOWING":
						self.activate_autoincrease()
					elif self.timer.state == TimerEntry.StateRunning and not self.pausing and not self.set_next_event():
						self.stop_recording()
						self.dont_restart_program = True
						self.program_abort()
				
				elif data[1] == "2": # starts in a few seconds
					self.activate_autoincrease()
					if self.timer.state == TimerEntry.StateWaiting:
						self.session.nav.RecordTimer.doActivate(self.timer)
				
				elif data[1] == "3": # pausing
					self.pausing = True
					if self.timer.state == TimerEntry.StateRunning:
						self.activate_autoincrease()
				
				elif data[1] == "4": # running
					self.pausing = False
					if self.timer.state == TimerEntry.StateRunning:
						self.activate_autoincrease()
					elif self.timer.state == TimerEntry.StateWaiting or self.timer.state == TimerEntry.StatePrepared:
						# setze Startzeit auf jetzt
						self.timer.begin = int(time())
						self.session.nav.RecordTimer.timeChanged(self.timer)
						
						self.activate_autoincrease()
						self.program_abort()
						self.stop_simulation()
						vps_timers.checksoon(2000) # Programm neu starten
				
				elif data[1] == "5": # service off-air
					self.timer.vpsplugin_overwrite = False
					if self.activated_auto_increase:
						self.timer.autoincrease = False
						self.activated_auto_increase = False
			
			
			elif data[0] == "EVENT_ENDED":
				if not self.set_next_event():
#.........这里部分代码省略.........
开发者ID:Haehnchen,项目名称:enigma2-plugins,代码行数:103,代码来源:Vps.py

示例4: parseTimer

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]

#.........这里部分代码省略.........
					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("[AutoTimer] We found a timer (any service) with same description, skipping event")
								break
					if oldExists:
						doLog("[AutoTimer] 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("[AutoTimer] 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("[AutoTimer] Won't modify existing timer because either no modification allowed or repeated timer")
					continue

				if "autotimer" in newEntry.flags:
					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("[AutoTimer] 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)

				if allow_modify:
					if self.modifyTimer(newEntry, name, shortdesc, begin, end, serviceref, eit, base_timer=timer):
						msg = "[AutoTimer] AutoTimer modified timer: %s ." % (newEntry.name)
						doLog(msg)
						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)
开发者ID:OpenPLi,项目名称:enigma2-plugins,代码行数:70,代码来源:AutoTimer.py

示例5: parseTimer

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]

#.........这里部分代码省略.........

				# 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)
				
				# 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
开发者ID:dogfight76,项目名称:enigma2-plugins,代码行数:70,代码来源:AutoTimer.py

示例6: parseTimer

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]

#.........这里部分代码省略.........
						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 timerdict.get(serviceref, ()):
				if (rtimer.eit == eit or config.plugins.autotimer.try_guessing.getValue()) 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 eit == preveit:
						break
					
					if (evtBegin - (config.recording.margin_before.getValue() * 60) != rtimer.begin) or (evtEnd + (config.recording.margin_after.getValue() * 60) != rtimer.end) or (shortdesc != rtimer.description):
						if rtimer.isAutoTimer and eit == rtimer.eit:
							print ("[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name))
							# rtimer.log(501, "[AutoTimer] AutoTimer %s modified this automatically generated timer." % (timer.name))
							preveit = eit
						else:
							if config.plugins.autotimer.refresh.getValue() != "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: %s ." % (timer.name, rtimer.name))
						newEntry = rtimer
						modified += 1
						self.modifyTimer(rtimer, name, shortdesc, begin, end, serviceref, eit)
						# rtimer.log(501, "[AutoTimer] AutoTimer modified timer: %s ." % (rtimer.name))
						break
					else:
						print ("[AutoTimer] Skipping timer because it has not changed.")
						skipped += 1
						break
				elif timer.avoidDuplicateDescription >= 1 and not rtimer.disabled:
					if self.checkSimilarity(timer, name, rtimer.name, shortdesc, rtimer.description, extdesc, rtimer.extdesc ):
						print("[AutoTimer] We found a timer with similar description, skipping event")
						oldExists = True
						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
				for rtimer in chain.from_iterable( itervalues(timerdict) ):
					if not rtimer.disabled:
						if self.checkDoubleTimers(timer, name, rtimer.name, begin, rtimer.begin, end, rtimer.end ):
							oldExists = True
							# print("[AutoTimer] We found a timer with same StartTime, skipping event")
							break
						if timer.avoidDuplicateDescription >= 2:
							if self.checkSimilarity(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")
开发者ID:Linux-Box,项目名称:enigma2-plugins,代码行数:70,代码来源:AutoTimer.py

示例7: parseEPG

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]

#.........这里部分代码省略.........
									"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
				if newEntry is None:
开发者ID:BAZANT,项目名称:enigma2-plugins-sh4,代码行数:70,代码来源:AutoTimer.py

示例8: parseEPG

# 需要导入模块: from RecordTimer import RecordTimerEntry [as 别名]
# 或者: from RecordTimer.RecordTimerEntry import log [as 别名]

#.........这里部分代码省略.........

				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):
						print "[AutoTimer] We found a timer with same description, skipping event"
开发者ID:Johnny-Dopp,项目名称:enigma2-plugins,代码行数:70,代码来源:AutoTimer.py

示例9: addTimer

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


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