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


Python SelectionList.SelectionList类代码示例

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


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

示例1: IpkgInstaller

class IpkgInstaller(Screen):

    def __init__(self, session, list):
        Screen.__init__(self, session)
        Screen.setTitle(self, _('IPK Installer'))
        self.list = SelectionList()
        self['list'] = self.list
        for listindex in range(len(list)):
            if not list[listindex].split('/')[-1].startswith('._'):
                self.list.addSelection(list[listindex].split('/')[-1], list[listindex], listindex, False)

        self['key_red'] = StaticText(_('Close'))
        self['key_green'] = StaticText(_('Install'))
        self['key_yellow'] = StaticText()
        self['key_blue'] = StaticText(_('Invert'))
        self['introduction'] = StaticText(_('Press OK to toggle the selection.'))
        self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'ok': self.list.toggleSelection,
         'cancel': self.close,
         'red': self.close,
         'green': self.install,
         'blue': self.list.toggleAllSelection}, -1)

    def install(self):
        list = self.list.getSelectionsList()
        cmdList = []
        for item in list:
            cmdList.append((IpkgComponent.CMD_INSTALL, {'package': item[1]}))

        self.session.open(Ipkg, cmdList=cmdList)
开发者ID:kingvuplus,项目名称:boom,代码行数:29,代码来源:ItalysatIPKInstaller.py

示例2: CAidSelect

class CAidSelect(Screen):
    skin = '\n\t\t<screen name="CAidSelect" position="center,center" size="450,440" title="select CAId\'s" >\n\t\t\t<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />\n\t\t\t<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />\n\t\t\t<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />\n\t\t\t<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />\n\t\t\t<widget name="list" position="5,50" size="440,330" scrollbarMode="showOnDemand" />\n\t\t\t<ePixmap pixmap="skin_default/div-h.png" position="0,390" zPosition="1" size="450,2" />\n\t\t\t<widget source="introduction" render="Label" position="0,400" size="450,40" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />\n\t\t</screen>'

    def __init__(self, session, list, selected_caids):
        Screen.__init__(self, session)
        self.list = SelectionList()
        self['list'] = self.list
        for listindex in range(len(list)):
            if find_in_list(selected_caids, list[listindex][0], 0):
                self.list.addSelection(list[listindex][0], list[listindex][1], listindex, True)
            else:
                self.list.addSelection(list[listindex][0], list[listindex][1], listindex, False)

        self['key_red'] = StaticText(_('Cancel'))
        self['key_green'] = StaticText(_('Save'))
        self['introduction'] = StaticText(_('Press OK to select/deselect a CAId.'))
        self['actions'] = ActionMap(['ColorActions', 'SetupActions'], {'ok': self.list.toggleSelection,
         'cancel': self.cancel,
         'green': self.greenPressed,
         'red': self.cancel}, -1)
        self.onShown.append(self.setWindowTitle)

    def setWindowTitle(self):
        self.setTitle(_("select CAId's"))

    def greenPressed(self):
        list = self.list.getSelectionsList()
        print list
        self.close(list)

    def cancel(self):
        self.close()
开发者ID:kingvuplus,项目名称:ZDE-gui,代码行数:32,代码来源:plugin.py

示例3: IpkgInstaller

class IpkgInstaller(Screen):
	def __init__(self, session, list):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("IPK Installer"))
		self.list = SelectionList()
		self["list"] = self.list
		for listindex in range(len(list)):
			if not list[listindex].split('/')[-1].startswith('._'):
				self.list.addSelection(list[listindex].split('/')[-1], list[listindex], listindex, False)

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Install"))
		self["key_yellow"] = StaticText()
		self["key_blue"] = StaticText(_("Invert"))
		self["introduction"] = StaticText(_("Press OK to toggle the selection."))

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
									{
									"ok": self.list.toggleSelection,
									"cancel": self.close,
									"red": self.close,
									"green": self.install,
									"blue": self.list.toggleAllSelection
									}, -1)

	def install(self):
		list = self.list.getSelectionsList()
		cmdList = []
		for item in list:
			cmdList.append((IpkgComponent.CMD_INSTALL, {"package": item[1]}))
		self.session.open(Ipkg, cmdList=cmdList)
开发者ID:margy82,项目名称:vix-core,代码行数:31,代码来源:IPKInstaller.py

示例4: CAidSelect

