def loadEnigmalightSkin(): """ loads the corresponding skin.xml file @param: none @return none """ width = getDesktop(0).size().width() height = getDesktop(0).size().height() skin = "/usr/lib/enigma2/python/Plugins/Extensions/EnigmaLight/skins/default/skin-hd.xml" #load fullhd skin when fullhd framebuffer is used. if width > 1280 and height > 720: skin = "/usr/lib/enigma2/python/Plugins/Extensions/EnigmaLight/skins/default/skin-fullhd.xml" if skin: loadSkin(skin) EnigmaLight_log("",None,"__common__::loadEnigmalightSkin() > Load Skin: " + skin) if skin: try: loadSkin(skin) except: from traceback import format_exc EnigmaLight_log("",None,"__common__::loadEnigmalightSkin > ERROR: " +format_exc() ) try: open(getCrashFilePath(),"w").write(format_exc()) except: pass
def load_skin(): try: from enigma import getDesktop desktop_width = getDesktop(0).size().width() log.logDebug("Screen width %s px"%desktop_width) if desktop_width >= 1280: if DMM_IMAGE: if desktop_width == 1920: skin_default_path = os.path.join(settings.SKIN_PATH, "default_dmm_fhd.xml") elif desktop_width == 3840: skin_default_path = os.path.join(settings.SKIN_PATH, "default_dmm_uhd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_dmm_hd.xml") else: if desktop_width == 1920: skin_default_path = os.path.join(settings.SKIN_PATH, "default_fhd.xml") elif desktop_width == 3840: skin_default_path = os.path.join(settings.SKIN_PATH, "default_uhd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_hd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_sd.xml") skin_name = config.plugins.archivCZSK.skin.value skin_path = os.path.join(settings.SKIN_PATH, skin_name + ".xml") if skin_name == 'auto' or not os.path.isfile(skin_path): skin_path = skin_default_path log.info("loading skin %s" % skin_path) log.logDebug("loading skin %s" % skin_path) loadSkin(skin_path) except: log.logError("Load plugin skin failed.\n%s"%traceback.format_exc()) pass
def loadSkinReal(skinPath): if os.path.exists(skinPath): print "[Widgets] Loading skin ", skinPath for skin in dom_skins: print "skin",skin if skin[0] == skinPath.replace("skin.xml",""): dom_skins.remove(skin) loadSkin(skinPath)
def load_skin(): from enigma import getDesktop if getDesktop(0).size().width() >= 1280: skin_default_path = os.path.join(settings.SKIN_PATH, "default_hd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_sd.xml") skin_name = config.plugins.archivCZSK.skin.value skin_path = os.path.join(settings.SKIN_PATH, skin_name+".xml") if not os.path.isfile(skin_path): log.error("skin '%s' doesn't exist"% skin_path) skin_path = skin_default_path log.info("loading skin %s" % skin_path) loadSkin(skin_path)
def loadPlexSkin(): """ loads the corresponding skin.xml file @param: none @return none """ printl2("", "__common__::loadPlexSkin", "S") currentSkin = getSkinFolder() + "/skin.xml" loadSkin(currentSkin) printl2("", "__common__::loadPlexSkin", "C")
def writeSkinFile(self, skinType=None , screenName = None, filename = None): if filename is None: self.session.openWithCallback(self.doNothing, MessageBox,_("Filename not selected, skin won't be saved!"), type = MessageBox.TYPE_INFO, timeout = 10, default = False) return elif filename[1] != '/': if not filename.startswith('skin_'): filename = 'skin_' + filename if not filename.endswith('.xml'): filename += '.xml' filename = '%sallScreens/LCD/%s' % (SkinPath, filename) if not fileExists('%sallScreens' % (SkinPath)): os.mkdir('%sallScreens' % (SkinPath)) if not fileExists('%sallScreens/LCD' % (SkinPath)): os.mkdir('%sallScreens/LCD' % (SkinPath)) screenPart = "" #screenPart += '\n<screen name="%s" position="0,0" size="%s,%s" id="%s">\n' % ( screenName, self.LCDwidth, self.LCDheight, self.desktopID ) screenPart += '\n<screen name="%s" position="0,0" size="%s,%s">\n' % ( screenName, self.LCDwidth, self.LCDheight ) for widget in self.WidgetsDict: if self.WidgetsDict[widget]['widgetActiveState'] == '': print "Write %s Widget to SkinFile" % (widget) screenPart += self.WidgetsDict[widget]['widgetXML'] + '\n' screenPart += '</screen>\n' if fileExists(filename): with open(filename, 'r') as f: skinBase = f.read() f.close() else: skinBase = '<skin>\n</skin>\n' if re.search(screenName, skinBase, re.S|re.I): pattern = re.compile('<screen name="'+screenName+'" position="0,0" size="480,320" id="1">(.*?)</screen>', re.S|re.I) skinFile = re.sub(pattern, screenPart, skinBase) else: #pattern = re.compile('<screen name="'+screenName+'" position="0,0" size="480,320" id="1">(.*?)</screen>', re.S|re.I) skinFile = re.sub('</skin>', screenPart+'\n</skin>', skinBase) with open(filename, 'w') as f: f.write(skinFile) f.close() skin.loadSkin(filename) if skinType == 'UserSkin': restartbox = self.session.openWithCallback(self.doNothing,MessageBox,_("Skin has been written in .../LCD folder\nActivate it in UserSkin:\n'Skin personalization/UserSkin additional screens'"), MessageBox.TYPE_INFO) elif myLCDconfig.value == self.vfdSkinFileName: restartbox = self.session.openWithCallback(self.restartGUI,MessageBox,_("GUI needs a restart to apply a new skin\nDo you want to Restart the GUI now?"), MessageBox.TYPE_YESNO) restartbox.setTitle(_("Restart GUI now?")) else: restartbox = self.session.openWithCallback(self.doNothing,MessageBox,_("Skin has been written.\nAcrivate it in Menu/System/"), MessageBox.TYPE_INFO)
def loadPlexSkin(): """ loads the corresponding skin.xml file @param: none @return none """ printl2("", "__common__::loadPlexSkin", "S") printl2("current skin: " + str(config.plugins.dreamplex.skin.value), "__common__::loadPlexSkin", "S") skin = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skins/" + config.plugins.dreamplex.skin.value + "/skin.xml" if skin: loadSkin(skin) printl2("", "__common__::loadPlexSkin", "C")
def __init__(self, session, args=0): self.session = session Screen.__init__(self, session) ### Edit By RAED To FHD Skin if isHD(): skin = loadSkin(PLUGIN_PATH + '/skin.xml') else: if DreamOS(): skin = loadSkin(PLUGIN_PATH + '/skinfhdOS.xml') else: skin = loadSkin(PLUGIN_PATH + '/skinfhd.xml') ### End self.menu = args self.session = session self.loop = eTimer() ### Edit By RAED To DreamOS try: self.loop.callback.append(self.ExecTest) except: self.loop_conn = self.loop.timeout.connect(self.ExecTest)
def load_skin(): try: from enigma import getDesktop desktop_width = getDesktop(0).size().width() log.logDebug("Screen width %s px" % desktop_width) if desktop_width >= 1280: if DMM_IMAGE: if desktop_width == 1920: skin_default_path = os.path.join( settings.SKIN_PATH, "default_dmm_fhd.xml") elif desktop_width == 3840: skin_default_path = os.path.join( settings.SKIN_PATH, "default_dmm_uhd.xml") else: skin_default_path = os.path.join( settings.SKIN_PATH, "default_dmm_hd.xml") else: if desktop_width == 1920: skin_default_path = os.path.join( settings.SKIN_PATH, "default_fhd.xml") elif desktop_width == 3840: skin_default_path = os.path.join( settings.SKIN_PATH, "default_uhd.xml") else: skin_default_path = os.path.join( settings.SKIN_PATH, "default_hd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_sd.xml") skin_name = config.plugins.archivCZSK.skin.value skin_path = os.path.join(settings.SKIN_PATH, skin_name + ".xml") if skin_name == 'auto' or not os.path.isfile(skin_path): skin_path = skin_default_path log.info("loading skin %s" % skin_path) log.logDebug("loading skin %s" % skin_path) loadSkin(skin_path) except: log.logError("Load plugin skin failed.\n%s" % traceback.format_exc()) pass
def loadPvmcSkin(): ''' loads depending on the desktop size the corresponding skin.xml file @param: none @return none ''' printl2("", "__common__::loadPlexSkin", "S") skin = None desktop = getDesktop(0).size().width() if desktop == 720: skin = "/usr/lib/enigma2/python/Plugins/Extensions/PVMC/skins/blackDon/720x576/skin.xml" elif desktop == 1024: skin = "/usr/lib/enigma2/python/Plugins/Extensions/PVMC/skins/blackDon/1024x576/skin.xml" elif desktop == 1280: skin = "/usr/lib/enigma2/python/Plugins/Extensions/PVMC/skins/blackDon/1280x720/skin.xml" if skin: loadSkin(skin) printl2("", "__common__::loadPlexSkin", "C")
def loadPlexSkin(): ''' loads depending on the desktop size the corresponding skin.xml file @param: none @return none ''' printl2("", "__common__::loadPlexSkin", "S") skin = None desktop = getDesktop(0).size().width() if desktop == 720: skin = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skins/blackDon/720x576/skin.xml" elif desktop == 1024: skin = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skins/blackDon/1024x576/skin.xml" elif desktop == 1280: skin = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skins/blackDon/1280x720/skin.xml" if skin: loadSkin(skin) printl2("", "__common__::loadPlexSkin", "C")
def load_skin(): from enigma import getDesktop desktop_width = getDesktop(0).size().width() if desktop_width >= 1280: # dm7080 hd DMM image is using dpkg as package manager, other images don't try: from enigma import eTimer eTimer().connect skin_default_path = os.path.join(settings.SKIN_PATH, "default_dmm_hd.xml") except Exception as e: print e if desktop_width == 1920: skin_default_path = os.path.join(settings.SKIN_PATH, "default_fhd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_hd.xml") else: skin_default_path = os.path.join(settings.SKIN_PATH, "default_sd.xml") skin_name = config.plugins.archivCZSK.skin.value skin_path = os.path.join(settings.SKIN_PATH, skin_name + ".xml") if skin_name == 'auto' or not os.path.isfile(skin_path): skin_path = skin_default_path log.info("loading skin %s" % skin_path) loadSkin(skin_path)
from Components.ActionMap import ActionMap from Components.MenuList import MenuList from Components.Pixmap import Pixmap from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest from enigma import * import sys, os from .Config import * from skin import loadSkin from enigma import getDesktop if getDesktop(0).size().width() == 1920: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/GioppyGio/Skin/skinFHD.xml" ) giopath = '/usr/lib/enigma2/python/Plugins/Extensions/GioppyGio/Panel/' else: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/GioppyGio/Skin/skinhd.xml") giopath = '/usr/lib/enigma2/python/Plugins/Extensions/GioppyGio/Panel/default/' class MenuListSelect(MenuList): def __init__(self, list, enableWrapAround=True): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) screenwidth = getDesktop(0).size().width() if screenwidth and screenwidth == 1920: self.l.setFont(0, gFont('Regular', 32))
from Components.Pixmap import Pixmap from Components.Label import Label from skin import loadSkin from Components.AVSwitch import AVSwitch plugin_path = '/usr/lib/enigma2/python/Plugins/Extensions/InternetSpeedTest/speedtest.py' font = resolveFilename(SCOPE_PLUGINS, "Extensions/InternetSpeedTest/fonts") skin_path = resolveFilename(SCOPE_PLUGINS, "Extensions/InternetSpeedTest/") cmd = 'python ' + plugin_path + ' --no-pre-allocate --share' png_tmp = '/tmp/speedtest.png' if path.exists(plugin_path): chmod(plugin_path, 0o755) HD = getDesktop(0).size() if HD.width() > 1280: loadSkin(skin_path + 'speedtest_fhd.xml') else: loadSkin(skin_path + 'speedtest_hd.xml') PluginLanguageDomain = "speedtest" PluginLanguagePath = "Extensions/InternetSpeedTest/locale" def localeInit(): lang = language.getLanguage()[:2] environ["LANGUAGE"] = lang gettext.bindtextdomain(PluginLanguageDomain, PluginLanguagePath) gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
default="EN", choices=[("EN", _("English"))]) config.plugins.EVOMC_globalsettings.showinmainmenu = ConfigYesNo(default=True) config.plugins.EVOMC_globalsettings.showinextmenu = ConfigYesNo(default=True) config.plugins.EVOMC_globalsettings.currentversion = ConfigInteger(0, (0, 999)) config.plugins.EVOMC_globalsettings.currentplatform = ConfigText( default=currentmcplatform) config.plugins.EVOMC_globalsettings.dst_top = ConfigInteger(0, (0, 999)) config.plugins.EVOMC_globalsettings.dst_left = ConfigInteger(0, (0, 999)) config.plugins.EVOMC_globalsettings.dst_width = ConfigInteger(720, (1, 720)) config.plugins.EVOMC_globalsettings.dst_height = ConfigInteger(576, (1, 576)) config.plugins.EVOMC_globalsettings.currentversion.value = currentmcversion config.plugins.EVOMC_globalsettings.currentplatform.value = currentmcplatform sz_w = getDesktop(0).size().width() if sz_w == 1280: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic/skin_hd.xml" ) if sz_w == 720: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic/skin_sd.xml" ) if sz_w == 1024: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic/skin_md.xml" ) def addFavoriteFolders(): i = len(config.plugins.EVOMC_favorites.folders) config.plugins.EVOMC_favorites.folders.append(ConfigSubsection()) config.plugins.EVOMC_favorites.folders[i].name = ConfigText("", False)
from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE from os import environ as os_environ import gettext from skin import loadSkin loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/EnhancedMovieCenter/CoolSkin/EMCMediaCenter_LCD.xml") def localeInit(): lang = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country" os_environ["LANGUAGE"] = lang # Enigma doesn't set this (or LC_ALL, LC_MESSAGES, LANG). gettext needs it! gettext.bindtextdomain("EnhancedMovieCenter", resolveFilename(SCOPE_PLUGINS, "Extensions/EnhancedMovieCenter/locale")) _ = lambda txt: gettext.dgettext("EnhancedMovieCenter", txt) if txt else "" localeInit() language.addCallback(localeInit)
config.plugins.EVOMC_favorites.foldercount = ConfigInteger(0) config.plugins.EVOMC_favorites.folders = ConfigSubList() config.plugins.EVOMC_globalsettings = ConfigSubsection() config.plugins.EVOMC_globalsettings.language = ConfigSelection(default="EN", choices = [("EN", _("English"))]) config.plugins.EVOMC_globalsettings.showinmainmenu = ConfigYesNo(default=True) config.plugins.EVOMC_globalsettings.showinextmenu = ConfigYesNo(default=True) config.plugins.EVOMC_globalsettings.currentversion = ConfigInteger(0, (0, 999)) config.plugins.EVOMC_globalsettings.currentplatform = ConfigText(default = currentmcplatform) config.plugins.EVOMC_globalsettings.dst_top = ConfigInteger(0, (0, 999)) config.plugins.EVOMC_globalsettings.dst_left = ConfigInteger(0, (0, 999)) config.plugins.EVOMC_globalsettings.dst_width = ConfigInteger(720, (1, 720)) config.plugins.EVOMC_globalsettings.dst_height = ConfigInteger(576, (1, 576)) config.plugins.EVOMC_globalsettings.currentversion.value = currentmcversion config.plugins.EVOMC_globalsettings.currentplatform.value = currentmcplatform sz_w = getDesktop(0).size().width() if sz_w == 1280: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic/skin_hd.xml") if sz_w == 720: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic/skin_sd.xml") if sz_w == 1024: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic/skin_md.xml") def addFavoriteFolders(): i = len(config.plugins.EVOMC_favorites.folders) config.plugins.EVOMC_favorites.folders.append(ConfigSubsection()) config.plugins.EVOMC_favorites.folders[i].name = ConfigText("", False) config.plugins.EVOMC_favorites.folders[i].basedir = ConfigText("/", False) config.plugins.EVOMC_favorites.foldercount.value = i+1 return i for i in range(0, config.plugins.EVOMC_favorites.foldercount.value): addFavoriteFolders()
from Screens.MessageBox import MessageBox from Screens.Standby import TryQuitMainloop from __init__ import _ import os import commands from enigma import getDesktop from boxbranding import getMachineName, getMachineBrand from Screens.InputBox import PinInput from Tools.BoundFunction import boundFunction config.plugins.mc_global = ConfigSubsection() config.plugins.mc_global.vfd = ConfigSelection(default='off', choices=[('off', 'off'), ('on', 'on')]) config.plugins.mc_globalsettings.upnp_enable = ConfigYesNo(default=False) #change to FullHD if getDesktop(0).size().width() == 1920: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/defaultHD/skinHD.xml") else: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/defaultHD/skin.xml") #try: # from enigma import evfd # config.plugins.mc_global.vfd.value = 'on' # config.plugins.mc_global.save() #except Exception as e: # print 'Media Center: Import evfd failed' try: from Plugins.Extensions.DVDPlayer.plugin import * dvdplayer = True except: print "Media Center: Import DVDPlayer failed" dvdplayer = False
def __init__(self, session): self.session = session Screen.__init__(self, session) ### EDit By RAED To DreamOS OE2.5/2.6 if DreamOS(): self.wget = "/usr/bin/wget2 --no-check-certificate" else: self.wget = "/usr/bin/wget" if isHD(): skin = loadSkin(PLUGIN_PATH + '/skin.xml') else: if DreamOS(): skin = loadSkin(PLUGIN_PATH + '/skinfhdOS.xml') else: skin = loadSkin(PLUGIN_PATH + '/skinfhd.xml') ### End self.onChangedEntry = [] self.list = [] ConfigListScreen.__init__(self, self.list, session=self.session, on_change=self.changedEntry) ### EDit By RAED To Add privet keymap.xml self["actions"] = HelpableActionMap( self, "FreeServerminoActions", { 'menu': self.KeyMenu, 'info': self.KeyInfo, 'blue': self.KeyBlue, 'yellow': self.KeyYellow, 'green': self.keySave, 'red': self.keyClose, 'cancel': self.keyClose, 'ok': self.keySave, 'left': self.keyLeft, 'right': self.keyRight }, -1) ### End try: fp = urllib.urlopen(xml_path) count = 0 self.labeltext = '' s1 = fp.readline() s2 = fp.readline() s3 = fp.readline() s1 = s1.strip() s2 = s2.strip() s3 = s3.strip() self.link = s2 self.version = s1 self.info = s3 fp.close() cstr = s1 + ' ' + s2 if s1 <= currversion: self.update = False else: self.update() except: if self.update == False: return self.__changed = self.changedEntry self['Box_1'] = Label('FreeServer V_' + version) self['Box_2'] = Label(line) self['Box_3'] = Label() self['Box_4'] = Label() self['text'] = Label('') self['logo'] = Pixmap() self['aime'] = Pixmap() self['logo'].hide() self['Box_2'].hide() self['Box_4'].setText('Last Update Servers ' + ImportWritetimes()) self['text'].hide() self['aime'].hide() self.showhide = False config.plugins.FreeServerminoo.Updattime.value = self.Verif_1( config.plugins.FreeServerminoo.Updattime.value) self.runSetup()
from Components.ConfigList import ConfigList from Components.config import * from skin import loadSkin from Components.Label import Label from Screens.Screen import Screen from Components.Pixmap import Pixmap from Plugins.Plugin import PluginDescriptor from Tools.Directories import pathExists, fileExists from __init__ import _ import os import commands config.plugins.mc_global = ConfigSubsection() config.plugins.mc_global.vfd = ConfigSelection(default='off', choices=[('off', 'off'), ('on', 'on')]) config.plugins.mc_globalsettings.upnp_enable = ConfigYesNo(default=False) loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/defaultHD/skin.xml") #try: # from enigma import evfd # config.plugins.mc_global.vfd.value = 'on' # config.plugins.mc_global.save() #except Exception as e: # print 'Media Center: Import evfd failed' try: from Plugins.Extensions.DVDPlayer.plugin import * dvdplayer = True except: print "Media Center: Import DVDPlayer failed" dvdplayer = False mcpath = '/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/defaultHD/images/'
from Components.Label import Label from Components.ServiceEventTracker import ServiceEventTracker from Components.Sources.List import List from Screens.ChoiceBox import ChoiceBox from Components.Sources.StaticText import StaticText from Screens.InfoBarGenerics import InfoBarServiceErrorPopupSupport, InfoBarGstreamerErrorPopupSupport, InfoBarStateInfo from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Screens.ServiceStopScreen import ServiceStopScreen from Tools.NumericalTextInput import NumericalTextInput import os from .RadioBrowserClient import RadioBrowserClient loadSkin("%s/skin.xml" %(os.path.dirname(__file__))) config.plugins.simpleradio = ConfigSubsection() config.plugins.simpleradio.country = ConfigText(default="Germany", fixed_size=False) class RadioScreen(Screen, ServiceStopScreen, InfoBarServiceErrorPopupSupport, InfoBarGstreamerErrorPopupSupport): def __init__(self, session): Screen.__init__(self, session, windowTitle=_("Radio")) self.skinName = "SimpleRadioScreen" ServiceStopScreen.__init__(self) self.stopService() self._list = List([], buildfunc=self._buildFunc) self._serviceLabel = Label("") InfoBarServiceErrorPopupSupport.__init__(self) InfoBarGstreamerErrorPopupSupport.__init__(self)
def loadSkinReal(skinPath): if os.path.exists(skinPath): print "[SKLDR] Loading skin ", skinPath loadSkin(skinPath)
def loadLCDSkin(): loadSkin(getSkinPath("MediaCenter_LCD.xml"))
config.plugins.pvmc.version.value = currentVersion dSize = getDesktop(0).size() # Load Skin, first try to find it, if not found reset to default skin skinLoaded = False try: if config.plugins.pvmc.skin.value[0:1] == "~": #Enigma2 Skin skinPath = resolveFilename(SCOPE_SKIN) + config.plugins.pvmc.skin.value[1:] + "/" skinXml = skinPath + "skin_valerie.xml" else: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str(dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml) loadSingleSkinData(getDesktop(0), findSkin(skinPath), skinPath) skinLoaded = True except Exception, ex: printl("__init__:: Exception(" + str(type(ex)) + "): " + str(ex), None, "W") skinLoaded = False config.plugins.pvmc.skinfolderpath.value = defaultSkinFolderPath config.plugins.pvmc.skin.value = defaultSkin if skinLoaded == False: try: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str(dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml) loadSingleSkinData(getDesktop(0), findSkin(skinPath), skinPath)
import commands from enigma import getDesktop from Plugins.SystemPlugins.SoftwareManager.ImageBackup import ImageBackup from Plugins.Extensions.Infopanel.Flash_local import FlashOnline from Plugins.Extensions.Infopanel.plugin import RedPanel, BluePanel, KeymapSel from Plugins.Extensions.MainMenu2.usemenu import User_MainMenu, UserMainMenuSetup from Screens.ScanSetup import ScanSimple, ScanSetup from Screens.VideoMode import VideoSetup from Screens.SkinSelector import SkinSelector from Screens.Setup import Setup global mmpath global XIndex #change to FullHD if getDesktop(0).size().width() == 1920: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/skinHD.xml") mmpath = '/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/images/' else: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/skin.xml") mmpath = '/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/images/default/' class MM_MainMenu(Screen): def __init__(self, session): Screen.__init__(self, session) self["text"] = Label(_("Infopanel")) self["left"] = Pixmap() self["middle"] = Pixmap() self["right"] = Pixmap() self.Console = Console() list = [] list.append((_("InfoPanel"), "2MM_Infopanel", "menu_infopanel", "50")) list.append((_("InfoPanel"), "2MM_Infopanel", "menu_infopanel", "50"))
def loadSkinReal(skinPath): if os.path.exists(skinPath): print '[XTPanel] Loading skin ', skinPath loadSkin(skinPath)
def loadSkinReal(skinPath): if os.path.exists(skinPath): print '[XBMCAddons] Loading skin ', skinPath loadSkin(skinPath)
def loadSkinReal(skinPath): if os.path.exists(skinPath): loadSkin(skinPath)
from Plugins.SystemPlugins.SoftwareManager.ImageBackup import ImageBackup from Plugins.Extensions.Infopanel.Flash_local import FlashOnline from Plugins.Extensions.Infopanel.plugin import RedPanel, BluePanel, KeymapSel from Screens.ScanSetup import ScanSimple, ScanSetup from Screens.VideoMode import VideoSetup from Screens.SkinSelector import SkinSelector from Screens.Setup import Setup from Plugins.Extensions.Infopanel.TelnetCommand import TelnetCommand from Plugins.Extensions.Infopanel.SoftwarePanel import SoftwarePanel from Plugins.SystemPlugins.SoftwareManager.plugin import SoftwareManagerSetup global mmpath global XIndex #change to FullHD if getDesktop(0).size().width() == 1920: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/skinHD.xml" ) mmpath = '/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/images/' else: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/skin.xml" ) mmpath = '/usr/lib/enigma2/python/Plugins/Extensions/MainMenu2/skins/defaultHD/images/default/' class UserMainMenuSetup(Screen): def __init__(self, session): Screen.__init__(self, session) self.session = session self.Console = Console() self["actions"] = ActionMap(
config.plugins.mc_globalsettings.currentversion = ConfigInteger(0, (0, 999)) config.plugins.mc_globalsettings.currentplatform = ConfigText(default = currentmcplatform) config.plugins.mc_globalsettings.dst_top = ConfigInteger(0, (0, 999)) config.plugins.mc_globalsettings.dst_left = ConfigInteger(0, (0, 999)) config.plugins.mc_globalsettings.dst_width = ConfigInteger(720, (1, 720)) config.plugins.mc_globalsettings.dst_height = ConfigInteger(576, (1, 576)) config.plugins.mc_globalsettings.currentskin = ConfigSubsection() config.plugins.mc_globalsettings.currentskin.path = ConfigText(default = "defaultHD/skin.xml") config.plugins.mc_globalsettings.currentversion.value = currentmcversion config.plugins.mc_globalsettings.currentplatform.value = currentmcplatform # Load Skin try: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/" + config.plugins.mc_globalsettings.currentskin.path.value) except Exception, e: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/default/skin.xml") PluginLanguageDomain = "BMediaCenter" PluginLanguagePath = "Extensions/BMediaCenter/locale" # Load Language def localeInit(): lang = language.getLanguage()[:2] os.environ["LANGUAGE"] = lang gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath)) def _(txt): t = gettext.dgettext(PluginLanguageDomain, txt) if t == txt: t = gettext.gettext(txt) return t localeInit()
import Plugins.Plugin from Components.config import config from Components.config import ConfigSubsection from Components.config import ConfigSelection from Components.config import ConfigInteger from Components.config import ConfigSubList from Components.config import ConfigSubDict from Components.config import ConfigText from Components.config import configfile from Components.config import ConfigYesNo from skin import loadSkin # Load Skin try: loadSkin("../../../usr/lib/enigma2/python/Plugins/Extensions/MediaCenter/skins/default/skin.xml") except Exception, e: loadSkin("../../../usr/lib/enigma2/python/Plugins/Extensions/MediaCenter/skins/default/skin.xml")
from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE from os import environ import gettext from skin import loadSkin from Globals import SkinTools skin_path = resolveFilename( SCOPE_PLUGINS ) + "Extensions/AdvancedMovieSelection/skin/" + SkinTools.getSkinName() print "[AdvancedMovieSelection] load skin: %s" % skin_path loadSkin(skin_path) def localeInit(): lang = language.getLanguage() environ["LANGUAGE"] = lang[:2] gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE)) gettext.textdomain("enigma2") gettext.bindtextdomain( "AdvancedMovieSelection", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "Extensions/AdvancedMovieSelection/locale/")) ln = language.lang[language.activeLanguage][1] from AboutParser import AboutParser AboutParser.setLocale(ln) from MovieDB import tmdb, tvdb tmdb.setLocale(ln) tvdb.setLocale(ln)
def load(self): skin = pluginConfig.skin.value loadSkin(os.path.join(skin, self.SKIN_FILE))
from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE from os import environ as os_environ import gettext from skin import loadSkin loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/EnhancedMovieCenter/CoolSkin/EMCMediaCenter_LCD.xml" ) def localeInit(): lang = language.getLanguage( )[:2] # getLanguage returns e.g. "fi_FI" for "language_country" os_environ[ "LANGUAGE"] = lang # Enigma doesn't set this (or LC_ALL, LC_MESSAGES, LANG). gettext needs it! gettext.bindtextdomain( "EnhancedMovieCenter", resolveFilename(SCOPE_PLUGINS, "Extensions/EnhancedMovieCenter/locale")) _ = lambda txt: gettext.dgettext("EnhancedMovieCenter", txt) if txt else "" localeInit() language.addCallback(localeInit)
default=currentmcplatform) config.plugins.mc_globalsettings.dst_top = ConfigInteger(0, (0, 999)) config.plugins.mc_globalsettings.dst_left = ConfigInteger(0, (0, 999)) config.plugins.mc_globalsettings.dst_width = ConfigInteger(720, (1, 720)) config.plugins.mc_globalsettings.dst_height = ConfigInteger(576, (1, 576)) config.plugins.mc_globalsettings.currentskin = ConfigSubsection() config.plugins.mc_globalsettings.currentskin.path = ConfigText( default="defaultHD/skin.xml") config.plugins.mc_globalsettings.currentversion.value = currentmcversion config.plugins.mc_globalsettings.currentplatform.value = currentmcplatform # Load Skin try: loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/" + config.plugins.mc_globalsettings.currentskin.path.value) except Exception, e: loadSkin( "/usr/lib/enigma2/python/Plugins/Extensions/BMediaCenter/skins/default/skin.xml" ) PluginLanguageDomain = "BMediaCenter" PluginLanguagePath = "Extensions/BMediaCenter/locale" # Load Language def localeInit(): lang = language.getLanguage()[:2] os.environ["LANGUAGE"] = lang gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function #from Source.LocaleInit import _ # Andy Blackburn: [Translation] begin from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE import os, gettext from skin import loadSkin loadSkin( resolveFilename(SCOPE_PLUGINS) + "Extensions/AdvancedMovieSelection/skin/skin.xml") PluginLanguageDomain = "AdvancedMovieSelection" PluginLanguagePath = "Extensions/AdvancedMovieSelection/locale/" def localeInit(): gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath)) def _(txt): if gettext.dgettext(PluginLanguageDomain, txt): return gettext.dgettext(PluginLanguageDomain, txt) else: print("[" + PluginLanguageDomain + "] fallback to default translation for " + txt) return gettext.gettext(txt)
def loadPluginSkin(skin_file): loadSkin(getSkinPath(skin_file), "") path, dom_skin = dom_skins[-1:][0] loadSingleSkinData(getDesktop(0), dom_skin, path)
config.plugins.airplayer.skin = ConfigSelection(default='Classic', choices=getSkins()) skinPath = getSkinPath('Classic') try: path = getSkinPath(config.plugins.airplayer.skin.value) if path is not None: skinPath = path except Exception as e: print '[AirPlayer] error reading skin ', e # new oe-a have some kind of issues in libcrypto-compat from Tools.Directories import fileExists if not fileExists("/usr/lib/libssl.so.0.9.8"): os.system("ln -s /usr/lib/libssl.so.1.0.0 /usr/lib/libssl.so.0.9.8") print '[AirPlayer] using skin ', skinPath loadSkin(skinPath) print '[AirPlayer] running python ', version_info try: import ctypes except Exception as e: print '[AirPlayer] ctypes missing' print '[AirPlayer] inst python-ctypes 2.7' installIpk('http://airplayer.googlecode.com/files/python-ctypes_2.7_mips32el.ipk') try: import plistlib except Exception as e: print '[AirPlayer] python-plistlibb missing' print '[AirPlayer] install python-plistb 2.7' installIpk('http://airplayer.googlecode.com/files/python-plistlibb_2.7_all.ipk')
from skin import loadSkin loadSkin("/usr/lib/enigma2/python/Plugins/Extensions/TeamCS/skin/skin.xml")
# -*- coding: utf-8 -*- # code by [email protected] from enigma import eConsoleAppContainer, fbClass, eRCInput from Components.Language import language from Components.Sources.StaticText import StaticText from Screens.Screen import Screen from Screens.ServiceStopScreen import ServiceStopScreen from Tools.Directories import resolveFilename, SCOPE_PLUGINS from skin import loadSkin loadSkin(resolveFilename(SCOPE_PLUGINS, "Extensions/SDLVice/skin.xml")) #----------------------------------------------------------------------------------- class ViceSummary(Screen): def __init__(self, session, parent): Screen.__init__(self, session, parent = parent) self.skinName = ["ViceSummary"] #----------------------------------------------------------------------------------- class Vice(Screen, ServiceStopScreen): def __init__(self, session, emu="x64", rom=""): self.__emu=emu self.__rom=rom Screen.__init__(self, session)
from Components.config import * from skin import loadSkin from Components.Label import Label from Screens.Screen import Screen from Components.Pixmap import Pixmap from Plugins.Plugin import PluginDescriptor from Tools.Directories import pathExists, fileExists, resolveFilename, SCOPE_PLUGINS from __init__ import _ import os import commands from Components.Console import Console config.plugins.mc_global = ConfigSubsection() config.plugins.mc_global.vfd = ConfigSelection(default='off', choices=[('off', 'off'), ('on', 'on')]) config.plugins.mc_globalsettings.upnp_enable = ConfigYesNo(default=False) loadSkin(resolveFilename(SCOPE_PLUGINS, "Extensions/BMediaCenter/skins/defaultHD/skin.xml")) #try: # from enigma import evfd # config.plugins.mc_global.vfd.value = 'on' # config.plugins.mc_global.save() #except Exception as e: # print('Media Center: Import evfd failed') try: from Plugins.Extensions.DVDPlayer.plugin import * dvdplayer = True except: print("Media Center: Import DVDPlayer failed") dvdplayer = False mcpath = resolveFilename(SCOPE_PLUGINS, 'Extensions/BMediaCenter/skins/defaultHD/images/') class DMC_MainMenu(Screen):
import os #import ScreenLib.ScreenBouquets import ScreenLib.FileList import ScreenLib.Actions import ScreenLib.MasterBox import ScreenLib.DownloadChannelList import ScreenLib.ChannellistAvailable import ScreenLib.FileAvailable import ScreenLib.SmbTools import ScreenLib.SmbSettings from skin import loadSkin, lookupScreen, dom_skins loadSkin(os.path.dirname(os.path.realpath(__file__)) + '/skin.xml') class Smb_MainMenu(Screen): def buildlist(self): private_key = variable_get('privatekey') if private_key is not None: UserInfo().SetPrivateKey(private_key) try: box = Request().BoxDetails().GetList() if box.has_key('uid'): UserInfo().SetUid(box['uid']) except Exception as e: UserInfo().Reset()
from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE from os import environ import gettext from skin import loadSkin loadSkin(resolveFilename(SCOPE_PLUGINS) + "Extensions/AdvancedMovieSelection/skin/skin.xml") def localeInit(): lang = language.getLanguage() environ["LANGUAGE"] = lang[:2] gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE)) gettext.textdomain("enigma2") gettext.bindtextdomain("AdvancedMovieSelection", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "Extensions/AdvancedMovieSelection/locale/")) def _(txt): t = gettext.dgettext("AdvancedMovieSelection", txt) if t == txt: t = gettext.gettext(txt) return t localeInit() language.addCallback(localeInit)
from Components.MenuList import MenuList from Components.MultiContent import MultiContentEntryText, MultiContentEntryTextAlphaBlend, MultiContentEntryPixmapAlphaBlend from Plugins.Plugin import PluginDescriptor from Tools.BoundFunction import boundFunction from Tools.Directories import resolveFilename, SCOPE_PLUGINS from Tools.Log import Log from Twitch import Twitch, TwitchStream, TwitchVideoBase from TwitchMiddleware import TwitchMiddleware from twisted.web.client import downloadPage, readBody, Agent, BrowserLikeRedirectAgent, HTTPConnectionPool from twisted.internet import reactor, ssl from twisted.internet._sslverify import ClientTLSOptions PLUGIN_PATH = resolveFilename(SCOPE_PLUGINS, "Extensions/TwitchTV") loadSkin("%s/skin.xml" %(PLUGIN_PATH)) config.plugins.twitchtv = ConfigSubsection() config.plugins.twitchtv.user = ConfigText(default="", fixed_size=False) class TwitchInputBox(InputBox): pass class TLSSNIContextFactory(ssl.ClientContextFactory): def getContext(self, hostname=None, port=None): ctx = ssl.ClientContextFactory.getContext(self) ClientTLSOptions(hostname, ctx) return ctx class TwitchStreamGrid(Screen): TMP_PREVIEW_FILE_PATH = "/tmp/twitch_channel_preview.jpg"
dSize = getDesktop(0).size() # Load Skin, first try to find it, if not found reset to default skin skinLoaded = False try: if config.plugins.pvmc.skin.value[0:1] == "~": #Enigma2 Skin skinPath = resolveFilename( SCOPE_SKIN) + config.plugins.pvmc.skin.value[1:] + "/" skinXml = skinPath + "skin_valerie.xml" else: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str( dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I") loadSkin(skinXml) loadSingleSkinData(getDesktop(0), findSkin(skinPath), skinPath) skinLoaded = True except Exception, ex: printl("__init__:: Exception(" + str(type(ex)) + "): " + str(ex), None, "W") skinLoaded = False config.plugins.pvmc.skinfolderpath.value = defaultSkinFolderPath config.plugins.pvmc.skin.value = defaultSkin if skinLoaded == False: try: skinPath = config.plugins.pvmc.skinfolderpath.value + config.plugins.pvmc.skin.value + "/" + str( dSize.width()) + "x" + str(dSize.height()) + "/" skinXml = skinPath + "skin.xml" printl("__init__:: loading Skin " + skinXml, None, "I")