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


Python CList.CList类代码示例

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


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

示例1: __init__

 def __init__(self):
     self['Title'] = StaticText()
     self.onLayoutFinish = []
     self.summaries = CList()
     self.instance = None
     self.desktop = None
     return
开发者ID:kingvuplus,项目名称:eg-e2,代码行数:7,代码来源:GUISkin.py

示例2: __init__

	def __init__(self):
		self.downstream_elements = CList()
		self.master = None
		self.sources = [ ]
		self.source = None
		self.__suspended = True
		self.cache = None
开发者ID:1198s,项目名称:enigma2,代码行数:7,代码来源:Element.py

示例3: __init__

	def __init__(self):
		self["Title"] = StaticText()
		self.onLayoutFinish = [ ]
		self.summaries = CList()
		self.instance = None
		self.desktop = None
		self.screenPathMode = False
开发者ID:Akki01,项目名称:enigma2,代码行数:7,代码来源:GUISkin.py

示例4: __init__

	def __init__(self):
		self["Title"] = StaticText()
		self["DeveloperTag"] = StaticText()
		self.onLayoutFinish = [ ]
		self.summaries = CList()
		self.instance = None
		self.desktop = None
开发者ID:Anubisko,项目名称:enigma2,代码行数:7,代码来源:GUISkin.py

示例5: __init__

	def __init__(self, windowTitle=None):
		self["Title"] = StaticText()
		self.onLayoutFinish = [ ]
		self.summaries = CList()
		self.instance = None
		self.desktop = None
		self._zPosition = None
		if windowTitle:
			self.setTitle(windowTitle)
开发者ID:OpenDMM,项目名称:enigma2,代码行数:9,代码来源:GUISkin.py

示例6: __init__

class GUISkin:
	__module__ = __name__

	def __init__(self):
		self["Title"] = StaticText()
		self.onLayoutFinish = [ ]
		self.summaries = CList()
		self.instance = None
		self.desktop = None

	def createGUIScreen(self, parent, desktop, updateonly = False):
		for val in self.renderer:
			if isinstance(val, GUIComponent):
				if not updateonly:
					val.GUIcreate(parent)
				if not val.applySkin(desktop, self):
					print "warning, skin is missing renderer", val, "in", self

		for key in self:
			val = self[key]
			if isinstance(val, GUIComponent):
				if not updateonly:
					val.GUIcreate(parent)
				depr = val.deprecationInfo
				if val.applySkin(desktop, self):
					if depr:
						print "WARNING: OBSOLETE COMPONENT '%s' USED IN SKIN. USE '%s' INSTEAD!" % (key, depr[0])
						print "OBSOLETE COMPONENT WILL BE REMOVED %s, PLEASE UPDATE!" % (depr[1])
				elif not depr:
					print "warning, skin is missing element", key, "in", self

		for w in self.additionalWidgets:
			if not updateonly:
				w.instance = w.widget(parent)
				# w.instance.thisown = 0
			applyAllAttributes(w.instance, desktop, w.skinAttributes, self.scale)

		for f in self.onLayoutFinish:
			if type(f) is not type(self.close): # is this the best way to do this?
				exec(f) in globals(), locals()
			else:
				f()

	def deleteGUIScreen(self):
		for (name, val) in self.items():
			if isinstance(val, GUIComponent):
				val.GUIdelete()

	def close(self):
		self.deleteGUIScreen()

	def createSummary(self):
		return None

	def addSummary(self, summary):
		if summary is not None:
			self.summaries.append(summary)

	def removeSummary(self, summary):
		if summary is not None:
			self.summaries.remove(summary)

	def setTitle(self, title):
		if self.instance:
			self.instance.setTitle(title)
		self["Title"].text = title
		self.summaries.setTitle(title)

	def getTitle(self):
		return self["Title"].text

	def getSkinTitle(self):
		return hasattr(self, "skin_title") and self.skin_title or ""

	title = property(getTitle, setTitle)

	def setDesktop(self, desktop):
		self.desktop = desktop

	def applySkin(self):
		self.skin_title = ""
		z = 0
		baseres = (720, 576) # FIXME: a skin might have set another resolution, which should be the base res
		idx = 0
		skin_title_idx = -1
		title = self.title
		for (key, value) in self.skinAttributes:
			if key == "zPosition":
				z = int(value)
			elif key == "title":
				self.skin_title = value
				skin_title_idx = idx
				if title:
					self.skinAttributes[skin_title_idx] = ("title", title)
				else:
					self["Title"].text = value
					self.summaries.setTitle(value)
			elif key == "baseResolution":
				baseres = tuple([int(x) for x in value.split(',')])
			idx += 1