class CAidSelect(Screen):
	skin = """
		<screen name="CAidSelect" position="center,120" size="820,520" title="select CAId's">
			<ePixmap pixmap="skin_default/buttons/red.png" position="10,5" size="200,40" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/green.png" position="210,5" size="200,40" alphatest="on" />
			<widget source="key_red" render="Label" position="10,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" shadowColor="black" shadowOffset="-2,-2" />
			<widget source="key_green" render="Label" position="210,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" shadowColor="black" shadowOffset="-2,-2" />
			<eLabel position="10,50" size="800,1" backgroundColor="grey" />
			<widget name="list" position="10,55" size="800,420" enableWrapAround="1" scrollbarMode="showOnDemand" />
			<eLabel position="10,480" size="800,1" backgroundColor="grey" />
			<widget source="introduction" render="Label" position="10,488" size="800,25" font="Regular;22" halign="center" />
		</screen>"""

	def __init__(self, session, list, selected_caids):

		Screen.__init__(self, session)

		self.list = SelectionList()
		self["list"] = self.list

		for listindex in range(len(list)):
			if find_in_list(selected_caids,list[listindex][0],0):
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, True)
			else:
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, False)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["introduction"] = StaticText(_("Press OK to select/deselect a CAId."))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
		{
			"ok": self.list.toggleSelection, 
			"cancel": self.cancel, 
			"green": self.greenPressed,
			"red": self.cancel
		}, -1)
		self.onShown.append(self.setWindowTitle)

	def setWindowTitle(self):
		self.setTitle(_("select CAId's"))

	def greenPressed(self):
		list = self.list.getSelectionsList()
		print list
		self.close(list)

	def cancel(self):
		self.close()
开发者ID:OpenDMM,项目名称:enigma2,代码行数:49,代码来源:plugin.py

示例5: __init__

	def __init__(self, session):
		self.skin = LiveStreamingLinks.skin
		Screen.__init__(self, session)
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Download"))
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"ok": self.keyOk,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"green": self.keyGo,
			"red": self.keyCancel,
		}, -2)
		self.list = SelectionList()
		self["list"] = self.list
		self["info"] = StaticText("")

		self.doExit = False
		self.level = self.LEVEL_FILES
		self.subMenuName = ''
		self.subMenuDescrName = ''
		self.xmlFiles = []
		self.xmlCategories = []
		self.lastchanged = ''
		self.lastchanges = ''
		self.onLayoutFinish.append(self.createTopMenu)
开发者ID:et-plugins,项目名称:et-live-links,代码行数:26,代码来源:plugin.py

示例6: __init__

	def __init__(self, session, list, selected_caids):

		Screen.__init__(self, session)

		self.list = SelectionList()
		self["list"] = self.list

		for listindex in range(len(list)):
			if find_in_list(selected_caids,list[listindex][0],0):
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, True)
			else:
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, False)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["introduction"] = StaticText(_("Press OK to select/deselect a CAId."))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
		{
			"ok": self.list.toggleSelection, 
			"cancel": self.cancel, 
			"green": self.greenPressed,
			"red": self.cancel
		}, -1)
		self.onShown.append(self.setWindowTitle)
开发者ID:Atsilla,项目名称:enigma2-1,代码行数:25,代码来源:plugin.py

示例7: CAidSelect

class CAidSelect(Screen):
	skin = """
		<screen name="CAidSelect" position="center,center" size="450,440" title="select CAId's" >
			<ePixmap pixmap="buttons/red.png" position="0,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/green.png" position="140,0" size="140,40" alphatest="on" />
			<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
			<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
			<widget name="list" position="5,50" size="440,330" scrollbarMode="showOnDemand" />
			<ePixmap pixmap="div-h.png" position="0,390" zPosition="1" size="450,2" />
			<widget source="introduction" render="Label" position="0,400" size="450,40" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
		</screen>"""

	def __init__(self, session, list, selected_caids):

		Screen.__init__(self, session)

		self.list = SelectionList()
		self["list"] = self.list

		for listindex in range(len(list)):
			if find_in_list(selected_caids,list[listindex][0],0):
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, True)
			else:
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, False)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["introduction"] = StaticText(_("Press OK to select/deselect a CAId."))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
		{
			"ok": self.list.toggleSelection, 
			"cancel": self.cancel, 
			"green": self.greenPressed,
			"red": self.cancel
		}, -1)
		self.onShown.append(self.setWindowTitle)

	def setWindowTitle(self):
		self.setTitle(_("select CAId's"))

	def greenPressed(self):
		list = self.list.getSelectionsList()
		self.close(list)

	def cancel(self):
		self.close()
开发者ID:Atsilla,项目名称:enigma2-1,代码行数:47,代码来源:plugin.py

示例8: __init__

    def __init__(self, session, list, selected_caids):
        Screen.__init__(self, session)
        self.list = SelectionList()
        self['list'] = self.list
        for listindex in range(len(list)):
            if find_in_list(selected_caids, list[listindex][0], 0):
                self.list.addSelection(list[listindex][0], list[listindex][1], listindex, True)
            else:
                self.list.addSelection(list[listindex][0], list[listindex][1], listindex, False)

        self['key_red'] = StaticText(_('Cancel'))
        self['key_green'] = StaticText(_('Save'))
        self['introduction'] = StaticText(_('Press OK to select/deselect a CAId.'))
        self['actions'] = ActionMap(['ColorActions', 'SetupActions'], {'ok': self.list.toggleSelection,
         'cancel': self.cancel,
         'green': self.greenPressed,
         'red': self.cancel}, -1)
        self.onShown.append(self.setWindowTitle)
