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


Python InfoBarGenerics.InfoBarPiP类代码示例

本文整理汇总了Python中Screens.InfoBarGenerics.InfoBarPiP的典型用法代码示例。如果您正苦于以下问题:Python InfoBarPiP类的具体用法?Python InfoBarPiP怎么用?Python InfoBarPiP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: failureCB_pip

	def failureCB_pip(self, answer):
		if answer:
			self.log(13, "ok, disable PIP")
			from Screens.InfoBar import InfoBar
			from Screens.InfoBarGenerics import InfoBarPiP
			from Components.ServiceEventTracker import InfoBarCount
			InfoBarInstance = InfoBarCount == 1 and InfoBar.instance
			if InfoBarInstance:
				InfoBarPiP.showPiP(InfoBarInstance)
				self.messageString += _("Disabled PIP.\n")
			else:
				self.log(14, "tried to disable PIP, suddenly found no InfoBar.instance")
				self.messageString += _("Tried to disable PIP, suddenly found no InfoBar.instance.\n")
			if config.recording.ask_to_abort_pip.value in ("ask", "abort_msg"):
				self.messageStringShow = True
			self.justTriedFreeingTuner = True
		else:
			self.log(14, "user didn't want to disable PIP, try other methods of freeing a tuner")
		self.messageBoxAnswerPending = False
开发者ID:ybagci,项目名称:enigma2,代码行数:19,代码来源:RecordTimer.py

示例2: movePiP

	def movePiP(self):
		if self.session.pipshown:
			InfoBarPiP.movePiP(self)
开发者ID:kingvuplus,项目名称:Bh-E2,代码行数:3,代码来源:InfoBar.py

示例3: activate

	def activate(self):
		global wasRecTimerWakeup
		if os.path.exists("/tmp/was_rectimer_wakeup") and not wasRecTimerWakeup:
			wasRecTimerWakeup = int(open("/tmp/was_rectimer_wakeup", "r").read()) and True or False

		next_state = self.state + 1
		if debug:
			self.log(5, "activating state %d" % next_state)

		# print "[TIMER] activate called",time(),next_state,self.first_try_prepare,' pending ',self.messageBoxAnswerPending,' justTried ',self.justTriedFreeingTuner,' show ',self.messageStringShow,self.messageString #TODO remove

		if next_state == self.StatePrepared:
			if self.messageBoxAnswerPending:
				self.start_prepare = time() + 1 # call again in 1 second
				return False

			if self.justTriedFreeingTuner:
				self.start_prepare = time() + 5 # tryPrepare in 5 seconds
				self.justTriedFreeingTuner = False
				return False

			if not self.justplay and not self.freespace():
				Notifications.AddPopup(text = _("Write error while recording. Disk full?\n%s") % self.name, type = MessageBox.TYPE_ERROR, timeout = 5, id = "DiskFullMessage")
				self.failed = True
				self.next_activation = time()
				self.end = time() + 5
				self.backoff = 0
				return True

			if self.always_zap:
				if Screens.Standby.inStandby:
					self.wasInStandby = True
					#eActionMap.getInstance().bindAction('', -maxint - 1, self.keypress)
					#set service to zap after standby
					Screens.Standby.inStandby.prev_running_service = self.service_ref.ref
					Screens.Standby.inStandby.paused_service = None
					#wakeup standby
					Screens.Standby.inStandby.Power()
					self.log(5, "wakeup and zap to recording service")
				else:
					cur_zap_ref = NavigationInstance.instance.getCurrentlyPlayingServiceReference()
					if cur_zap_ref and not cur_zap_ref.getPath():# we do not zap away if it is no live service
						self.messageString += _("The TV was switched to the recording service!\n")
						self.messageStringShow = True
						self.setRecordingPreferredTuner()
						self.failureCB(True)
						self.log(5, "zap to recording service")

			if self.tryPrepare():
				if debug:
					self.log(6, "prepare ok, waiting for begin")
				if self.messageStringShow:
					Notifications.AddNotification(MessageBox, _("In order to record a timer, a tuner was freed successfully:\n\n") + self.messageString, type=MessageBox.TYPE_INFO, timeout=20)
				# create file to "reserve" the filename
				# because another recording at the same time on another service can try to record the same event
				# i.e. cable / sat.. then the second recording needs an own extension... when we create the file
				# here then calculateFilename is happy
				if not self.justplay:
					open(self.Filename + ".ts", "w").close()
					# give the Trashcan a chance to clean up
					try:
						Trashcan.instance.cleanIfIdle()
					except Exception, e:
						print "[TIMER] Failed to call Trashcan.instance.cleanIfIdle()"
						print "[TIMER] Error:", e
				# fine. it worked, resources are allocated.
				self.next_activation = self.begin
				self.backoff = 0
				return True

			self.log(7, "prepare failed")
			if self.first_try_prepare == 0:
				# (0) try to make a tuner available by disabling PIP
				self.first_try_prepare += 1
				from Screens.InfoBar import InfoBar
				from Screens.InfoBarGenerics import InfoBarPiP
				from Components.ServiceEventTracker import InfoBarCount
				InfoBarInstance = InfoBarCount == 1 and InfoBar.instance
				if InfoBarInstance and InfoBarPiP.pipShown(InfoBarInstance) == True:
					if config.recording.ask_to_abort_pip.value == "ask":
						self.log(8, "asking user to disable PIP")
						self.messageBoxAnswerPending = True
						Notifications.AddNotificationWithCallback(self.failureCB_pip, MessageBox, _("A timer failed to record!\nDisable PIP and try again?\n"), timeout=20)
					elif config.recording.ask_to_abort_pip.value in ("abort_no_msg", "abort_msg"):
						self.log(8, "disable PIP without asking")
						self.setRecordingPreferredTuner()
						self.failureCB_pip(True)
					return False
				else:
					self.log(8, "currently no PIP active... so we dont need to stop it")

			if self.first_try_prepare == 1:
				# (1) try to make a tuner available by aborting pseudo recordings
				self.first_try_prepare += 1
				self.backoff = 0
				if len(NavigationInstance.instance.getRecordings(False,pNavigation.isPseudoRecording)) > 0:
					if config.recording.ask_to_abort_pseudo_rec.value == "ask":
						self.log(8, "asking user to abort pseudo recordings")
						self.messageBoxAnswerPending = True
						Notifications.AddNotificationWithCallback(self.failureCB_pseudo_rec, MessageBox, _("A timer failed to record!\nAbort pseudo recordings (e.g. EPG refresh) and try again?\n"), timeout=20)
#.........这里部分代码省略.........
开发者ID:ybagci,项目名称:enigma2,代码行数:101,代码来源:RecordTimer.py


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