Exemplo n.º 1
0
def autostart(reason, **kwargs):
    if reason == 0:
        session = kwargs["session"]
        if not config.AdvancedMovieSelection.ml_disable.value:
            try:
                from MoviePlayer import showMovies, movieSelected
                InfoBar.movieSelected = movieSelected
                value = config.AdvancedMovieSelection.movie_launch.value
                if value == "showMovies": InfoBar.showMovies = showMovies
                elif value == "showTv": InfoBar.showTv = showMovies
                elif value == "showRadio": InfoBar.showRadio = showMovies
                elif value == "timeshiftStart": InfoBar.startTimeshift = showMovies
                from Wastebasket import waste_timer, WastebasketTimer
                waste_timer = WastebasketTimer(session)
                value = int(config.AdvancedMovieSelection.auto_empty_wastebasket.value)
                if value != -1:
                    print "[AdvancedMovieSelection] Auto empty from wastebasket enabled..."
                else:
                    waste_timer.stopTimer()
                    print "[AdvancedMovieSelection] Auto empty from wastebasket disabled..."
                from MessageServer import serverInstance
                if config.AdvancedMovieSelection.server_enabled.value:
                    serverInstance.setPort(config.AdvancedMovieSelection.server_port.value)
                    serverInstance.start()
                    serverInstance.setSearchRange(config.AdvancedMovieSelection.start_search_ip.value, config.AdvancedMovieSelection.stop_search_ip.value)
                    serverInstance.startScanForClients()
                
                from Components.Language import language
                language.addCallback(updateLocale)
                updateLocale()
                
                from EpgListExtension import epgListExtension
                epgListExtension.enabled(config.AdvancedMovieSelection.epg_extension.value)
            except:
                pass
Exemplo n.º 2
0
	def __init__(self, session, url=None, is_webapp=False):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["DirectionActions", "MenuActions", "OkCancelActions"], {
			 "cancel"      : self.keyCancel
			,"ok"          : self.keyOK
			,"left"        : self.keyLeft
			,"right"       : self.keyRight
			,"up"          : self.keyUp
			,"down"        : self.keyDown
			,"menu"        : self.keyMenu
		}, -2)

		self._cb_update_language()

		self.idx_menu = 0
		self.is_browser_opened = False
		self.is_show_top = True
		self.is_show_menu = False

		self._current_url = None
		self._current_title = None

		self["topArea"]    = Label()
		self["bottomArea"] = Label()

		self["menuitemFile"] = MultiColorLabel()
		self["menuitemTool"] = MultiColorLabel()
		self["menuitemHelp"] = MultiColorLabel()

		self.top_menus = [self["menuitemFile"], self["menuitemTool"], self["menuitemHelp"]]

		self["menulist"] = MenuList(self.get_menulist_items(self.idx_menu))
		self["submenulist"] = MenuList(None)

		self.onLayoutFinish.append(self.layoutFinished)

		self._close_timer = eTimer()
		self._close_timer.callback.append(self._cb_stop_browser)

		self.m_url = url
		self.m_webapp = is_webapp
		language.addCallback(self._cb_update_language)
Exemplo n.º 3
0
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
import os,gettext
PluginLanguageDomain = "inHDcontroler"
PluginLanguagePath = "Extensions/inHDcontroler/locale"

def localeInit():
	lang = language.getLanguage()[:2]
	os.environ["LANGUAGE"] = lang
	print "[inHD] set language to", lang
	gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))

def _(txt):
	t = gettext.dgettext(PluginLanguageDomain, txt)
	if t == txt:
		print "[inHD] fallback to default translation for", txt
		t = gettext.gettext(txt)
	return t

localeInit()
language.addCallback(localeInit)
Exemplo n.º 4
0
					if Package is None:
						continue

					if line.startswith("Version:"):
						Version = line.split(":", 1)[1].strip()

					elif line.startswith("Description:"):
						Description = line.split(":", 1)[1].strip()

					elif Description and line.startswith(' '):
						Description += line[:-1]

					elif len(line) <= 1:
						sp = Description.split(' ', 3)
						if sp[1] == "version":
							Description = sp[3].strip()

						pn = Package.split('enigma2-plugin-')[1]

						sp = Description.split(' ', 1)
						if sp[0] == pn and len(sp[1]) > 0:
							Description = sp[1].strip()

						plugin_list.append((Package, Version, Description, pn))
						Package = None

			return plugin_list

