本文整理匯總了Python中InfoBarGenerics.InfoBarNotifications類的典型用法代碼示例。如果您正苦於以下問題:Python InfoBarNotifications類的具體用法?Python InfoBarNotifications怎麽用?Python InfoBarNotifications使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了InfoBarNotifications類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: checkNotifications
def checkNotifications(self):
InfoBarNotifications.checkNotifications(self)
pending = Notifications.notificationQueue.getPending("JobMananger")
if pending:
print "[JobView] have pending JobMananger Notification(s):", pending
elif self.settings.afterEvent.getValue() == "close" and self.job.status == self.job.FAILED:
self.close(False)
示例2: __init__
def __init__(self, session, job, parent=None, cancelable = True, backgroundable = True, afterEventChangeable = True , afterEvent="nothing"):
Screen.__init__(self, session, parent)
Screen.setTitle(self, _("Job View"))
InfoBarNotifications.__init__(self)
ConfigListScreen.__init__(self, [])
self.parent = parent
self.job = job
if afterEvent:
self.job.afterEvent = afterEvent
self["job_name"] = StaticText(job.name)
self["job_progress"] = Progress()
self["job_task"] = StaticText()
self["summary_job_name"] = StaticText(job.name)
self["summary_job_progress"] = Progress()
self["summary_job_task"] = StaticText()
self["job_status"] = StaticText()
self.cancelable = cancelable
self.backgroundable = backgroundable
self["key_green"] = StaticText("")
if self.cancelable:
self["key_red"] = StaticText(_("Cancel"))
else:
self["key_red"] = StaticText("")
if self.backgroundable:
self["key_blue"] = StaticText(_("Background"))
else:
self["key_blue"] = StaticText("")
self.onShow.append(self.windowShow)
self.onHide.append(self.windowHide)
self["setupActions"] = ActionMap(["ColorActions", "SetupActions"],
{
"green": self.ok,
"red": self.abort,
"blue": self.background,
"cancel": self.abort,
"ok": self.ok,
}, -2)
self.settings = ConfigSubsection()
if SystemInfo["DeepstandbySupport"]:
shutdownString = _("go to deep standby")
else:
shutdownString = _("shut down")
self.settings.afterEvent = ConfigSelection(choices = [("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString)], default = self.job.afterEvent or "nothing")
self.job.afterEvent = self.settings.afterEvent.value
self.afterEventChangeable = afterEventChangeable
self.setupList()
self.state_changed()
示例3: __init__
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True):
from Components.Sources.StaticText import StaticText
from Components.Sources.Progress import Progress
from Components.Sources.Boolean import Boolean
from Components.ActionMap import ActionMap
Screen.__init__(self, session, parent)
InfoBarNotifications.__init__(self)
ConfigListScreen.__init__(self, [])
self.parent = parent
self.job = job
self["job_name"] = StaticText(job.name)
self["job_progress"] = Progress()
self["job_task"] = StaticText()
self["summary_job_name"] = StaticText(job.name)
self["summary_job_progress"] = Progress()
self["summary_job_task"] = StaticText()
self["job_status"] = StaticText()
self["finished"] = Boolean()
self["cancelable"] = Boolean(cancelable)
self["backgroundable"] = Boolean(backgroundable)
self["key_blue"] = StaticText(_("Background"))
self.onShow.append(self.windowShow)
self.onHide.append(self.windowHide)
self["setupActions"] = ActionMap(
["ColorActions", "SetupActions"],
{"green": self.ok, "red": self.abort, "blue": self.background, "cancel": self.ok, "ok": self.ok},
-2,
)
self.settings = ConfigSubsection()
if SystemInfo["DeepstandbySupport"]:
shutdownString = _("go to deep standby")
else:
shutdownString = _("shut down")
self.settings.afterEvent = ConfigSelection(
choices=[
("nothing", _("do nothing")),
("close", _("Close")),
("standby", _("go to standby")),
("deepstandby", shutdownString),
],
default=self.job.afterEvent or "nothing",
)
self.job.afterEvent = self.settings.afterEvent.getValue()
self.afterEventChangeable = afterEventChangeable
self.setupList()
self.state_changed()
示例4: __init__
def __init__(self, session, job, parent = None, cancelable = True, backgroundable = True, afterEventChangeable = True, afterEvent = 'nothing'):
from Components.Sources.StaticText import StaticText
from Components.Sources.Progress import Progress
from Components.Sources.Boolean import Boolean
from Components.ActionMap import ActionMap
Screen.__init__(self, session, parent)
Screen.setTitle(self, _('Job View'))
InfoBarNotifications.__init__(self)
ConfigListScreen.__init__(self, [])
self.parent = parent
self.job = job
if afterEvent:
self.job.afterEvent = afterEvent
self['job_name'] = StaticText(job.name)
self['job_progress'] = Progress()
self['job_task'] = StaticText()
self['summary_job_name'] = StaticText(job.name)
self['summary_job_progress'] = Progress()
self['summary_job_task'] = StaticText()
self['job_status'] = StaticText()
self['finished'] = Boolean()
self['cancelable'] = Boolean(cancelable)
self['backgroundable'] = Boolean(backgroundable)
self['key_blue'] = StaticText(_('Background'))
self.onShow.append(self.windowShow)
self.onHide.append(self.windowHide)
self['setupActions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.ok,
'red': self.abort,
'blue': self.background,
'cancel': self.ok,
'ok': self.ok}, -2)
self.settings = ConfigSubsection()
if SystemInfo['DeepstandbySupport']:
shutdownString = _('go to deep standby')
else:
shutdownString = _('shut down')
self.settings.afterEvent = ConfigSelection(choices=[('nothing', _('do nothing')),
('close', _('Close')),
('standby', _('go to standby')),
('deepstandby', shutdownString)], default=self.job.afterEvent or 'nothing')
self.job.afterEvent = self.settings.afterEvent.value
self.afterEventChangeable = afterEventChangeable
self.setupList()
self.state_changed()
示例5: checkNotifications
def checkNotifications(self):
InfoBarNotifications.checkNotifications(self)
if Notifications.notifications == []:
if self.settings.afterEvent.getValue() == "close" and self.job.status == self.job.FAILED:
self.close(False)
示例6: checkNotifications
def checkNotifications(self):
InfoBarNotifications.checkNotifications(self)
if not Notifications.notifications:
if self.settings.afterEvent.value == 'close' and self.job.status == self.job.FAILED:
self.close(False)