开发者ID:kingvuplus,项目名称:ZDE-gui,代码行数:18,代码来源:plugin.py

示例9: __init__

    def __init__(self, session, list):
        Screen.__init__(self, session)
        Screen.setTitle(self, _('IPK Installer'))
        self.list = SelectionList()
        self['list'] = self.list
        for listindex in range(len(list)):
            if not list[listindex].split('/')[-1].startswith('._'):
                self.list.addSelection(list[listindex].split('/')[-1], list[listindex], listindex, False)

        self['key_red'] = StaticText(_('Close'))
        self['key_green'] = StaticText(_('Install'))
        self['key_yellow'] = StaticText()
        self['key_blue'] = StaticText(_('Invert'))
        self['introduction'] = StaticText(_('Press OK to toggle the selection.'))
        self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'ok': self.list.toggleSelection,
         'cancel': self.close,
         'red': self.close,
         'green': self.install,
         'blue': self.list.toggleAllSelection}, -1)
开发者ID:kingvuplus,项目名称:boom,代码行数:19,代码来源:ItalysatIPKInstaller.py

示例10: __init__

	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _('Select bouquets to convert'))
		self.session = session
		self.workList = []
		self.readIndex = 0
		self.working = False
		self.hasFiles = False
		self.list = SelectionList()
		self['list'] = self.list
		self['key_red'] = StaticText(_('Close'))
		self['key_green'] = StaticText('')
		self['key_yellow'] = StaticText(_('Set server IP'))
		self['key_blue'] = StaticText('')
		self['statusbar'] = StaticText(_('Select a remote server IP first'))
		self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'ok': self.keyOk,
		 'cancel': self.close,
		 'red': self.close,
		 'green': self.keyGreen,
		 'yellow': self.keyYellow,
		 'blue': self.keyBlue}, -1)
开发者ID:OpenLD,项目名称:enigma2,代码行数:21,代码来源:plugin.py

示例11: __init__

	def __init__(self, session, list):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("IPK Installer"))
		self.list = SelectionList()
		self["list"] = self.list
		for listindex in range(len(list)):
			if not list[listindex].split('/')[-1].startswith('._'):
				self.list.addSelection(list[listindex].split('/')[-1], list[listindex], listindex, False)

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Install"))
		self["key_blue"] = StaticText(_("Invert"))
		self["introduction"] = StaticText(_("Press OK to toggle the selection."))

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self.list.toggleSelection,
			"cancel": self.close,
			"red": self.close,
			"green": self.install,
			"blue": self.list.toggleAllSelection
		}, -1)
开发者ID:sodo13,项目名称:Atemio-all,代码行数:22,代码来源:IPKInstaller.py

示例12: __init__

	def __init__(self, session):
		Screen.__init__(self, session)
		self.session = session
		self.workList = []
		self.readIndex = 0
		self.working = False
		self.hasFiles = False
		self.list = SelectionList()
		self["list"] = self.list
		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText("")
		self["key_yellow"] = StaticText(_("Set server IP"))
		self["key_blue"] = StaticText("")
		self["statusbar"] = StaticText(_("Select a remote server IP first"))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self.keyOk,
			"cancel": self.close,
			"red": self.close,
			"green": self.keyGreen,
			"yellow": self.keyYellow,
			"blue": self.keyBlue
		}, -1)
开发者ID:blzr,项目名称:e2openplugin-RemoteChannelStreamConverter,代码行数:23,代码来源:plugin.py

示例13: __init__

	def __init__(self, session):
		Screen.__init__(self, session)
		self.session = session
		self.workList = []
		self.readIndex = 0
		self.working = False
		self.hasFiles = False
		self.list = SelectionList()
		self["config"] = self.list
		self["key_red"] = StaticText(_("Back"))
		self["key_green"] = StaticText("")
		self["key_yellow"] = StaticText("")
		self["key_blue"] = StaticText("")
		self["text"] = Label()
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self.keyOk,
			"cancel": self.keyExit,
			"red": self.keyExit,
			"green": self.keyGreen,
			"blue": self.keyBlue
		}, -1)
		self.setTitle(_("Select favorite bouqets to import"))
		self.setRemoteIpCallback(True)
开发者ID:popazerty,项目名称:e2-gui,代码行数:24,代码来源:RemoteTunerServer.py