language.addCallback(languageChanged)
Exemplo n.º 5
0
profile("PYTHON_START")

from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, \
	getDesktop, ePythonConfigQuery, eAVSwitch, eServiceEvent, \
	eEPGCache
from tools import *

profile("LANGUAGE")

from Components.Language import language

def setEPGLanguage():
	print "language set to", language.getLanguage()
	eServiceEvent.setEPGLanguage(language.getLanguage())

language.addCallback(setEPGLanguage)

from traceback import print_exc
profile("LOAD:InfoBar")
import Screens.InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout, exc_info

profile("Bouquets")
eDVBDB.getInstance().reloadBouquets()

profile("ParentalControl")
from Components.ParentalControl import InitParentalControl
InitParentalControl()
Exemplo n.º 6
0
from Components.Label import Label
from Components.Language import language
from Components.Button import Button
from Components.Harddisk import harddiskmanager
from Components.Sources.StaticText import StaticText
from Components import Ipkg
from Components.config import config
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.Console import Console
from Plugins.Plugin import PluginDescriptor
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_ACTIVE_SKIN
from Tools.LoadPixmap import LoadPixmap


language.addCallback(plugins.reloadPlugins)

class PluginBrowserSummary(Screen):
	def __init__(self, session, parent):
		Screen.__init__(self, session, parent = parent)
		self["entry"] = StaticText("")
		self["desc"] = StaticText("")
		self.onShow.append(self.addWatcher)
		self.onHide.append(self.removeWatcher)

	def addWatcher(self):
		self.parent.onChangedEntry.append(self.selectionChanged)
		self.parent.selectionChanged()

	def removeWatcher(self):
		self.parent.onChangedEntry.remove(self.selectionChanged)
Exemplo n.º 7
0
profile("ImageDefaults")
from Components.DreamInfoHandler import ImageDefaultInstaller
ImageDefaultInstaller()

profile("LOAD:harddiskmanager")
from Components.Harddisk import harddiskmanager

profile("LANGUAGE")
from Components.Language import language

def setEPGLanguage():
	print "language set to", language.getLanguage()
	eServiceEvent.setEPGLanguage(language.getLanguage())

language.addCallback(setEPGLanguage)

from traceback import print_exc

profile("LOAD:InfoBar")
import Screens.InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout, exc_info

profile("Bouquets")
eDVBDB.getInstance().reloadBouquets()

profile("ParentalControl")
from Components.ParentalControl import InitParentalControl
InitParentalControl()
Exemplo n.º 8
0
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE  #@UnresolvedImport
import gettext
import os
import re
from enigma import eBackgroundFileEraser

PluginLanguageDomain = "NcidClient"
PluginLanguagePath = "Extensions/NcidClient/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)


language.addCallback(localeInit())


def debug(message):
    print(message)
Exemplo n.º 9
0
	gettext.bindtextdomain(
		LOCALES_DOMAIN,
		resolveFilename(SCOPE_PLUGINS, LOCALES_RELPATH))


def _(txt):
	try:
		t = gettext.dgettext(LOCALES_DOMAIN, txt)
		if t == txt:
			t = gettext.gettext(txt)
		return t
	except Exception:
		return txt

_locale_init()
language.addCallback(_locale_init)


try:
	AT_unit = comp_config.plugins.autotimer.unit.value == "hour" and _("hour") or _("minute")
except:
	AT_unit = "hour"