#.........这里部分代码省略.........
开发者ID:Atsilla,项目名称:enigma2-openpli-fulan,代码行数:101,代码来源:GUISkin.py

示例7: Element

class Element(object):
	CHANGED_DEFAULT = 0   # initial "pull" state
	CHANGED_ALL = 1       # really everything changed
	CHANGED_CLEAR = 2     # we're expecting a real update soon. don't bother polling NOW, but clear data.
	CHANGED_SPECIFIC = 3  # second tuple will specify what exactly changed
	CHANGED_POLL = 4      # a timer expired

	SINGLE_SOURCE = True

	def __init__(self):
		self.downstream_elements = CList()
		self.master = None
		self.sources = [ ]
		self.source = None
		self.__suspended = True
		self.cache = None

	def connectDownstream(self, downstream):
		self.downstream_elements.append(downstream)
		if self.master is None:
			self.master = downstream

	def connectUpstream(self, upstream):
		assert not self.SINGLE_SOURCE or self.source is None
		self.sources.append(upstream)
		# self.source always refers to the last recent source added.
		self.source = upstream
		self.changed((self.CHANGED_DEFAULT,))

	def connect(self, upstream):
		self.connectUpstream(upstream)
		upstream.connectDownstream(self)

	# we disconnect from down to up
	def disconnectAll(self):
		# we should not disconnect from upstream if
		# there are still elements depending on us.
		assert len(self.downstream_elements) == 0, "there are still downstream elements left"

		# Sources don't have a source themselves. don't do anything here.
		for s in self.sources:
			s.disconnectDownstream(self)

		if self.source:
			# sources are owned by the Screen, so don't destroy them here.
			self.destroy()
		self.source = None
		self.sources = [ ]

	def disconnectDownstream(self, downstream):
		self.downstream_elements.remove(downstream)
		if self.master == downstream:
			self.master = None

		if len(self.downstream_elements) == 0:
			self.disconnectAll()

	# default action: push downstream
	def changed(self, *args, **kwargs):
		self.cache = { }
		self.downstream_elements.changed(*args, **kwargs)
		self.cache = None

	def setSuspend(self, suspended):
		changed = self.__suspended != suspended
		if not self.__suspended and suspended:
			self.doSuspend(1)
		elif self.__suspended and not suspended:
			self.doSuspend(0)

		self.__suspended = suspended
		if changed:
			for s in self.sources:
				s.checkSuspend()

	suspended = property(lambda self: self.__suspended, setSuspend)

	def checkSuspend(self):
		self.suspended = reduce(lambda x, y: x and y.__suspended, self.downstream_elements, True)

	def doSuspend(self, suspend):
		pass

	def destroy(self):
		pass
开发者ID:1198s,项目名称:enigma2,代码行数:85,代码来源:Element.py

示例8: Element

class Element(object):
    CHANGED_DEFAULT = 0
    CHANGED_ALL = 1
    CHANGED_CLEAR = 2
    CHANGED_SPECIFIC = 3
    CHANGED_POLL = 4
    SINGLE_SOURCE = True

    def __init__(self):
        self.downstream_elements = CList()
        self.master = None
        self.sources = []
        self.source = None
        self.__suspended = True
        self.cache = None
        return

    def connectDownstream(self, downstream):
        self.downstream_elements.append(downstream)
        if self.master is None:
            self.master = downstream
        return

    def connectUpstream(self, upstream):
        self.sources.append(upstream)
        self.source = upstream
        self.changed((self.CHANGED_DEFAULT,))

    def connect(self, upstream):
        self.connectUpstream(upstream)
        upstream.connectDownstream(self)

    def disconnectAll(self):
        for s in self.sources:
            s.disconnectDownstream(self)

        if self.source:
            self.destroy()
        self.source = None
        self.sources = []
        return

    def disconnectDownstream(self, downstream):
        self.downstream_elements.remove(downstream)
        if self.master == downstream:
            self.master = None
        if len(self.downstream_elements) == 0:
            self.disconnectAll()
        return

    def changed(self, *args, **kwargs):
        self.cache = {}
        self.downstream_elements.changed(*args, **kwargs)
        self.cache = None
        return

    def setSuspend(self, suspended):
        changed = self.__suspended != suspended
        if not self.__suspended and suspended:
            self.doSuspend(1)
        elif self.__suspended and not suspended:
            self.doSuspend(0)
        self.__suspended = suspended
        if changed:
            for s in self.sources:
                s.checkSuspend()

    suspended = property(lambda self: self.__suspended, setSuspend)

    def checkSuspend(self):
        self.suspended = reduce(lambda x, y: x and y.__suspended, self.downstream_elements, True)

    def doSuspend(self, suspend):
        pass

    def destroy(self):
        pass