示例14: __init__

 def __init__(self, session):
     self.skin = IPTVStreams.skin
     Screen.__init__(self, session)
     self['key_red'] = StaticText(_('Cancel'))
     self['key_yellow'] = StaticText(_('Change\nStreams'))
     self['key_green'] = StaticText(_('Download'))
     self['actions'] = ActionMap(['SetupActions', 'NumberActions', 'ColorActions'], {'ok': self.keyOk,
      'save': self.keyGo,
      'cancel': self.keyCancel,
      'yellow': self.changeMenu,
      'green': self.keyGo,
      'red': self.keyCancel}, -2)
     self.list = SelectionList()
     self['list'] = self.list
     self['info'] = StaticText('')
     self.doExit = False
     self.level = self.LEVEL_FILES
     self.subMenuName = ''
     self.subMenuDescrName = ''
     self.xmlFiles = []
     self.xmlCategories = []
     self.lastchanged = ''
     self.lastchanges = ''
     self.onLayoutFinish.append(self.createTopMenu)
开发者ID:mcron,项目名称:enigma2,代码行数:24,代码来源:plugin.py

示例15: StreamingChannelFromServerScreen

class StreamingChannelFromServerScreen(Screen):
	window_title = _("Select bouquets to convert")
	skin = """
		<screen name="StreamingChannelFromServerScreen" position="center,center" size="550,450" title="%s" >
			<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
			<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
			<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
			<widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
			<widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
			<widget name="list" position="5,50" size="540,360" />
			<ePixmap pixmap="skin_default/div-h.png" position="0,410" zPosition="10" size="560,2" transparent="1" alphatest="on" />
			<widget source="statusbar" render="Label" position="5,420" zPosition="10" size="550,30" halign="center" valign="center" font="Regular;22" transparent="1" shadowColor="black" shadowOffset="-1,-1" />
		</screen>""" % (window_title)

	def __init__(self, session):
		Screen.__init__(self, session)
		self.session = session
		self.workList = []
		self.readIndex = 0
		self.working = False
		self.hasFiles = False
		self.list = SelectionList()
		self["list"] = self.list
		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText("")
		self["key_yellow"] = StaticText(_("Set server IP"))
		self["key_blue"] = StaticText("")
		self["statusbar"] = StaticText(_("Select a remote server IP first"))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self.keyOk,
			"cancel": self.close,
			"red": self.close,
			"green": self.keyGreen,
			"yellow": self.keyYellow,
			"blue": self.keyBlue
		}, -1)

	def keyOk(self):
		if self.working:
			return
		if self.readIndex > 0:
			self.list.toggleSelection()

	def keyBlue(self):
		if not self.hasFiles or self.working:
			return
		if self.readIndex > 0:
			try:
				self.list.toggleAllSelection()
			except AttributeError:
				self.list.toggleSelection()

	def keyYellow(self):
		if not self.hasFiles:
			self.session.openWithCallback(self.setRemoteIpCallback, ServerEditor)

	def setRemoteIpCallback(self, ret = False):
		if ret:
			self["statusbar"].setText(_("Testing remote connection"))
			timeout = 3000
			self.currentLength = 0
			self.total = 0
			self.working = True
			creator = ClientCreator(reactor, FTPClient, config.plugins.RemoteStreamConverter.username.value, config.plugins.RemoteStreamConverter.password.value, config.plugins.RemoteStreamConverter.passive.value)
			creator.connectTCP(self.getRemoteAdress(), config.plugins.RemoteStreamConverter.port.value, timeout).addCallback(self.controlConnectionMade).addErrback(self.connectionFailed)

	def controlConnectionMade(self, ftpclient):
		self["statusbar"].setText(_("Connection to remote IP ok"))
		ftpclient.quit()
		self.fetchRemoteBouqets()

	def connectionFailed(self, *args):
		self.working = False
		self["statusbar"].setText(_("Could not connect to remote IP"))

	def fetchRemoteBouqets(self):
		self["statusbar"].setText(_("Downloading remote services"))
		self.readIndex = 0
		self.workList = []
		self.workList.append('bouquets.tv')
		self.workList.append('bouquets.radio')
		self.download(self.workList[0]).addCallback(self.fetchRemoteBouqetsFinished).addErrback(self.fetchRemoteBouqetsFailed)

	def fetchRemoteBouqetsFailed(self, string):
		self.working = False
		self["statusbar"].setText(_("Download from remote failed"))

	def fetchRemoteBouqetsFinished(self, string):
		self.readIndex += 1
		if self.readIndex < len(self.workList):
			self.download(self.workList[self.readIndex]).addCallback(self.fetchRemoteBouqetsFinished).addErrback(self.fetchRemoteBouqetsFailed)
		else:
			self.parseBouqets()

	def parserWork(self, list, name):
		try:
#.........这里部分代码省略.........
开发者ID:blzr,项目名称:e2openplugin-RemoteChannelStreamConverter,代码行数:101,代码来源:plugin.py


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