tstrings = {
	'mo': _("Mo"),
	'tu': _("Tu"),
	'we': _("We"),
	'th': _("Th"),
	'fr': _("Fr"),
	'sa': _("Sa"),
	'su': _("Su"),
Exemplo n.º 10
0
from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, \
 getDesktop, ePythonConfigQuery, eAVSwitch, eServiceEvent, \
 eEPGCache
from tools import *

profile("LANGUAGE")

from Components.Language import language


def setEPGLanguage():
    print "language set to", language.getLanguage()
    eServiceEvent.setEPGLanguage(language.getLanguage())


language.addCallback(setEPGLanguage)

from traceback import print_exc
profile("LOAD:InfoBar")
import Screens.InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout, exc_info

profile("Bouquets")
eDVBDB.getInstance().reloadBouquets()

profile("ParentalControl")
from Components.ParentalControl import InitParentalControl
InitParentalControl()
Exemplo n.º 11
0
    gettext.bindtextdomain(LOCALES_DOMAIN,
                           resolveFilename(SCOPE_PLUGINS, LOCALES_RELPATH))


def _(txt):
    try:
        t = gettext.dgettext(LOCALES_DOMAIN, txt)
        if t == txt:
            t = gettext.gettext(txt)
        return t
    except Exception:
        return txt


_locale_init()
language.addCallback(_locale_init)

try:
    AT_unit = comp_config.plugins.autotimer.unit.value == "hour" and _(
        "hour") or _("minute")
except:
    AT_unit = "hour"

tstrings = {
    'mo':
    _("Mo"),
    'tu':
    _("Tu"),
    'we':
    _("We"),
    'th':
Exemplo n.º 12
0
    def getDescriptionForMenuEntryID(self, menuid, entryid):
        for p in self.getPlugins(PluginDescriptor.WHERE_MENU):
            if p(menuid) and isinstance(p(menuid), (list, tuple)):
                if p(menuid)[0][2] == entryid:
                    return p.description
        return None

    def clearPluginList(self):
        self.pluginList = []
        self.plugins = {}

    def shutdown(self):
        for p in self.pluginList[:]:
            self.removePlugin(p)

    def resetWarnings(self):
        self.warnings = []

    def getNextWakeupTime(self):
        wakeup = -1
        for p in self.pluginList:
            current = p.getWakeupTime()
            if current > -1 and (wakeup > current or wakeup == -1):
                wakeup = current
        return int(wakeup)


plugins = PluginComponent()
language.addCallback(languageChanged)
Exemplo n.º 13
0
from Components.PluginComponent import plugins
from Components.PluginList import *
from Components.Label import Label
from Components.Language import language
from Components.Harddisk import harddiskmanager
from Components.Sources.StaticText import StaticText
from Components import Ipkg
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.Console import Console
from Plugins.Plugin import PluginDescriptor
from Tools.Directories import resolveFilename, fileExists, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN
from Tools.LoadPixmap import LoadPixmap
from time import time
import os
language.addCallback(plugins.reloadPlugins)
config.misc.pluginbrowser = ConfigSubsection()
config.misc.pluginbrowser.plugin_order = ConfigText(default='')


class PluginBrowserSummary(Screen):
    def __init__(self, session, parent):
        Screen.__init__(self, session, parent=parent)
        self['entry'] = StaticText('')
        self['desc'] = StaticText('')
        self.onShow.append(self.addWatcher)
        self.onHide.append(self.removeWatcher)

    def addWatcher(self):
        self.parent.onChangedEntry.append(self.selectionChanged)
        self.parent.selectionChanged()
Exemplo n.º 14
0
from Components.DreamInfoHandler import ImageDefaultInstaller
ImageDefaultInstaller()

profile("LOAD:harddiskmanager")
from Components.Harddisk import harddiskmanager

profile("LANGUAGE")
from Components.Language import language


def setEPGLanguage():
    print "language set to", language.getLanguage()
    eServiceEvent.setEPGLanguage(language.getLanguage())


language.addCallback(setEPGLanguage)

from traceback import print_exc

profile("LOAD:InfoBar")
import Screens.InfoBar
from Screens.SimpleSummary import SimpleSummary

from sys import stdout, exc_info

profile("Bouquets")
eDVBDB.getInstance().reloadBouquets()

profile("ParentalControl")
from Components.ParentalControl import InitParentalControl
InitParentalControl()