开发者ID:kingvuplus,项目名称:boom,代码行数:77,代码来源:Element.py

示例9: __init__

class GUISkin:
    __module__ = __name__

    def __init__(self):
        self['Title'] = StaticText()
        self.onLayoutFinish = []
        self.summaries = CList()
        self.instance = None
        self.desktop = None

    def createGUIScreen(self, parent, desktop, updateonly = False):
        for val in self.renderer:
            if isinstance(val, GUIComponent):
                if not updateonly:
                    val.GUIcreate(parent)
                if not val.applySkin(desktop, self):
                    print 'warning, skin is missing renderer', val, 'in', self

        for key in self:
            val = self[key]
            if isinstance(val, GUIComponent):
                if not updateonly:
                    val.GUIcreate(parent)
                depr = val.deprecationInfo
                if val.applySkin(desktop, self):
                    if depr:
                        print "WARNING: OBSOLETE COMPONENT '%s' USED IN SKIN. USE '%s' INSTEAD!" % (key, depr[0])
                        print 'OBSOLETE COMPONENT WILL BE REMOVED %s, PLEASE UPDATE!' % depr[1]
                elif not depr:
                    print 'warning, skin is missing element', key, 'in', self

        for w in self.additionalWidgets:
            if not updateonly:
                w.instance = w.widget(parent)
            applyAllAttributes(w.instance, desktop, w.skinAttributes, self.scale)

        for f in self.onLayoutFinish:
            if type(f) is not type(self.close):
                exec f in globals(), locals()
            else:
                f()

    def deleteGUIScreen(self):
        for name, val in self.items():
            if isinstance(val, GUIComponent):
                val.GUIdelete()

    def close(self):
        self.deleteGUIScreen()

    def createSummary(self):
        return None

    def addSummary(self, summary):
        self.summaries.append(summary)

    def removeSummary(self, summary):
        self.summaries.remove(summary)

    def setTitle(self, title):
        try:
            if self.instance:
                self.instance.setTitle(title)
            self['Title'].text = title
            self.summaries.setTitle(title)
        except:
            pass

    def getTitle(self):
        return self['Title'].text

    title = property(getTitle, setTitle)

    def setDesktop(self, desktop):
        self.desktop = desktop

    def applySkin(self):
        z = 0
        baseres = (720, 576)
        idx = 0
        skin_title_idx = -1
        title = self.title
        for key, value in self.skinAttributes:
            if key == 'zPosition':
                z = int(value)
            elif key == 'title':
                skin_title_idx = idx
                if title:
                    self.skinAttributes[skin_title_idx] = ('title', title)
                else:
                    self['Title'].text = value
                    self.summaries.setTitle(value)
            elif key == 'baseResolution':
                baseres = tuple([ int(x) for x in value.split(',') ])
            idx += 1

        self.scale = ((baseres[0], baseres[0]), (baseres[1], baseres[1]))
        if not self.instance:
            from enigma import eWindow
            self.instance = eWindow(self.desktop, z)
#.........这里部分代码省略.........
开发者ID:sodo13,项目名称:EG-gui,代码行数:101,代码来源:GUISkin.py

示例10: __init__

	def __init__(self):
		self.onLayoutFinish = [ ]
		self.summaries = CList()
		self.instance = None
		self.desktop = None
开发者ID:kakunbsc,项目名称:enigma2.2,代码行数:5,代码来源:GUISkin.py


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