def __init__(self): self["Title"] = StaticText() self.onLayoutFinish = [ ] self.summaries = CList() self.instance = None self.desktop = None self.screenPathMode = False
def __init__(self): self.downstream_elements = CList() self.master = None self.sources = [ ] self.source = None self.__suspended = True self.cache = None
def __init__(self, session, parent=None, mandatoryWidgets=None): dict.__init__(self) self.skinName = self.__class__.__name__ self.session = session self.parent = parent self.mandatoryWidgets = mandatoryWidgets self.onClose = [] self.onFirstExecBegin = [] self.onExecBegin = [] self.onExecEnd = [] self.onLayoutFinish = [] self.onShown = [] self.onShow = [] self.onHide = [] self.execing = False self.shown = True # DEBUG: Variable already_shown used in CutListEditor/ui.py and StartKodi/plugin.py... # DEBUG: self.alreadyShown = False # Already shown is false until the screen is really shown (after creation). self.already_shown = False # Already shown is false until the screen is really shown (after creation). self.renderer = [] self.helpList = [] # In order to support screens *without* a help, we need the list in every screen. how ironic. self.close_on_next_exec = None # DEBUG: Variable already_shown used in webinterface/src/WebScreens.py... # DEBUG: self.standAlone = False # Stand alone screens (for example web screens) don't care about having or not having focus. self.stand_alone = False # Stand alone screens (for example web screens) don't care about having or not having focus. self.keyboardMode = None self.desktop = None self.instance = None self.summaries = CList() self["Title"] = StaticText() self["ScreenPath"] = StaticText() self.screenPath = "" # This is the current screen path without the title. self.screenTitle = "" # This is the current screen title without the path.
def __init__(self): self["Title"] = StaticText() self["DeveloperTag"] = StaticText() self.onLayoutFinish = [] self.summaries = CList() self.instance = None self.desktop = None
def __init__(self): self['Title'] = StaticText() self.onLayoutFinish = [] self.onAnimationEnd = [] self.summaries = CList() self.instance = None self.desktop = None return
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)
def __init__(self): self["Title"] = StaticText() self["DeveloperTag"] = StaticText() self.onLayoutFinish = [ ] self.summaries = CList() self.instance = None self.desktop = None
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because it does not exist." del self.modes["DVI-PC"] self.createConfig() self.readPreferredModes() # re-define AVSwitch components from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.changedAspect) config.av.wss.addNotifier(self.changedAspect) config.av.policy_169.addNotifier(self.changedAspect) config.av.policy_43.addNotifier(self.changedAspect) # addNotifiers for port, mode, rate config.av.videoport.addNotifier(self.changedVideomode) for port in self.getPortList(): config.av.videomode[port].addNotifier(self.changedVideomode) for mode in self.getModeList(port): config.av.videorate[mode[0]].addNotifier(self.changedVideomode) self.is_init = False
def __init__(self): self.on_hotplug = CList() self.createConfig() # self.on_hotplug.append(self.createConfig) # config.av.colorformat.notifiers = [ ] config.av.aspectratio.notifiers = [ ] config.av.tvsystem.notifiers = [ ] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect) config.pc.image4_3_zoom_x.addNotifier(self.updateAspect) config.pc.image4_3_zoom_y.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.pc.image16_9_zoom_x.addNotifier(self.updateAspect) config.pc.image16_9_zoom_y.addNotifier(self.updateAspect) config.av.deinterlace = ConfigSelection(choices = {"0": _("Off"), "1": _("On")}, default="0") config.av.deinterlace_sd = ConfigSelection(choices = self.deinterlace_modes, default="4") config.av.deinterlace_hd = ConfigSelection(choices = self.deinterlace_modes, default="3") config.av.deinterlace.addNotifier(self.updateDeinterlace) config.av.deinterlace_sd.addNotifier(self.updateDeinterlace) config.av.deinterlace_hd.addNotifier(self.updateDeinterlace) config.pc.sd_sharpness = ConfigSelection(choices = {"0": _("Off"), "1": _("On")}, default="0") config.pc.sd_noise = ConfigSelection(choices = {"0": _("Off"), "1": _("On")}, default="0") config.pc.sd_sharpness.addNotifier(self.updateSDfeatures) config.pc.sd_noise.addNotifier(self.updateSDfeatures)
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] self.createConfig() # self.on_hotplug.append(self.createConfig) self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch # config.av.colorformat.notifiers = [ ] config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if getBoxType() == 'et4x00' or getBoxType() == 'xp1000' or getBoxType( ) == 'tm2t' or getBoxType() == 'tmsingle' or getBoxType() == 'odimm7': del self.modes["YPbPr"] if getBoxType() == 'gbquad' or getBoxType() == 'et5x00' or getBoxType( ) == 'ixussone': del self.modes["Scart"] self.createConfig() self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if boxtype in ('et4x00', 'xp1000', 'tm2t', 'tmsingle', 'vusolo2', 'tmnano', 'iqonios300hd', 'odinm7', 'e3hd', 'dm500hdv2', 'dm500hd', 'dm800', 'ebox7358', 'eboxlumi', 'ebox5100', 'ixusszero', 'optimussos1') or (about.getModelString() == 'ini-3000'): del self.modes["YPbPr"] if hw_type in ('elite', 'premium', 'premium+', 'ultra', "me", "minime"): self.readPreferredModes() self.createConfig() self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.last_modes_preferred = [ ] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() self.is24hzAvailable() self.widescreen_modes = set(["720p", "1080i", "1080p", "2160p", "2160p30"]).intersection(*[self.modes_available]) if "DVI-PC" in self.modes and not self.getModeList("DVI-PC"): print "[VideoHardware] remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if "Scart" in self.modes and not self.getModeList("Scart"): print "[VideoHardware] remove Scart because of not existing modes" del self.modes["Scart"] self.createConfig() self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [ ] config.av.tvsystem.notifiers = [ ] config.av.wss.notifiers = [ ] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): config.av.edid_override = ConfigYesNo(default = False) self.__initInternalValues() self.last_modes_preferred = [ ] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] self.createConfig() # self.on_hotplug.append(self.createConfig) self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch # config.av.colorformat.notifiers = [ ] config.av.aspectratio.clearNotifiers() config.av.tvsystem.clearNotifiers() config.av.wss.clearNotifiers() AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) if SystemInfo["AnalogOutput"]: config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect) self.setConfiguredMode()
def __init__(self): self['Title'] = StaticText() self.onLayoutFinish = [] self.summaries = CList() self.instance = None self.desktop = None return
def __init__(self): self.hdd = [] self.cd = "" self.partitions = [] self.devices_scanned_on_init = [] self.on_partition_list_change = CList() self.enumerateBlockDevices() # currently, this is just an enumeration of what's possible, # this probably has to be changed to support automount stuff. # still, if stuff is mounted into the correct mountpoints by # external tools, everything is fine (until somebody inserts # a second usb stick.) p = [("/media/hdd", _("Harddisk")), ("/media/hdd1", _("Harddisk") + _(" 1")), ("/media/hdd2", _("Harddisk") + _(" 2")), ("/media/hdd3", _("Harddisk") + _(" 3")), ("/media/card", _("Card")), ("/media/cf", _("Compact Flash")), ("/media/mmc1", _("MMC Card")), ("/media/net", _("Network Mount")), ("/media/net/autofs", _("Network Mount") + " (autofs)"), ("/media/ram", _("Ram Disk")), ("/media/usb", _("USB Stick")), ("/media/usb1", _("USB Stick") + _(" 1")), ("/media/usb2", _("USB Stick") + _(" 2")), ("/media/usb3", _("USB Stick") + _(" 3")), ("/media/upnp", _("UPNP")), ("/", _("Internal Flash"))] self.partitions.extend( [Partition(mountpoint=x[0], description=x[1]) for x in p])
def __init__(self): self.hdd = [] self.cd = "" self.partitions = [] self.devices_scanned_on_init = [] self.on_partition_list_change = CList() self.enumerateBlockDevices() # Find stuff not detected by the enumeration p = (("/media/hdd", _("Hard disk")), ("/media/card", _("Card")), ("/media/cf", _("Compact flash")), ("/media/mmc", _("MMC card")), ("/media/net", _("Network mount")), ("/media/net1", _("Network mount %s") % ("1")), ("/media/net2", _("Network mount %s") % ("2")), ("/media/net3", _("Network mount %s") % ("3")), ("/media/ram", _("Ram disk")), ("/media/usb", _("USB stick")), ("/", _("Internal flash"))) known = set([ os.path.normpath(a.mountpoint) for a in self.partitions if a.mountpoint ]) for m, d in p: if (m not in known) and os.path.ismount(m): self.partitions.append(Partition(mountpoint=m, description=d))
def __init__(self): self.hdd = [] self.partitions = [] self.cd = "" self.on_partition_list_change = CList() self.enumerateBlockDevices() self.enumerateNetworkMounts()
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() self.createConfig() self.readPreferredModes()
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() self.widescreen_modes = set( ["720p", "1080i", "1080p", "2160p", "2160p30"]).intersection(*[self.modes_available]) if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "[VideoHardware] remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if self.modes.has_key("Scart") and not self.getModeList("Scart"): print "[VideoHardware] remove Scart because of not existing modes" del self.modes["Scart"] self.createConfig() self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect #+++> config.av.colorformat_hdmi = ConfigSelection(choices={ "hdmi_rgb": _("RGB"), "hdmi_yuv": _("YUV"), "hdmi_422": _("422") }, default="hdmi_rgb") config.av.colorformat_yuv = ConfigSelection(choices={"yuv": _("YUV")}, default="yuv") config.av.hdmi_audio_source = ConfigSelection(choices={ "pcm": _("PCM"), "spdif": _("SPDIF") }, default="pcm") config.av.threedmode = ConfigSelection(choices={ "off": _("Off"), "sbs": _("Side by Side"), "tab": _("Top and Bottom") }, default="off") config.av.threedmode.addNotifier(self.set3DMode) config.av.colorformat_hdmi.addNotifier(self.setHDMIColor) config.av.colorformat_yuv.addNotifier(self.setYUVColor) config.av.hdmi_audio_source.addNotifier(self.setHDMIAudioSource) #+++< config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
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)
def __init__(self): self.hdd = [] self.cd = '' self.partitions = [] self.devices_scanned_on_init = [] self.on_partition_list_change = CList() self.enumerateBlockDevices() self.enumerateNetworkMounts() p = [('/', _('Internal flash'))] self.partitions.extend([ Partition(mountpoint=x[0], description=x[1]) for x in p ])
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if getBoxType() == 'et4x00' or getBoxType() == 'xp1000' or getBoxType( ) == 'iqonios300hd' or getBoxType() == 'tm2t' or getBoxType( ) == 'tmsingle' or getBoxType() == 'tmnano' or getBoxType( ) == 'odimm7' or model == 'ini-3000' or getBoxType( ) == 'vusolo2' or getBoxType() == 'e3hd' or getBoxType( ) == 'dm500hd' or getBoxType() == 'dm800' or getBoxType( ) == 'ebox7358' or getBoxType() == 'ebox5100' or getBoxType( ) == 'ixusszero': del self.modes["YPbPr"] if getBoxType() == 'gbquad' or getBoxType( ) == 'et5x00' or model == 'et6000' or getBoxType( ) == 'e3hd' or getBoxType() == 'odinm6' or getBoxType( ) == 'ebox7358' or getBoxType( ) == 'tmnano' or self.hw_type == 'ultra' or self.hw_type == "me" or self.hw_type == "minime": del self.modes["Scart"] if self.hw_type == 'elite' or self.hw_type == 'premium' or self.hw_type == 'premium+' or self.hw_type == 'ultra' or self.hw_type == "me" or self.hw_type == "minime": self.readPreferredModes() self.createConfig() self.readPreferredModes() portlist = self.getPortList() has1080p50 = False for port in portlist: if port == 'DVI' and HardwareInfo().has_hdmi(): if "1080p50" in self.modes_available: has1080p50 = True if has1080p50: self.widescreen_modes = set(["720p", "1080i", "1080p"]) else: self.widescreen_modes = set(["720p", "1080i"]) # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.hdd = [ ] self.cd = "" self.partitions = [ ] self.devices_scanned_on_init = [ ] self.on_partition_list_change = CList() self.enumerateBlockDevices() self.enumerateNetworkMounts() # Find stuff not detected by the enumeration p = [("/", _("Internal flash"))] self.partitions.extend([ Partition(mountpoint = x[0], description = x[1]) for x in p ])
def __init__(self): self.hdd = [] self.cd = "" # Partitions should always have a trailing / self.partitions = [] self.volume_labels = VolumeLabels() self.devices_scanned_on_init = [] self.on_partition_list_change = CList() self.enumerateBlockDevices() # Find stuff not detected by the enumeration self.enumerateNetworkMounts() # Find stuff not detected by the enumeration p = [("/", _("Internal Flash")), ("/media/upnp/", _("DLNA")), ] self.partitions.extend([Partition(mountpoint=x[0], description=x[1], shortdescription=x[1]) for x in p])
def __init__(self, name): self.tasks = [] self.resident_tasks = [] self.workspace = "/tmp" self.current_task = 0 self.callback = None self.name = name self.finished = False self.end = 100 self.__progress = 0 self.weightScale = 1 self.afterEvent = None self.state_changed = CList() self.status = self.NOT_STARTED self.onSuccess = None
def __init__(self): self.hdd = [] self.cd = "" self.partitions = [] self.devices_scanned_on_init = [] self.on_partition_list_change = CList() self.enumerateBlockDevices() # Find stuff not detected by the enumeration p = [("/", _("Internal Flash"))] try: netmount = listdir('/media/net') for fil in netmount: p.append(('/media/net/' + fil, fil)) except: pass self.partitions.extend( [Partition(mountpoint=x[0], description=x[1]) for x in p])
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if getBoxType() == 'et4x00' or getBoxType() == 'xp1000' or getBoxType( ) == 'iqonios300hd' or getBoxType() == 'tm2t' or getBoxType( ) == 'tmsingle' or getBoxType() == 'tmnano' or getBoxType( ) == 'odimm7' or model == 'ini-3000' or getBoxType( ) == 'vusolo2' or getBoxType() == 'e3hd' or getBoxType( ) == 'dm500hd' or getBoxType() == 'dm800' or getBoxType( ) == 'ebox7358' or getBoxType() == 'ebox5100' or getBoxType( ) == 'ixusszero' or getBoxType() == 'optimussos1': del self.modes["YPbPr"] if getBoxType() == 'gbquad' or getBoxType( ) == 'et5x00' or model == 'et6000' or getBoxType( ) == 'e3hd' or getBoxType() == 'odinm6' or getBoxType( ) == 'ebox7358' or getBoxType( ) == 'tmnano' or self.hw_type == 'ultra' or self.hw_type == "me" or self.hw_type == "minime" or getBoxType( ) == 'optimussos1' or getBoxType() == 'optimussos2': del self.modes["Scart"] if self.hw_type == 'elite' or self.hw_type == 'premium' or self.hw_type == 'premium+' or self.hw_type == 'ultra' or self.hw_type == "me" or self.hw_type == "minime": self.readPreferredModes() self.createConfig() self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] if getBoxType() == 'e3hd' or getBoxType() == 'odinm7': del self.modes["YPbPr"] if getBoxType() == 'e3hd': del self.modes["Scart"] self.createConfig() self.readPreferredModes() portlist = self.getPortList() has1080p50 = False for port in portlist: if port == 'DVI' and HardwareInfo().has_hdmi(): if "1080p50" in self.modes_available: has1080p50 = True if has1080p50: self.widescreen_modes = set(["720p", "1080i", "1080p"]) else: self.widescreen_modes = set(["720p", "1080i"]) # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.last_modes_preferred = [] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() self.readPreferredModes() if "DVI-PC" in self.modes and not self.getModeList("DVI-PC"): print( "[Videomode] VideoHardware remove DVI-PC because of not existing modes" ) del self.modes["DVI-PC"] if "Scart" in self.modes and not self.getModeList("Scart"): print( "[Videomode] VideoHardware remove Scart because of not existing modes" ) del self.modes["Scart"] if "YPbPr" in self.modes and not has_yuv: del self.modes["YPbPr"] if "Scart" in self.modes and not has_scart and (has_rca or has_avjack): modes["RCA"] = modes["Scart"] del self.modes["Scart"] if "Scart" in self.modes and not has_rca and not has_scart and not has_avjack: del self.modes["Scart"] self.createConfig() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch config.av.aspectratio.notifiers = [] config.av.tvsystem.notifiers = [] config.av.wss.notifiers = [] AVSwitch.getOutputAspect = self.getOutputAspect config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.hdd = [] self.cd = '' self.partitions = [] self.devices_scanned_on_init = [] self.on_partition_list_change = CList() self.enumerateBlockDevices() p = (('/media/hdd', _('Hard disk')), ('/media/card', _('Card')), ('/media/cf', _('Compact flash')), ('/media/mmc1', _('MMC card')), ('/media/net', _('Network mount')), ('/media/net1', _('Network mount %s') % '1'), ('/media/net2', _('Network mount %s') % '2'), ('/media/net3', _('Network mount %s') % '3'), ('/media/ram', _('Ram disk')), ('/media/usb', _('USB stick')), ('/', _('Internal flash'))) known = set([ os.path.normpath(a.mountpoint) for a in self.partitions if a.mountpoint ]) for m, d in p: if m not in known and os.path.ismount(m): self.partitions.append(Partition(mountpoint=m, description=d))
def __init__(self): self.last_modes_preferred = [ ] self.on_hotplug = CList() self.current_mode = None self.current_port = None self.readAvailableModes() if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"): print "remove DVI-PC because of not existing modes" del self.modes["DVI-PC"] self.createConfig() # self.on_hotplug.append(self.createConfig) self.readPreferredModes() # take over old AVSwitch component :) from Components.AVSwitch import AVSwitch # config.av.colorformat.notifiers = [ ] config.av.aspectratio.notifiers = [ ] config.av.tvsystem.notifiers = [ ] config.av.wss.notifiers = [ ] AVSwitch.getOutputAspect = self.getOutputAspect #+++> config.av.colorformat_hdmi = ConfigSelection(choices = {"hdmi_rgb": _("RGB"), "hdmi_yuv": _("YUV"), "hdmi_422": _("422")}, default="hdmi_rgb") config.av.colorformat_yuv = ConfigSelection(choices = {"yuv": _("YUV")}, default="yuv") # config.av.hdmi_audio_source = ConfigSelection(choices = {"pcm": _("PCM"), "spdif": _("SPDIF"), "8ch": _("8Ch"), "none": _("None")}, default="pcm") config.av.hdmi_audio_source = ConfigSelection(choices = {"pcm": _("PCM"), "spdif": _("SPDIF")}, default="pcm") #+++< config.av.colorformat_hdmi.addNotifier(self.setHDMIColor) config.av.colorformat_yuv.addNotifier(self.setYUVColor) config.av.hdmi_audio_source.addNotifier(self.setHDMIAudioSource) config.av.aspect.addNotifier(self.updateAspect) config.av.wss.addNotifier(self.updateAspect) config.av.policy_169.addNotifier(self.updateAspect) config.av.policy_43.addNotifier(self.updateAspect)
def __init__(self): self.onLayoutFinish = [ ] self.summaries = CList() self.instance = None self.desktop = None
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 "[GUISkin] 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 "[GUISkin] WARNING: OBSOLETE COMPONENT '%s' USED IN SKIN. USE '%s' INSTEAD!" % (key, depr[0]) print "[GUISkin] OBSOLETE COMPONENT WILL BE REMOVED %s, PLEASE UPDATE!" % (depr[1]) elif not depr: print "[GUISkin] 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): 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) # 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": 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) if skin_title_idx == -1 and title: self.skinAttributes.append(("title", title)) # we need to make sure that certain attributes come last self.skinAttributes.sort(key=lambda a: {"position": 1}.get(a[0], 0)) applyAllAttributes(self.instance, self.desktop, self.skinAttributes, self.scale) self.createGUIScreen(self.instance, self.desktop)
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) if skin_title_idx == -1 and title: self.skinAttributes.append(('title', title)) self.skinAttributes.sort(key=lambda a: {'position': 1}.get(a[0], 0)) applyAllAttributes(self.instance, self.desktop, self.skinAttributes, self.scale) self.createGUIScreen(self.instance, self.desktop)
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 self.scale = ((baseres[0], baseres[0]), (baseres[1], baseres[1])) if not self.instance: from enigma import eWindow self.instance = eWindow(self.desktop, z) if skin_title_idx == -1 and title: self.skinAttributes.append(("title", title)) # we need to make sure that certain attributes come last self.skinAttributes.sort(key=lambda a: {"position": 1}.get(a[0], 0)) applyAllAttributes(self.instance, self.desktop, self.skinAttributes, self.scale) self.createGUIScreen(self.instance, self.desktop)
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
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