コード例 #1
0
ファイル: NetworkConfig.py プロジェクト: OpenDMM/enigma2
	def __init__(self, service):
		self._service = service
		self.onChanged = []
		self.onMethodChanged = []
		method_choices_ip4 = {eNetworkService.METHOD_DHCP : "dhcp", eNetworkService.METHOD_MANUAL : _("manual"), eNetworkService.METHOD_OFF : _("off")}
		#IPv4
		self._config_ip4_method = ConfigSelection(method_choices_ip4, default=eNetworkService.METHOD_DHCP)
		self._config_ip4_address = ConfigIP(default=[0,0,0,0])
		self._config_ip4_mask = ConfigIP(default=[0,0,0,0])
		self._config_ip4_gw = ConfigIP(default=[0,0,0,0])
		#IPv6
		method_choices_ip6 = {eNetworkService.METHOD_AUTO : _("auto"), eNetworkService.METHOD_6TO4 : "6to4", eNetworkService.METHOD_MANUAL : _("manual"), eNetworkService.METHOD_OFF : _("off")}
		choices_privacy_ip6 = {eNetworkService.IPV6_PRIVACY_DISABLED : _("Disabled"), eNetworkService.IPV6_PRIVACY_ENABLED : _("Enabled"), eNetworkService.IPV6_PRIVACY_PREFERRED : _("Preferred")}
		self._config_ip6_method = ConfigSelection(method_choices_ip6, default=eNetworkService.METHOD_DHCP)
		self._config_ip6_address = ConfigIP6()
		self._config_ip6_prefix_length = ConfigInteger(0, limits=(1, 128))
		self._config_ip6_gw = ConfigIP6()
		self._config_ip6_privacy = ConfigSelection(choices_privacy_ip6, default="disabled")

		self._isReloading = False
		self._ipv4Changed = False
		self._ipv6Changed = False
		self._addNotifiers()
		self._service_conn = [
			self._service.ipv4Changed.connect(self._serviceChanged),
			self._service.ipv6Changed.connect(self._serviceChanged),
			self._service.ipv4ConfigChanged.connect(self._serviceChanged),
			self._service.ipv6ConfigChanged.connect(self._serviceChanged),
		]
コード例 #2
0
ファイル: NetworkConfig.py プロジェクト: OpenDMM/enigma2
class ServiceIPConfiguration(object):
	def __init__(self, service):
		self._service = service
		self.onChanged = []
		self.onMethodChanged = []
		method_choices_ip4 = {eNetworkService.METHOD_DHCP : "dhcp", eNetworkService.METHOD_MANUAL : _("manual"), eNetworkService.METHOD_OFF : _("off")}
		#IPv4
		self._config_ip4_method = ConfigSelection(method_choices_ip4, default=eNetworkService.METHOD_DHCP)
		self._config_ip4_address = ConfigIP(default=[0,0,0,0])
		self._config_ip4_mask = ConfigIP(default=[0,0,0,0])
		self._config_ip4_gw = ConfigIP(default=[0,0,0,0])
		#IPv6
		method_choices_ip6 = {eNetworkService.METHOD_AUTO : _("auto"), eNetworkService.METHOD_6TO4 : "6to4", eNetworkService.METHOD_MANUAL : _("manual"), eNetworkService.METHOD_OFF : _("off")}
		choices_privacy_ip6 = {eNetworkService.IPV6_PRIVACY_DISABLED : _("Disabled"), eNetworkService.IPV6_PRIVACY_ENABLED : _("Enabled"), eNetworkService.IPV6_PRIVACY_PREFERRED : _("Preferred")}
		self._config_ip6_method = ConfigSelection(method_choices_ip6, default=eNetworkService.METHOD_DHCP)
		self._config_ip6_address = ConfigIP6()
		self._config_ip6_prefix_length = ConfigInteger(0, limits=(1, 128))
		self._config_ip6_gw = ConfigIP6()
		self._config_ip6_privacy = ConfigSelection(choices_privacy_ip6, default="disabled")

		self._isReloading = False
		self._ipv4Changed = False
		self._ipv6Changed = False
		self._addNotifiers()
		self._service_conn = [
			self._service.ipv4Changed.connect(self._serviceChanged),
			self._service.ipv6Changed.connect(self._serviceChanged),
			self._service.ipv4ConfigChanged.connect(self._serviceChanged),
			self._service.ipv6ConfigChanged.connect(self._serviceChanged),
		]

	def _serviceChanged(self, *args):
		self.reload(force=False)

	def _addNotifiers(self):
		#Setup refresh
		self._config_ip4_method.addNotifier(self._methodChanged, initial_call=False)
		self._config_ip6_method.addNotifier(self._methodChanged, initial_call=False)

		#change tracking
		#ipv4
		self._config_ip4_method.addNotifier(self._changedIP4, initial_call=False)
		self._config_ip4_address.addNotifier(self._changedIP4, initial_call=False)
		self._config_ip4_mask.addNotifier(self._changedIP4, initial_call=False)
		self._config_ip4_gw.addNotifier(self._changedIP4, initial_call=False)
		#ipv6
		self._config_ip6_method.addNotifier(self._changedIP6, initial_call=False)
		self._config_ip6_address.addNotifier(self._changedIP6, initial_call=False)
		self._config_ip6_prefix_length.addNotifier(self._changedIP6, initial_call=False)
		self._config_ip6_gw.addNotifier(self._changedIP6, initial_call=False)
		self._config_ip6_privacy.addNotifier(self._changedIP6, initial_call=False)

	def _changedIP4(self, element):
		if not self._isReloading:
			self._ipv4Changed = True
		self._changed(element)

	def _changedIP6(self, element):
		if not self._isReloading:
			self._ipv6Changed = True
		self._changed(element)

	def _changed(self, element):
		if not self._isReloading:
			Log.i()
			for fnc in self.onChanged:
				fnc()

	def _methodChanged(self, element):
		if not self._isReloading:
			Log.i()
			for fnc in self.onMethodChanged:
				fnc()

	def reload(self, force=True):
		self._isReloading = True
		if force:
			self._ipv4Changed = False
			self._ipv6Changed = False
		if not self._ipv6Changed:
			ip4 = self._service.ipv4()
			if not dict(ip4):
				ip6 = self._service.ipv4Config()
			self._config_ip4_method.value = ip4.get(eNetworkService.KEY_METHOD, eNetworkService.METHOD_OFF)
			self._config_ip4_address.value = toIP4List( ip4.get("Address", "0.0.0.0") )
			self._config_ip4_mask.value = toIP4List( ip4.get(eNetworkService.KEY_NETMASK, "0.0.0.0") )
			self._config_ip4_gw.value = toIP4List( ip4.get(eNetworkService.KEY_GATEWAY, "0.0.0.0") )
		if not self._ipv6Changed:
			ip6 = self._service.ipv6()
			Log.i("%s / %s" %(dict(ip6), dict(self._service.ipv6Config())) )
			if not dict(ip6):
				ip6 = self._service.ipv6Config()
			self._config_ip6_method.value = ip6.get(eNetworkService.KEY_METHOD, eNetworkService.METHOD_OFF)
			self._config_ip6_address.value = ip6.get(eNetworkService.KEY_ADDRESS, "::")
			self._config_ip6_prefix_length.value = ord( ip6.get(eNetworkService.KEY_PREFIX_LENGTH, chr(1)) or chr(1) )
			self._config_ip6_gw.value = ip6.get(eNetworkService.KEY_GATEWAY, "::")
			self._config_ip6_privacy.value = ip6.get(eNetworkService.KEY_PRIVACY, eNetworkService.IPV6_PRIVACY_DISABLED)
		self._isReloading = False
		self._changed(None)

	def getList(self):
		if self._config_ip4_method.value == eNetworkService.METHOD_MANUAL:
			self._config_ip4_address.enabled = True
			self._config_ip4_mask.enabled = True
			self._config_ip4_gw.enabled = True
		else:
			self._config_ip4_address.enabled = False
			self._config_ip4_mask.enabled = False
			self._config_ip4_gw.enabled = False
		if self._config_ip6_method.value == eNetworkService.METHOD_MANUAL:
			self._config_ip6_address.enabled = True
			self._config_ip6_prefix_length.enabled = True
			self._config_ip6_gw.enabled = True
		else:
			self._config_ip6_address.enabled = False
			self._config_ip6_prefix_length.enabled = False
			self._config_ip6_gw.enabled = False

		l = [ getConfigListEntry(_("Method (IPv4)"), self._config_ip4_method), ]
		if self._config_ip4_method.value != eNetworkService.METHOD_OFF:
			l.extend([
				getConfigListEntry(_("Address (IPv4)"), self._config_ip4_address),
				getConfigListEntry(_("Mask (IPv4)"), self._config_ip4_mask),
				getConfigListEntry(_("Gateway (IPv4)"), self._config_ip4_gw),
			])
		l.append( getConfigListEntry(_("Method (IPv6)"), self._config_ip6_method))
		if self._config_ip6_method.value != eNetworkService.METHOD_OFF:
			l.extend([
				getConfigListEntry(_("Address (IPv6)"), self._config_ip6_address),
				getConfigListEntry(_("Prefix length (IPv6)"), self._config_ip6_prefix_length),
				getConfigListEntry(_("Gateway (IPv6)"), self._config_ip6_gw),
			])
		if self._config_ip6_method.value in (eNetworkService.METHOD_AUTO, eNetworkService.METHOD_6TO4):
			l.append( getConfigListEntry(_("Privacy (IPv6)"), self._config_ip6_privacy) )
		return l

	def save(self):
		if self._ipv4Changed:
			Log.i("IPv4 Changed, saving!")
			if self._config_ip4_method.value == eNetworkService.METHOD_MANUAL:
				ip4_config = {
						eNetworkService.KEY_METHOD : self._config_ip4_method.value,
						eNetworkService.KEY_ADDRESS : toIP4String(self._config_ip4_address),
						eNetworkService.KEY_NETMASK : toIP4String(self._config_ip4_mask),
						eNetworkService.KEY_GATEWAY : toIP4String(self._config_ip4_gw),
					}
			else:
				ip4_config = { eNetworkService.KEY_METHOD : self._config_ip4_method.value }
			Log.i(ip4_config)
			self._service.setIpv4Config(ip4_config)

		if self._ipv6Changed:
			Log.i("IPv6 Changed, saving!")
			if self._config_ip6_method.value == eNetworkService.METHOD_MANUAL:
				ip6_config = {
						eNetworkService.KEY_METHOD : self._config_ip6_method.value,
						eNetworkService.KEY_ADDRESS : self._config_ip6_address.value,
						eNetworkService.KEY_PREFIX_LENGTH : self._config_ip6_prefix_length.value,
						eNetworkService.KEY_GATEWAY : self._config_ip6_gw.value,
						eNetworkService.KEY_PRIVACY : self._config_ip6_privacy.value,
					}
			else:
				val = self._config_ip6_method.value #avoid config element overhead here
				#one can not configure 6to4, it will automatically be applied by connman if applicable -> change it to auto
				if val == eNetworkService.METHOD_6TO4:
					val = eNetworkService.METHOD_AUTO

				ip6_config = { eNetworkService.KEY_METHOD : val }
				if val != eNetworkService.METHOD_OFF:
					ip6_config[eNetworkService.KEY_PRIVACY] = self._config_ip6_privacy.value
			Log.i(ip6_config)
			self._service.setIpv6Config(ip6_config)
コード例 #3
0
ファイル: plugin.py プロジェクト: wedebe/enigma2-plugins
from os import listdir
from Plugins.Plugin import PluginDescriptor
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport
from Screens.MessageBox import MessageBox
from Screens.MovieSelection import MovieSelection
from Screens.Screen import Screen
from Tools.Directories import fileExists, resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS
import os
import gettext
import random

##############################################################################

config.plugins.MovielistPreview = ConfigSubsection()
config.plugins.MovielistPreview.enabled = ConfigYesNo(default=True)
config.plugins.MovielistPreview.position_x = ConfigInteger(default=100)
config.plugins.MovielistPreview.position_y = ConfigInteger(default=100)
config.plugins.MovielistPreview.size = ConfigSelection(
    choices=["250x200", "200x160", "150x120", "100x80"], default="250x200")

##############################################################################

PluginLanguageDomain = "MovielistPreview"
PluginLanguagePath = "Extensions/MovielistPreview/locale/"


def localeInit():
    gettext.bindtextdomain(PluginLanguageDomain,
                           resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))

コード例 #4
0
ファイル: MovieSelection.py プロジェクト: aitchala/enigma2
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.LocationBox import MovieLocationBox
from Screens.HelpMenu import HelpableScreen

from Tools.Directories import fileExists, resolveFilename, SCOPE_HDD
from Tools.BoundFunction import boundFunction

from enigma import eServiceReference, eServiceCenter, eTimer, eSize
from timer import TimerEntry

from os import path as os_path

config.movielist = ConfigSubsection()
config.movielist.moviesort = ConfigInteger(default=MovieList.SORT_RECORDED)
config.movielist.listtype = ConfigInteger(default=MovieList.LISTTYPE_ORIGINAL)
config.movielist.description = ConfigInteger(
    default=MovieList.HIDE_DESCRIPTION)
config.movielist.last_videodir = ConfigText(default=resolveFilename(SCOPE_HDD))
config.movielist.last_timer_videodir = ConfigText(
    default=resolveFilename(SCOPE_HDD))
config.movielist.videodirs = ConfigLocations(
    default=[resolveFilename(SCOPE_HDD)])
config.movielist.first_tags = ConfigText(default="")
config.movielist.second_tags = ConfigText(default="")
config.movielist.last_selected_tags = ConfigSet([], default=[])


def setPreferredTagEditor(te):
    global preferredTagEditor
コード例 #5
0
from Plugins.Plugin import PluginDescriptor
from os import stat
from Vps import vps_timers
from Vps_setup import VPS_Setup
from Modifications import register_vps
from . import _
from boxbranding import getImageDistro

# Config
from Components.config import config, ConfigYesNo, ConfigSubsection, ConfigInteger, ConfigSelection

config.plugins.vps = ConfigSubsection()
config.plugins.vps.enabled = ConfigYesNo(default = True)
config.plugins.vps.initial_time = ConfigInteger(default=10, limits=(0, 120))
config.plugins.vps.allow_wakeup = ConfigYesNo(default = False)
config.plugins.vps.allow_seeking_multiple_pdc = ConfigYesNo(default = True)
config.plugins.vps.vps_default = ConfigSelection(choices = [("no", _("No")), ("yes_safe", _("Yes (safe mode)")), ("yes", _("Yes"))], default = "no") 
config.plugins.vps.instanttimer = ConfigSelection(choices = [("no", _("No")), ("yes_safe", _("Yes (safe mode)")), ("yes", _("Yes")), ("ask", _("always ask"))], default = "ask")
config.plugins.vps.infotext = ConfigInteger(default=0)


def autostart(reason, **kwargs):
	if reason == 0:
		if kwargs.has_key("session"):
			session = kwargs["session"]
			vps_timers.session = session
			vps_timers.checkNextAfterEventAuto()
			vps_timers.checkTimer()

			try:
				from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
コード例 #6
0
radiopic = resolveFilename(SCOPE_ACTIVE_SKIN, "radio.mvi")
if os.path.exists(resolveFilename(SCOPE_CONFIG, "radio.mvi")):
    radiopic = resolveFilename(SCOPE_CONFIG, "radio.mvi")
config.misc.radiopic = ConfigText(default=radiopic)
#config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)
#config.misc.isNextPowerTimerAfterEventActionAuto = ConfigYesNo(default=False)
config.misc.nextWakeup = ConfigText(
    default="-1,-1,-1,0,0,-1,0"
)  #last shutdown time, wakeup time, timer begins, set by (0=rectimer,1=zaptimer, 2=powertimer or 3=plugin), go in standby, next rectimer, force rectimer
config.misc.SyncTimeUsing = ConfigSelection(default="0",
                                            choices=[("0",
                                                      _("Transponder Time")),
                                                     ("1", _("NTP"))])
config.misc.NTPserver = ConfigText(default='pool.ntp.org', fixed_size=False)

config.misc.startCounter = ConfigInteger(default=0)  # number of e2 starts...
config.misc.standbyCounter = NoSave(
    ConfigInteger(default=0))  # number of standby
config.misc.DeepStandby = NoSave(
    ConfigYesNo(default=False))  # detect deepstandby

#demo code for use of standby enter leave callbacks
#def leaveStandby():
#	print "!!!!!!!!!!!!!!!!!leave standby"

#def standbyCountChanged(configelement):
#	print "!!!!!!!!!!!!!!!!!enter standby num", configelement.value
#	from Screens.Standby import inStandby
#	inStandby.onClose.append(leaveStandby)

#config.misc.standbyCounter.addNotifier(standbyCountChanged, initial_call = False)
コード例 #7
0
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry

config.plugins.OSDPositionSetup = ConfigSubsection()
config.plugins.OSDPositionSetup.dst_left = ConfigInteger(default=0)
config.plugins.OSDPositionSetup.dst_width = ConfigInteger(default=720)
config.plugins.OSDPositionSetup.dst_top = ConfigInteger(default=0)
config.plugins.OSDPositionSetup.dst_height = ConfigInteger(default=576)


class OSDScreenPosition(Screen, ConfigListScreen):
    skin = """
	<screen position="0,0" size="e,e" title="OSD position setup" backgroundColor="blue">
		<widget name="config" position="c-175,c-75" size="350,150" foregroundColor="black" backgroundColor="blue" />
		<ePixmap pixmap="buttons/green.png" position="c-145,e-100" zPosition="0" size="140,40" alphatest="on" />
		<ePixmap pixmap="buttons/red.png" position="c+5,e-100" zPosition="0" size="140,40" alphatest="on" />
		<widget name="ok" position="c-145,e-100" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;20" transparent="1" backgroundColor="green" />
		<widget name="cancel" position="c+5,e-100" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;20" transparent="1" backgroundColor="red" />
	</screen>"""

    def __init__(self, session):
        self.skin = OSDScreenPosition.skin
        Screen.__init__(self, session)

        from Components.ActionMap import ActionMap
        from Components.Button import Button

        self["ok"] = Button(_("OK"))
        self["cancel"] = Button(_("Cancel"))
コード例 #8
0
# -*- coding: utf-8 -*-
from __future__ import print_function
from Screen import Screen
from Components.Pixmap import Pixmap
from Components.config import config, ConfigInteger
from Components.Sources.Boolean import Boolean
from Components.Label import Label
from Components.ServiceEventTracker import ServiceEventTracker
from enigma import eDVBSatelliteEquipmentControl, eTimer, iPlayableService, eServiceCenter, iServiceInformation
from Components.NimManager import nimmanager
from Components.Sources.FrontendStatus import FrontendStatus

INVALID_POSITION = 9999
config.misc.lastrotorposition = ConfigInteger(INVALID_POSITION)


class Dish(Screen):
    STATE_HIDDEN = 0
    STATE_SHOWN = 1
    skin = """
		<screen name="Dish" flags="wfNoBorder" position="86,100" size="130,220" title="Dish" zPosition="1" backgroundColor="#11396D" >
			<widget name="Dishpixmap" position="0,0"  size="130,160" zPosition="-1" pixmap="icons/dish.png" transparent="1" alphatest="on" />
			<widget name="turnTime"   position="5,0"   size="120,20" zPosition="1" font="Regular;20" halign="right" shadowColor="black" shadowOffset="-2,-2" transparent="1" />
			<widget name="From"       position="5,162" size="50,17" zPosition="1" font="Regular;17" halign="left"  shadowColor="black" shadowOffset="-2,-1" transparent="1"  />
			<widget name="posFrom"    position="57,160" size="70,20" zPosition="1" font="Regular;20" halign="left"  shadowColor="black" shadowOffset="-2,-2" transparent="1" />
			<widget name="Goto"       position="5,182"  size="50,17" zPosition="1" font="Regular;17" halign="left"  shadowColor="black" shadowOffset="-2,-1" transparent="1" />
			<widget name="posGoto"    position="57,180" size="70,20" zPosition="1" font="Regular;20" halign="left"  shadowColor="black" shadowOffset="-2,-2" transparent="1" />
			<widget name="tunerName"  position="5,144"  size="90,16" zPosition="2" font="Regular;14" halign="left"  shadowColor="black" shadowOffset="-2,-1" transparent="1" />
			<widget name="turnSpeed"  position="75,95" size="50,16" zPosition="2" font="Regular;14" halign="right" shadowColor="black" shadowOffset="-2,-1" transparent="1" />
			<widget source="session.FrontendStatus" render="Progress" position="5,205" size="120,10" pixmap="bar_snr.png" zPosition="2" borderWidth="2" borderColor="#cccccc">
				<convert type="FrontendInfo">SNR</convert>
コード例 #9
0
ファイル: DVDProject.py プロジェクト: n3wb13/openNFR-gui2
 def __init__(self):
     self.settings = ConfigSubsection()
     self.settings.titleformat = ConfigText(fixed_size=False,
                                            visible_width=40)
     self.settings.subtitleformat = ConfigText(fixed_size=False,
                                               visible_width=40)
     self.settings.menubg = ConfigFilename()
     self.settings.menuaudio = ConfigFilename()
     self.settings.dimensions = ConfigSequence(seperator=',',
                                               default=[576, 720],
                                               limits=[(352, 720),
                                                       (480, 576)])
     self.settings.rows = ConfigInteger(default=4, limits=(1, 10))
     self.settings.cols = ConfigInteger(default=1, limits=(1, 4))
     self.settings.color_headline = ConfigColor()
     self.settings.color_headline = ConfigColor()
     self.settings.color_highlight = ConfigColor()
     self.settings.color_button = ConfigColor()
     self.settings.fontface_headline = ConfigFilename()
     self.settings.fontface_title = ConfigFilename()
     self.settings.fontface_subtitle = ConfigFilename()
     self.settings.fontsize_headline = ConfigInteger(default=46,
                                                     limits=(0, 199))
     self.settings.fontsize_title = ConfigInteger(default=24,
                                                  limits=(0, 199))
     self.settings.fontsize_subtitle = ConfigInteger(default=14,
                                                     limits=(0, 199))
     self.settings.margin_top = ConfigInteger(default=120, limits=(0, 500))
     self.settings.margin_bottom = ConfigInteger(default=40,
                                                 limits=(0, 500))
     self.settings.margin_left = ConfigInteger(default=56, limits=(0, 500))
     self.settings.margin_right = ConfigInteger(default=56, limits=(0, 500))
     self.settings.space_rows = ConfigInteger(default=32, limits=(0, 500))
     self.settings.space_cols = ConfigInteger(default=24, limits=(0, 500))
     self.settings.prev_page_text = ConfigText(default="<<<",
                                               fixed_size=False)
     self.settings.next_page_text = ConfigText(default=">>>",
                                               fixed_size=False)
     self.settings.offset_headline = ConfigSequence(seperator=',',
                                                    default=[0, 0],
                                                    limits=[(-1, 500),
                                                            (-1, 500)])
     self.settings.offset_title = ConfigSequence(seperator=',',
                                                 default=[0, 0],
                                                 limits=[(-1, 500),
                                                         (-1, 500)])
     self.settings.offset_subtitle = ConfigSequence(seperator=',',
                                                    default=[20, 0],
                                                    limits=[(-1, 500),
                                                            (-1, 500)])
     self.settings.offset_thumb = ConfigSequence(seperator=',',
                                                 default=[40, 0],
                                                 limits=[(-1, 500),
                                                         (-1, 500)])
     self.settings.thumb_size = ConfigSequence(seperator=',',
                                               default=[200, 158],
                                               limits=[(0, 576), (-1, 720)])
     self.settings.thumb_border = ConfigInteger(default=2, limits=(0, 20))
     self.filekeys = [
         "menubg", "menuaudio", "fontface_headline", "fontface_title",
         "fontface_subtitle"
     ]
     from TitleProperties import languageChoices
     self.settings.menulang = ConfigSelection(
         choices=languageChoices.choices,
         default=languageChoices.choices[1][0])
     self.error = ""
コード例 #10
0
ファイル: Rc.py プロジェクト: mcron/stb-gui
from Components.Pixmap import MovingPixmap, MultiPixmap
from Tools.Directories import resolveFilename, SCOPE_SKIN
from xml.etree.ElementTree import ElementTree
from Components.config import config, ConfigInteger
from Components.RcModel import rc_model
from enigma import getBoxType
from enigma import ePoint

config.misc.rcused = ConfigInteger(default=1)


class Rc:
    def __init__(self):
        self["rc"] = MultiPixmap()
        self['red'] = MovingPixmap()
        self['tunera'] = MovingPixmap()
        self['tunerb'] = MovingPixmap()
        self['tunerc'] = MovingPixmap()
        self['tunerd'] = MovingPixmap()
        self["arrowdown"] = MovingPixmap()
        self["arrowdown2"] = MovingPixmap()
        self["arrowup"] = MovingPixmap()
        self["arrowup2"] = MovingPixmap()

        config.misc.rcused = ConfigInteger(default=1)
        self.isDefaultRc = rc_model.rcIsDefault()
        self.rcheight = 500
        self.rcheighthalf = 250

        self.selectpics = []
        self.selectpics.append((self.rcheighthalf, ["arrowdown",
コード例 #11
0
ファイル: PowerTimerEntry.py プロジェクト: GWARDAR/enigma2-2
    def createConfig(self):
        afterevent = {
            AFTEREVENT.NONE: "nothing",
            AFTEREVENT.WAKEUPTOSTANDBY: "wakeuptostandby",
            AFTEREVENT.STANDBY: "standby",
            AFTEREVENT.DEEPSTANDBY: "deepstandby"
        }[self.timer.afterEvent]

        timertype = {
            TIMERTYPE.WAKEUP: "wakeup",
            TIMERTYPE.WAKEUPTOSTANDBY: "wakeuptostandby",
            TIMERTYPE.AUTOSTANDBY: "autostandby",
            TIMERTYPE.AUTODEEPSTANDBY: "autodeepstandby",
            TIMERTYPE.STANDBY: "standby",
            TIMERTYPE.DEEPSTANDBY: "deepstandby",
            TIMERTYPE.REBOOT: "reboot",
            TIMERTYPE.RESTART: "restart"
        }[self.timer.timerType]

        weekday_table = ("mon", "tue", "wed", "thu", "fri", "sat", "sun")

        # calculate default values
        day = []
        weekday = 0
        for x in (0, 1, 2, 3, 4, 5, 6):
            day.append(0)
        if self.timer.repeated:  # repeated
            type = "repeated"
            if self.timer.repeated == 31:  # Mon-Fri
                repeated = "weekdays"
            elif self.timer.repeated == 127:  # daily
                repeated = "daily"
            else:
                flags = self.timer.repeated
                repeated = "user"
                count = 0
                for x in (0, 1, 2, 3, 4, 5, 6):
                    if flags == 1:  # weekly
                        print "[PowerTimerEntry] Set to weekday " + str(x)
                        weekday = x
                    if flags & 1 == 1:  # set user defined flags
                        day[x] = 1
                        count += 1
                    else:
                        day[x] = 0
                    flags >>= 1
                if count == 1:
                    repeated = "weekly"
        else:  # once
            type = "once"
            repeated = None
            weekday = int(strftime("%u", localtime(self.timer.begin))) - 1
            day[weekday] = 1

        autosleepinstandbyonly = self.timer.autosleepinstandbyonly
        autosleepdelay = self.timer.autosleepdelay
        autosleeprepeat = self.timer.autosleeprepeat

        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.timerentry_timertype = ConfigSelection(choices=[
            ("wakeup", _("wakeup")),
            ("wakeuptostandby", _("wakeup to standby")),
            ("autostandby", _("auto standby")),
            ("autodeepstandby", _("auto deepstandby")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString),
            ("reboot", _("reboot system")), ("restart", _("restart GUI"))
        ],
                                                    default=timertype)
        self.timerentry_afterevent = ConfigSelection(choices=[
            ("nothing", _("do nothing")),
            ("wakeuptostandby", _("wakeup to standby")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString),
            ("nothing", _("do nothing"))
        ],
                                                     default=afterevent)
        self.timerentry_type = ConfigSelection(choices=[("once", _("once")),
                                                        ("repeated",
                                                         _("repeated"))],
                                               default=type)

        self.timerentry_repeated = ConfigSelection(
            default=repeated,
            choices=[("daily", _("daily")), ("weekly", _("weekly")),
                     ("weekdays", _("Mon-Fri")), ("user", _("user defined"))])
        self.timerrntry_autosleepdelay = ConfigInteger(default=autosleepdelay,
                                                       limits=(10, 300))
        self.timerentry_autosleeprepeat = ConfigSelection(
            choices=[("once", _("once")), ("repeated", _("repeated"))],
            default=autosleeprepeat)
        self.timerrntry_autosleepinstandbyonly = ConfigSelection(
            choices=[("yes", _("Yes")), ("no", _("No"))],
            default=autosleepinstandbyonly)

        self.timerentry_date = ConfigDateTime(
            default=self.timer.begin,
            formatstring=config.usage.date.full.value,
            increment=86400)
        self.timerentry_starttime = ConfigClock(default=self.timer.begin)
        self.timerentry_endtime = ConfigClock(default=self.timer.end)
        self.timerentry_showendtime = ConfigSelection(
            default=(((self.timer.end - self.timer.begin) / 60) > 1),
            choices=[(True, _("yes")), (False, _("no"))])

        self.timerentry_repeatedbegindate = ConfigDateTime(
            default=self.timer.repeatedbegindate,
            formatstring=config.usage.date.full.value,
            increment=86400)

        self.timerentry_weekday = ConfigSelection(
            default=weekday_table[weekday],
            choices=[("mon", _("Monday")), ("tue", _("Tuesday")),
                     ("wed", _("Wednesday")), ("thu", _("Thursday")),
                     ("fri", _("Friday")), ("sat", _("Saturday")),
                     ("sun", _("Sunday"))])

        self.timerentry_day = ConfigSubList()
        for x in (0, 1, 2, 3, 4, 5, 6):
            self.timerentry_day.append(ConfigYesNo(default=day[x]))
コード例 #12
0
from Components.UsageConfig import defaultMoviePath

from Plugins.Plugin import PluginDescriptor

from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.LocationBox import MovieLocationBox
from Screens.HelpMenu import HelpableScreen

from Tools.Directories import *
from Tools.BoundFunction import boundFunction

from enigma import eServiceReference, eServiceCenter, eTimer, eSize, iServiceInformation
from SerienFilm import EpiSepCfg

config.movielist.sfmoviesort = ConfigInteger(default=MovieList.SORT_RECORDED)
config.movielist.sflisttype = ConfigInteger(default=MovieList.LISTTYPE_MINIMAL)
config.movielist.sftimes = ConfigInteger(default=MovieList.SHOW_DURATION | MovieList.SHOW_DIRECTORIES)
config.movielist.sftitle_episode_separator = ConfigText(default=_x(": "))


def setPreferredTagEditor(te):
	global preferredTagEditor
	try:
		if preferredTagEditor == None:
			preferredTagEditor = te
			print "Preferred tag editor changed to ", preferredTagEditor
		else:
			print "Preferred tag editor already set to ", preferredTagEditor
			print "ignoring ", te
	except:
コード例 #13
0
from Components.ActionMap import ActionMap
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.Sources.Boolean import Boolean
from Components.Sources.StaticText import StaticText
from Plugins.Plugin import PluginDescriptor
from Tools.Directories import fileExists
from enigma import eTimer, getBoxType
from os import system as os_system
from __init__ import _

transcodingsetupinit = None
	
config.plugins.transcodingsetup = ConfigSubsection()
config.plugins.transcodingsetup.port = ConfigInteger(default = 8002, limits = (8002, 9999))
if fileExists("/proc/stb/encoder/0/bitrate"):
	if getBoxType() == "vusolo2":
		config.plugins.transcodingsetup.bitrate = ConfigSelection(default = "100000", choices = [ ("50000", "50 Kbits"), ("100000", "100 Kbits"), ("200000", "200 Kbits"), ("300000", "300 Kbits"), ("400000", "400 Kbits"), ("500000", "500 Kbits"), ("600000", "600 Kbits"), ("700000", "700 Kbits"), ("800000", "800 Kbits"), ("900000", "900 Kbits"), ("1000000", "1 Mbits")])
	else:
		config.plugins.transcodingsetup.bitrate = ConfigSelection(default = "500000", choices = [ ("100000", "100 Kbits"), ("500000", "500 Kbits"), ("1000000", "1 Mbits"), ("1500000", "1.5 Mbits"), ("2000000", "2 Mbits"), ("2500000", "2.5 Mbits"), ("3000000", "3 Mbits"), ("3500000", "3.5 Mbits"), ("4000000", "4 Mbits"), ("4500000", "4.5 Mbits"), ("5000000", "5 Mbits")])
if fileExists("/proc/stb/encoder/0/framerate"):
	config.plugins.transcodingsetup.framerate = ConfigSelection(default = "30000", choices = [ ("23976", "23.976 fps"), ("24000", "24 fps"), ("25000", "25 fps"), ("29970", "29.970 fps"), ("30000", "30 fps"), ("50000", "50 fps"), ("59940", "59.940 fps"), ("60000", "60 fps")])

class TranscodingSetupInit:
	def __init__(self):
		self.pluginsetup = None
		config.plugins.transcodingsetup.port.addNotifier(self.setPort)
		if hasattr(config.plugins.transcodingsetup, "bitrate"):
			config.plugins.transcodingsetup.bitrate.addNotifier(self.setBitrate)
		if hasattr(config.plugins.transcodingsetup, "framerate"):
コード例 #14
0
from Components.Label import Label
from Components.SelectionList import SelectionList
from Components.MenuList import MenuList
from ServiceReference import ServiceReference
from Plugins.Plugin import PluginDescriptor
from xml.etree.cElementTree import parse as ci_parse
from Tools.XMLTools import elementsWithTag, mergeText, stringToXML
from enigma import *
from os import system, path as os_path
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from __init__ import _
global ListChange
ListChange = None
config.Volume = ConfigSubsection()
config.Volume.Enabled = ConfigYesNo(default=False)
config.Volume.AC3_vol = ConfigInteger(default=10, limits=(0, 99))


class Volume_adjust(Screen):
    skin = """
		<screen position="center,center" size="595,456" title="Volume Adjust" >
			<widget name="ServiceList.desc" position="10,30" size="575,22" font="Regular;20" />
			<widget name="ServiceList" position="10,70" size="575,250" scrollbarMode="showOnDemand" />
			<ePixmap position="10,330" size="575,2" pixmap="skin_default/div-h.png" transparent="1" alphatest="on" />
			<ePixmap position="10,400" size="575,2" pixmap="skin_default/div-h.png" transparent="1" alphatest="on" />
			<widget source="press_menu" render="Label" position="10,330" zPosition="1" size="575,70" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
			<eLabel backgroundColor="red" position="10,447" size="140,3" zPosition="0" />
			<eLabel backgroundColor="green" position="155,447" size="140,3" zPosition="0" />
			<eLabel backgroundColor="yellow" position="300,447" size="140,3" zPosition="0" />
			<eLabel backgroundColor="blue" position="445,447" size="140,3" zPosition="0" />
			<widget source="key_red" render="Label" position="10,425" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
コード例 #15
0
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Button import Button
from Screens.Screen import Screen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigYesNo, ConfigText, getConfigListEntry
from Components.ConfigList import ConfigListScreen

config.plugins.CDInfo = ConfigSubsection()
config.plugins.CDInfo.useCDTEXT = ConfigYesNo(default=True)
config.plugins.CDInfo.useCDDB = ConfigYesNo(default=True)
config.plugins.CDInfo.displayString = ConfigText("$i - $t ($a)",
                                                 fixed_size=False)
config.plugins.CDInfo.preferCDDB = ConfigYesNo(default=False)
config.plugins.CDInfo.CDDB_server = ConfigText("gnudb.gnudb.org",
                                               fixed_size=False)
config.plugins.CDInfo.CDDB_port = ConfigInteger(8880, limits=(1, 65536))
config.plugins.CDInfo.CDDB_timeout = ConfigInteger(20, limits=(-1, 60))
config.plugins.CDInfo.CDDB_cache = ConfigYesNo(default=True)


class CDInfo(ConfigListScreen, Screen):
    skin = """
		<screen position="90,95" size="560,430" title="CDInfo" >
			<ePixmap pixmap="buttons/red.png" position="0,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/green.png" position="140,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
			<widget name="key_red" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
			<widget name="key_green" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
			<widget name="key_blue" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
			<widget name="info" position="20,50" size="520,40" font="Regular;20" transparent="1" />
			<widget name="config" position="20,120" size="520,200" scrollbarMode="showOnDemand" />
コード例 #16
0
class TimerEntry(Screen, ConfigListScreen):
	def __init__(self, session, timer):
		Screen.__init__(self, session)
		self.timer = timer

		self.entryDate = None
		self.entryService = None

		self["HelpWindow"] = Pixmap()
		self["HelpWindow"].hide()

		self["oktext"] = Label(_("OK"))
		self["canceltext"] = Label(_("Cancel"))
		self["ok"] = Pixmap()
		self["cancel"] = Pixmap()

		self.createConfig()

		self["actions"] = NumberActionMap(["SetupActions", "GlobalActions", "PiPSetupActions"],
		{
			"ok": self.keySelect,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"volumeUp": self.incrementStart,
			"volumeDown": self.decrementStart,
			"size+": self.incrementEnd,
			"size-": self.decrementEnd
		}, -2)

		self.list = []
		ConfigListScreen.__init__(self, self.list, session = session)
		self.setTitle(_("PowerManager entry"))
		self.createSetup("config")

	def createConfig(self):
		afterevent = {
			AFTEREVENT.NONE: "nothing",
			AFTEREVENT.WAKEUPTOSTANDBY: "wakeuptostandby",
			AFTEREVENT.STANDBY: "standby",
			AFTEREVENT.DEEPSTANDBY: "deepstandby"
			}[self.timer.afterEvent]

		timertype = {
			TIMERTYPE.WAKEUP: "wakeup",
			TIMERTYPE.WAKEUPTOSTANDBY: "wakeuptostandby",
			TIMERTYPE.AUTOSTANDBY: "autostandby",
			TIMERTYPE.AUTODEEPSTANDBY: "autodeepstandby",
			TIMERTYPE.STANDBY: "standby",
			TIMERTYPE.DEEPSTANDBY: "deepstandby",
			TIMERTYPE.REBOOT: "reboot",
			TIMERTYPE.RESTART: "restart"
			}[self.timer.timerType]

		weekday_table = ("mon", "tue", "wed", "thu", "fri", "sat", "sun")

		# calculate default values
		day = []
		weekday = 0
		for x in (0, 1, 2, 3, 4, 5, 6):
			day.append(0)
		if self.timer.repeated: # repeated
			type = "repeated"
			if self.timer.repeated == 31: # Mon-Fri
				repeated = "weekdays"
			elif self.timer.repeated == 127: # daily
				repeated = "daily"
			else:
				flags = self.timer.repeated
				repeated = "user"
				count = 0
				for x in (0, 1, 2, 3, 4, 5, 6):
					if flags == 1: # weekly
						print "Set to weekday " + str(x)
						weekday = x
					if flags & 1 == 1: # set user defined flags
						day[x] = 1
						count += 1
					else:
						day[x] = 0
					flags >>= 1
				if count == 1:
					repeated = "weekly"
		else: # once
			type = "once"
			repeated = None
			weekday = int(strftime("%u", localtime(self.timer.begin))) - 1
			day[weekday] = 1

		autosleepinstandbyonly = self.timer.autosleepinstandbyonly
		autosleepdelay = self.timer.autosleepdelay
		autosleeprepeat = self.timer.autosleeprepeat

		if SystemInfo["DeepstandbySupport"]:
			shutdownString = _("go to deep standby")
		else:
			shutdownString = _("shut down")
		self.timerentry_timertype = ConfigSelection(choices = [("wakeup", _("wakeup")),("wakeuptostandby", _("wakeup to standby")), ("autostandby", _("auto standby")), ("autodeepstandby", _("auto deepstandby")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("reboot", _("reboot system")), ("restart", _("restart GUI"))], default = timertype)
		self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("wakeuptostandby", _("wakeup to standby")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("nothing", _("do nothing"))], default = afterevent)
		self.timerentry_type = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = type)

		self.timerentry_repeated = ConfigSelection(default = repeated, choices = [("daily", _("daily")), ("weekly", _("weekly")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))])
		self.timerrntry_autosleepdelay = ConfigInteger(default=autosleepdelay, limits = (10, 300))
		self.timerentry_autosleeprepeat = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = autosleeprepeat)
		self.timerrntry_autosleepinstandbyonly = ConfigSelection(choices = [("yes",_("Yes")), ("no", _("No"))],default=autosleepinstandbyonly)

		self.timerentry_date = ConfigDateTime(default = self.timer.begin, formatstring = _("%d.%B %Y"), increment = 86400)
		self.timerentry_starttime = ConfigClock(default = self.timer.begin)
		self.timerentry_endtime = ConfigClock(default = self.timer.end)
		self.timerentry_showendtime = ConfigSelection(default = (((self.timer.end - self.timer.begin) /60 ) > 1), choices = [(True, _("yes")), (False, _("no"))])

		self.timerentry_repeatedbegindate = ConfigDateTime(default = self.timer.repeatedbegindate, formatstring = _("%d.%B %Y"), increment = 86400)

		self.timerentry_weekday = ConfigSelection(default = weekday_table[weekday], choices = [("mon",_("Monday")), ("tue", _("Tuesday")), ("wed",_("Wednesday")), ("thu", _("Thursday")), ("fri", _("Friday")), ("sat", _("Saturday")), ("sun", _("Sunday"))])

		self.timerentry_day = ConfigSubList()
		for x in (0, 1, 2, 3, 4, 5, 6):
			self.timerentry_day.append(ConfigYesNo(default = day[x]))

	def createSetup(self, widget):
		self.list = []
		self.timerType = getConfigListEntry(_("Timer type"), self.timerentry_timertype)
		self.list.append(self.timerType)


		if self.timerentry_timertype.getValue() == "autostandby" or self.timerentry_timertype.getValue() == "autodeepstandby":
			if self.timerentry_timertype.getValue() == "autodeepstandby":
				self.list.append(getConfigListEntry(_("Only active when in standby"), self.timerrntry_autosleepinstandbyonly))
			self.list.append(getConfigListEntry(_("Sleep delay"), self.timerrntry_autosleepdelay))
			self.list.append(getConfigListEntry(_("Repeat type"), self.timerentry_autosleeprepeat))
			self.timerTypeEntry = getConfigListEntry(_("Repeat type"), self.timerentry_type)
			self.entryShowEndTime = getConfigListEntry(_("Set end time"), self.timerentry_showendtime)
			self.frequencyEntry = getConfigListEntry(_("Repeats"), self.timerentry_repeated)
		else:
			self.timerTypeEntry = getConfigListEntry(_("Repeat type"), self.timerentry_type)
			self.list.append(self.timerTypeEntry)

			if self.timerentry_type.getValue() == "once":
				self.frequencyEntry = None
			else: # repeated
				self.frequencyEntry = getConfigListEntry(_("Repeats"), self.timerentry_repeated)
				self.list.append(self.frequencyEntry)
				self.repeatedbegindateEntry = getConfigListEntry(_("Starting on"), self.timerentry_repeatedbegindate)
				self.list.append(self.repeatedbegindateEntry)
				if self.timerentry_repeated.getValue() == "daily":
					pass
				if self.timerentry_repeated.getValue() == "weekdays":
					pass
				if self.timerentry_repeated.getValue() == "weekly":
					self.list.append(getConfigListEntry(_("Weekday"), self.timerentry_weekday))

				if self.timerentry_repeated.getValue() == "user":
					self.list.append(getConfigListEntry(_("Monday"), self.timerentry_day[0]))
					self.list.append(getConfigListEntry(_("Tuesday"), self.timerentry_day[1]))
					self.list.append(getConfigListEntry(_("Wednesday"), self.timerentry_day[2]))
					self.list.append(getConfigListEntry(_("Thursday"), self.timerentry_day[3]))
					self.list.append(getConfigListEntry(_("Friday"), self.timerentry_day[4]))
					self.list.append(getConfigListEntry(_("Saturday"), self.timerentry_day[5]))
					self.list.append(getConfigListEntry(_("Sunday"), self.timerentry_day[6]))

			self.entryDate = getConfigListEntry(_("Date"), self.timerentry_date)
			if self.timerentry_type.getValue() == "once":
				self.list.append(self.entryDate)

			self.entryStartTime = getConfigListEntry(_("Start time"), self.timerentry_starttime)
			self.list.append(self.entryStartTime)

			self.entryShowEndTime = getConfigListEntry(_("Set end time"), self.timerentry_showendtime)
			self.list.append(self.entryShowEndTime)
			self.entryEndTime = getConfigListEntry(_("End time"), self.timerentry_endtime)
			if self.timerentry_showendtime.getValue():
				self.list.append(self.entryEndTime)

			self.list.append(getConfigListEntry(_("After event"), self.timerentry_afterevent))

		self[widget].list = self.list
		self[widget].l.setList(self.list)

	def newConfig(self):
		if self["config"].getCurrent() in (self.timerType, self.timerTypeEntry, self.frequencyEntry, self.entryShowEndTime):
			self.createSetup("config")

	def keyLeft(self):
		ConfigListScreen.keyLeft(self)
		self.newConfig()

	def keyRight(self):
		ConfigListScreen.keyRight(self)
		self.newConfig()

	def keySelect(self):
		cur = self["config"].getCurrent()
		self.keyGo()

	def getTimestamp(self, date, mytime):
		d = localtime(date)
		dt = datetime(d.tm_year, d.tm_mon, d.tm_mday, mytime[0], mytime[1])
		return int(mktime(dt.timetuple()))

	def getBeginEnd(self):
		date = self.timerentry_date.getValue()
		endtime = self.timerentry_endtime.getValue()
		starttime = self.timerentry_starttime.getValue()

		begin = self.getTimestamp(date, starttime)
		end = self.getTimestamp(date, endtime)

		# if the endtime is less than the starttime, add 1 day.
		if end < begin:
			end += 86400

		return begin, end

	def keyGo(self, result = None):
		if not self.timerentry_showendtime.getValue():
			self.timerentry_endtime.value = self.timerentry_starttime.getValue()

		self.timer.resetRepeated()
		self.timer.timerType = {
			"wakeup": TIMERTYPE.WAKEUP,
			"wakeuptostandby": TIMERTYPE.WAKEUPTOSTANDBY,
			"autostandby": TIMERTYPE.AUTOSTANDBY,
			"autodeepstandby": TIMERTYPE.AUTODEEPSTANDBY,
			"standby": TIMERTYPE.STANDBY,
			"deepstandby": TIMERTYPE.DEEPSTANDBY,
			"reboot": TIMERTYPE.REBOOT,
			"restart": TIMERTYPE.RESTART
			}[self.timerentry_timertype.value]
		self.timer.afterEvent = {
			"nothing": AFTEREVENT.NONE,
			"wakeuptostandby": AFTEREVENT.WAKEUPTOSTANDBY,
			"standby": AFTEREVENT.STANDBY,
			"deepstandby": AFTEREVENT.DEEPSTANDBY
			}[self.timerentry_afterevent.value]

		if self.timerentry_type.getValue() == "once":
			self.timer.begin, self.timer.end = self.getBeginEnd()

		if self.timerentry_timertype.getValue() == "autostandby" or self.timerentry_timertype.getValue() == "autodeepstandby":
			self.timer.begin = int(time()) + 10
			self.timer.end = self.timer.begin
			self.timer.autosleepinstandbyonly = self.timerrntry_autosleepinstandbyonly.getValue()
			self.timer.autosleepdelay = self.timerrntry_autosleepdelay.getValue()
			self.timer.autosleeprepeat = self.timerentry_autosleeprepeat.getValue()
		if self.timerentry_type.getValue() == "repeated":
			if self.timerentry_repeated.getValue() == "daily":
				for x in (0, 1, 2, 3, 4, 5, 6):
					self.timer.setRepeated(x)

			if self.timerentry_repeated.getValue() == "weekly":
				self.timer.setRepeated(self.timerentry_weekday.index)

			if self.timerentry_repeated.getValue() == "weekdays":
				for x in (0, 1, 2, 3, 4):
					self.timer.setRepeated(x)

			if self.timerentry_repeated.getValue() == "user":
				for x in (0, 1, 2, 3, 4, 5, 6):
					if self.timerentry_day[x].getValue():
						self.timer.setRepeated(x)

			self.timer.repeatedbegindate = self.getTimestamp(self.timerentry_repeatedbegindate.getValue(), self.timerentry_starttime.getValue())
			if self.timer.repeated:
				self.timer.begin = self.getTimestamp(self.timerentry_repeatedbegindate.getValue(), self.timerentry_starttime.getValue())
				self.timer.end = self.getTimestamp(self.timerentry_repeatedbegindate.getValue(), self.timerentry_endtime.getValue())
			else:
				self.timer.begin = self.getTimestamp(time.time(), self.timerentry_starttime.getValue())
				self.timer.end = self.getTimestamp(time.time(), self.timerentry_endtime.getValue())

			# when a timer end is set before the start, add 1 day
			if self.timer.end < self.timer.begin:
				self.timer.end += 86400

		self.saveTimer()
		self.close((True, self.timer))

	def incrementStart(self):
		self.timerentry_starttime.increment()
		self["config"].invalidate(self.entryStartTime)
		if self.timerentry_type.value == "once" and self.timerentry_starttime.value == [0, 0]:
			self.timerentry_date.value += 86400
			self["config"].invalidate(self.entryDate)

	def decrementStart(self):
		self.timerentry_starttime.decrement()
		self["config"].invalidate(self.entryStartTime)
		if self.timerentry_type.value == "once" and self.timerentry_starttime.value == [23, 59]:
			self.timerentry_date.value -= 86400
			self["config"].invalidate(self.entryDate)

	def incrementEnd(self):
		if self.entryEndTime is not None:
			self.timerentry_endtime.increment()
			self["config"].invalidate(self.entryEndTime)

	def decrementEnd(self):
		if self.entryEndTime is not None:
			self.timerentry_endtime.decrement()
			self["config"].invalidate(self.entryEndTime)

	def saveTimer(self):
		self.session.nav.PowerTimer.saveTimer()

	def keyCancel(self):
		self.close((False,))
コード例 #17
0
# not used redmond -> original , trontastic , ui-lightness
THEMES = [
    'original', 'base', 'black-tie', 'blitzer', 'clear', 'cupertino',
    'dark-hive', 'dot-luv', 'eggplant', 'excite-bike', 'flick', 'hot-sneaks',
    'humanity', 'le-frog', 'mint-choc', 'overcast', 'pepper-grinder',
    'smoothness', 'south-street', 'start', 'sunny', 'swanky-purse',
    'ui-darkness', 'vader', 'original-small-screen'
]

config.OpenWebif = ConfigSubsection()
config.OpenWebif.enabled = ConfigYesNo(default=True)
config.OpenWebif.identifier = ConfigYesNo(default=True)
config.OpenWebif.identifier_custom = ConfigYesNo(default=False)
config.OpenWebif.identifier_text = ConfigText(default="", fixed_size=False)
config.OpenWebif.port = ConfigInteger(default=80, limits=(1, 65535))
config.OpenWebif.streamport = ConfigInteger(default=8001, limits=(1, 65535))
config.OpenWebif.auth = ConfigYesNo(default=False)
config.OpenWebif.xbmcservices = ConfigYesNo(default=False)
config.OpenWebif.webcache = ConfigSubsection()
# FIXME: anything better than a ConfigText?
config.OpenWebif.webcache.collapsedmenus = ConfigText(default="",
                                                      fixed_size=False)
config.OpenWebif.webcache.zapstream = ConfigYesNo(default=False)
config.OpenWebif.webcache.theme = ConfigSelection(default='original',
                                                  choices=THEMES)
config.OpenWebif.webcache.moviesort = ConfigSelection(
    default='name', choices=['name', 'named', 'date', 'dated'])
config.OpenWebif.webcache.showpicons = ConfigYesNo(default=True)
config.OpenWebif.webcache.moviedb = ConfigSelection(
    default=EXT_EVENT_INFO_SOURCE,
コード例 #18
0
ファイル: plugin.py プロジェクト: sklnet/beyonwiz-enigma2
from Components.Label import Label
from Components.Language import language
from Components.MenuList import MenuList
from Components.MultiContent import MultiContentEntryText
from Components.Sources.StaticText import StaticText
from Screens.ChannelSelection import ChannelSelection
from Screens.Screen import Screen
from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS
from Tools.BoundFunction import boundFunction
from Plugins.Plugin import PluginDescriptor
from enigma import eListboxPythonMultiContent, eServiceCenter, gFont, fontRenderClass, RT_HALIGN_LEFT, RT_VALIGN_CENTER
from os import environ
config.plugins.ZapHistoryConfigurator = ConfigSubsection()
config.plugins.ZapHistoryConfigurator.enable_zap_history = ConfigYesNo(
    default=True)
config.plugins.ZapHistoryConfigurator.maxEntries_zap_history = ConfigInteger(
    default=20, limits=(1, 60))


def addToHistory(instance, ref):
    if not config.plugins.ZapHistoryConfigurator.enable_zap_history.value:
        return
    if instance.servicePath is not None:
        if instance.history_pos < len(instance.history):
            path = instance.history[instance.history_pos][:]
            historyref = path.pop()
            if historyref == ref:
                return
        if instance.servicePath is not None:
            tmp = instance.servicePath[:]
            tmp.append(ref)
            try:
コード例 #19
0
ファイル: plugin.py プロジェクト: VytenisP/enigma2-plugins-1
from os import system as os_system
from time import time, gmtime, strftime
from twisted.web.client import getPage
from xml.dom.minidom import parse, parseString
from urllib import urlencode

import timer
import xml.etree.cElementTree
import Screens.Standby

##############################
#####  CONFIG SETTINGS   #####
##############################
config.plugins.tvcharts = ConfigSubsection()
config.plugins.tvcharts.enabled = ConfigYesNo(default=True)
config.plugins.tvcharts.maxentries = ConfigInteger(default=10, limits=(5, 100))
config.plugins.tvcharts.maxtimerentries = ConfigInteger(default=10,
                                                        limits=(5, 100))
config.plugins.tvcharts.submittimers = ConfigYesNo(default=True)
config.plugins.tvcharts.submitplugins = ConfigYesNo(default=True)
config.plugins.tvcharts.bouquetfilter = ConfigYesNo(default=True)

##########################################################
session = []


#Channellist Menu Entry
class ChannelListMenu(MenuList):
    def __init__(self, list, enableWrapAround=False):
        MenuList.__init__(self, list, enableWrapAround,
                          eListboxPythonMultiContent)
コード例 #20
0
from __future__ import absolute_import
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry

config.plugins.VideoClippingSetup = ConfigSubsection()
config.plugins.VideoClippingSetup.clip_left = ConfigInteger(default=0)
config.plugins.VideoClippingSetup.clip_width = ConfigInteger(default=720)
config.plugins.VideoClippingSetup.clip_top = ConfigInteger(default=0)
config.plugins.VideoClippingSetup.clip_height = ConfigInteger(default=576)


class VideoClippingCoordinates(Screen, ConfigListScreen):
    skin = """
	<screen position="0,0" size="e,e" title="Video clipping setup" backgroundColor="transparent">
		<widget name="config" position="c-175,c-75" size="350,150" foregroundColor="black" backgroundColor="transparent" />
		<ePixmap pixmap="buttons/green.png" position="c-145,e-100" zPosition="0" size="140,40" alphatest="on" />
		<ePixmap pixmap="buttons/red.png" position="c+5,e-100" zPosition="0" size="140,40" alphatest="on" />
		<widget name="ok" position="c-145,e-100" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;20" transparent="1" backgroundColor="green" />
		<widget name="cancel" position="c+5,e-100" size="140,40" valign="center" halign="center" zPosition="1" font="Regular;20" transparent="1" backgroundColor="red" />
	</screen>"""

    def __init__(self, session):
        self.skin = VideoClippingCoordinates.skin
        Screen.__init__(self, session)

        from Components.ActionMap import ActionMap
        from Components.Button import Button

        self["ok"] = Button(_("OK"))
        self["cancel"] = Button(_("Cancel"))
コード例 #21
0
# highest priority is loaded last, usually the user-provided
# skin.

# currently, loadSingleSkinData (colors, bordersets etc.)
# are applied one-after-each, in order of ascending priority.
# the dom_skin will keep all screens in descending priority,
# so the first screen found will be used.

# example: loadSkin("nemesis_greenline/skin.xml")
config.skin = ConfigSubsection()
DEFAULT_SKIN = "skin.xml"
if not fileExists(resolveFilename(SCOPE_SKIN, DEFAULT_SKIN)):
    # in that case, fallback to Magic (which is an SD skin)
    DEFAULT_SKIN = "Magic/skin.xml"
config.skin.primary_skin = ConfigText(default=DEFAULT_SKIN)
config.skin.xres = ConfigInteger(default=0)

profile("LoadSkin")
res = None
name = skin_user_skinname()
if name:
    res = addSkin(name, SCOPE_CONFIG)
if not name or not res:
    addSkin('skin_user.xml', SCOPE_CONFIG)

# some boxes lie about their dimensions
addSkin('skin_box.xml')
# add optional discrete second infobar
addSkin('skin_second_infobar.xml')
display_skin_id = 1
addSkin('skin_display.xml')
コード例 #22
0
ファイル: plugin.py プロジェクト: blinkosm/enigma2-2
from Components.Sources.StaticText import StaticText
from Components.FileList import FileList
from Components.AVSwitch import AVSwitch
from Components.Sources.List import List
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigOnOff, getConfigListEntry

from skin import componentSizes, TemplatedListFonts


def getScale():
    return AVSwitch().getFramebufferScale()


config.pic = ConfigSubsection()
config.pic.framesize = ConfigInteger(default=30, limits=(0, 99))
config.pic.slidetime = ConfigInteger(default=10, limits=(5, 60))
config.pic.resize = ConfigSelection(default="2",
                                    choices=[("0", _("simple")),
                                             ("1", _("better")),
                                             ("2", _("fast JPEG"))])
config.pic.resize.value = 2  # 2 = fast JPEG (non JPEG fallback to 1)
config.pic.cache = ConfigOnOff(default=True)
config.pic.lastDir = ConfigText(default=resolveFilename(SCOPE_MEDIA))
config.pic.infoline = ConfigOnOff(default=True)
config.pic.loop = ConfigOnOff(default=True)
config.pic.bgcolor = ConfigSelection(default="#00000000",
                                     choices=[("#00000000", _("black")),
                                              ("#009eb9ff", _("blue")),
                                              ("#00ff5a51", _("red")),
                                              ("#00ffe875", _("yellow")),
コード例 #23
0
from Components.Sources.List import List
from Components.Pixmap import Pixmap
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.Console import Console
from os import system, listdir, rename, symlink, unlink, path, mkdir
from time import sleep

config.infopanel = ConfigSubsection()
config.infopanel.cronmanager_commandtype = NoSave(ConfigSelection(choices = [ ('custom',_("Custom")),('predefined',_("Predefined")) ]))
config.infopanel.cronmanager_cmdtime = NoSave(ConfigClock(default=0))
config.infopanel.cronmanager_cmdtime.value, mytmpt = ([0, 0], [0, 0])
config.infopanel.cronmanager_user_command = NoSave(ConfigText(fixed_size=False))
config.infopanel.cronmanager_runwhen = NoSave(ConfigSelection(default='Daily', choices = [('Hourly', _("Hourly")),('Daily', _("Daily")),('Weekly', _("Weekly")),('Monthly', _("Monthly"))]))
config.infopanel.cronmanager_dayofweek = NoSave(ConfigSelection(default='Monday', choices = [('Monday', _("Monday")),('Tuesday', _("Tuesday")),('Wednesday', _("Wednesday")),('Thursday', _("Thursday")),('Friday', _("Friday")),('Saturday', _("Saturday")),('Sunday', _("Sunday"))]))
config.infopanel.cronmanager_dayofmonth = NoSave(ConfigInteger(default=1, limits=(1, 31)))

class CronManager(Screen):
	skin = """
		<screen position="center,center" size="590,400" title="Cron Manager">
			<widget name="lab1" position="10,0" size="100,24" font="Regular;20" valign="center" transparent="0" />
			<widget name="labdisabled" position="110,0" size="100,24" font="Regular;20" valign="center" halign="center" backgroundColor="red" zPosition="1" />
			<widget name="labactive" position="110,0" size="100,24" font="Regular;20" valign="center" halign="center" backgroundColor="green" zPosition="2" />
			<widget name="lab2" position="240,0" size="150,24" font="Regular;20" valign="center" transparent="0" />
			<widget name="labstop" position="390,0" size="100,24" font="Regular;20" valign="center" halign="center" backgroundColor="red" zPosition="1" />
			<widget name="labrun" position="390,0" size="100,24" font="Regular;20" valign="center" halign="center" backgroundColor="green" zPosition="2"/>
			<widget source="list" render="Listbox" position="10,35" size="540,325" scrollbarMode="showOnDemand" >
				<convert type="StringList" />
			</widget>
			<ePixmap pixmap="skin_default/buttons/red.png" position="0,350" size="140,40" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/yellow.png" position="150,350" size="140,40" alphatest="on" />
コード例 #24
0
choicelist = []
for i in range(1000, 50000, 1000):
    choicelist.append(("%d" % i, "%d ms" % i))
config.plugins.archivCZSK.videoPlayer.rtmpBuffer = ConfigSelection(
    default="10000", choices=choicelist)

############ Main config #################

config.plugins.archivCZSK.main_menu = ConfigYesNo(default=True)
config.plugins.archivCZSK.extensions_menu = ConfigYesNo(default=False)
config.plugins.archivCZSK.epg_menu = ConfigYesNo(default=True)
config.plugins.archivCZSK.archivAutoUpdate = ConfigYesNo(default=True)
config.plugins.archivCZSK.autoUpdate = ConfigYesNo(default=True)
config.plugins.archivCZSK.preload = ConfigYesNo(default=True)
config.plugins.archivCZSK.lastIconDShowMessage = ConfigInteger(0)

skinChoices = [
    os.path.splitext(fname)[0] for fname in os.listdir(SKIN_PATH)
    if fname.endswith('.xml')
]
skinChoices.append('auto')
config.plugins.archivCZSK.skin = ConfigSelection(default="auto",
                                                 choices=skinChoices)
config.plugins.archivCZSK.showVideoInfo = ConfigYesNo(default=True)
config.plugins.archivCZSK.downloadPoster = ConfigYesNo(default=True)
choicelist = []
#choicelist.append(("%d" % 0, "%d" % 0))
for i in range(0, 310, 10):
    choicelist.append(("%d" % i, "%d" % i))
config.plugins.archivCZSK.posterImageMax = ConfigSelection(default="10",
コード例 #25
0
ファイル: ui.py プロジェクト: trunca/novale-viejo
from Components.Sources.StaticText import StaticText
from Components.FileList import FileList
from Components.AVSwitch import AVSwitch
from Components.Sources.List import List
from Components.ConfigList import ConfigList, ConfigListScreen

from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigYesNo, KEY_LEFT, KEY_RIGHT, KEY_0, getConfigListEntry
import skin


def getScale():
    return AVSwitch().getFramebufferScale()


config.pic = ConfigSubsection()
config.pic.framesize = ConfigInteger(default=30, limits=(5, 99))
config.pic.slidetime = ConfigInteger(default=10, limits=(1, 60))
config.pic.resize = ConfigSelection(default="1",
                                    choices=[("0", _("simple")),
                                             ("1", _("better"))])
config.pic.cache = ConfigYesNo(default=True)
config.pic.lastDir = ConfigText(default=resolveFilename(SCOPE_MEDIA))
config.pic.infoline = ConfigYesNo(default=True)
config.pic.loop = ConfigYesNo(default=True)
config.pic.bgcolor = ConfigSelection(default="#00000000",
                                     choices=[("#00000000", _("black")),
                                              ("#009eb9ff", _("blue")),
                                              ("#00ff5a51", _("red")),
                                              ("#00ffe875", _("yellow")),
                                              ("#0038FF48", _("green"))])
config.pic.textcolor = ConfigSelection(default="#0038FF48",
コード例 #26
0
                                 self.hdList)

    def ok(self):
        if self["scan"].isDone():
            self.close()

    def cancel(self):
        self.close()


config.plugins.CableScan = ConfigSubsection()
config.plugins.CableScan.keepnumbering = ConfigYesNo(default=False)
config.plugins.CableScan.hdlist = ConfigYesNo(default=False)
config.plugins.CableScan.frequency = ConfigFloat(default=[323, 0],
                                                 limits=[(50, 999), (0, 999)])
config.plugins.CableScan.symbolrate = ConfigInteger(default=6875,
                                                    limits=(1, 9999))
config.plugins.CableScan.networkid = ConfigInteger(default=0,
                                                   limits=(0, 99999))
config.plugins.CableScan.modulation = ConfigSelection(
    choices=[(str(eDVBFrontendParametersCable.Modulation_QAM16), "16-QAM"),
             (str(eDVBFrontendParametersCable.Modulation_QAM32), "32-QAM"),
             (str(eDVBFrontendParametersCable.Modulation_QAM64), "64-QAM"),
             (str(eDVBFrontendParametersCable.Modulation_QAM128), "128-QAM"),
             (str(eDVBFrontendParametersCable.Modulation_QAM256), "256-QAM")],
    default=str(eDVBFrontendParametersCable.Modulation_QAM64))
config.plugins.CableScan.auto = ConfigYesNo(default=True)


class CableScanScreen(ConfigListScreen, Screen):
    skin = """
	<screen position="100,115" size="520,290" title="Cable Scan">
コード例 #27
0
from urllib import quote

from FTPDownloader import FTPDownloader

DIR_ENIGMA2 = '/etc/enigma2/'
DIR_TMP = '/tmp/'

config.plugins.RemoteStreamConverter = ConfigSubsection()
config.plugins.RemoteStreamConverter.address = ConfigText(default="",
                                                          fixed_size=False)
config.plugins.RemoteStreamConverter.ip = ConfigIP(default=[0, 0, 0, 0])
config.plugins.RemoteStreamConverter.username = ConfigText(default="root",
                                                           fixed_size=False)
config.plugins.RemoteStreamConverter.password = ConfigText(default="",
                                                           fixed_size=False)
config.plugins.RemoteStreamConverter.port = ConfigInteger(21, (0, 65535))
config.plugins.RemoteStreamConverter.passive = ConfigYesNo(False)
config.plugins.RemoteStreamConverter.telnetport = ConfigInteger(23, (0, 65535))


class ServerEditor(ConfigListScreen, Screen):
    skin = """
		<screen position="center,center" size="560,230" >
			<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" transparent="1" alphatest="on" />
			<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" transparent="1" alphatest="on" />
			<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
			<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
			<widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
			<widget source="key_blue" render="Label"  position="420,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
コード例 #28
0
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.ActionMap import NumberActionMap
from Components.AVSwitch import AVSwitch
from Components.Pixmap import Pixmap
from Components.MenuList import MenuList
from Components.Label import Label
from Tools.Directories import fileExists
from enigma import ePicLoad, getDesktop, eEnv
from os import system as os_system
from Components.config import config, ConfigSubsection, ConfigText, ConfigInteger

config.plugins.ORFteletext = ConfigSubsection()
config.plugins.ORFteletext.startHZ = ConfigInteger(default=100)
config.plugins.ORFteletext.startNZ = ConfigInteger(default=1)
config.plugins.ORFteletext.adr = ConfigText(default="ORF")


def Plugins(**kwargs):
    return [
        PluginDescriptor(name="ORF-Teletext",
                         description=_("ORF-Teletext"),
                         where=PluginDescriptor.WHERE_EXTENSIONSMENU,
                         fnc=main),
    ]


def main(session, **kwargs):
    session.open(ORFteletextScreen)
コード例 #29
0
ファイル: plugin.py プロジェクト: xmasmc/enigma2-plugins
from Components.Pixmap import Pixmap
from enigma import ePicLoad, eRect, eSize, gPixmapPtr
from Components.AVSwitch import AVSwitch
from Components.config import ConfigSubsection, ConfigSubList, ConfigInteger, config
from setup import initConfig, MSNWeatherPluginEntriesListConfigScreen
from MSNWeather import MSNWeather
import time

try:
    from Components.WeatherMSN import weathermsn
    WeatherMSNComp = weathermsn
except:
    WeatherMSNComp = None

config.plugins.WeatherPlugin = ConfigSubsection()
config.plugins.WeatherPlugin.entrycount = ConfigInteger(0)
config.plugins.WeatherPlugin.Entry = ConfigSubList()
initConfig()


def main(session, **kwargs):
    session.open(MSNWeatherPlugin)


def Plugins(**kwargs):
    list = [
        PluginDescriptor(name=_("Weather Plugin"),
                         description=_("Show Weather Forecast"),
                         where=[
                             PluginDescriptor.WHERE_PLUGINMENU,
                             PluginDescriptor.WHERE_EXTENSIONSMENU
コード例 #30
0
ファイル: plugin.py プロジェクト: EB-TNAP/alliance-plugins
from Components.ConfigList import ConfigListScreen
from Screens.MessageBox import MessageBox
from Screens.ServiceScan import ServiceScan

from Tools.BoundFunction import boundFunction

from enigma import eComponentScan

from .TerrestrialScan import TerrestrialScan, setParams
from .MakeBouquet import MakeBouquet

import os

config.plugins.TerrestrialScan = ConfigSubsection()
config.plugins.TerrestrialScan.networkid_bool = ConfigYesNo(default=False)
config.plugins.TerrestrialScan.networkid = ConfigInteger(default=0,
                                                         limits=(0, 65535))
config.plugins.TerrestrialScan.clearallservices = ConfigYesNo(default=True)
config.plugins.TerrestrialScan.onlyfree = ConfigYesNo(default=True)
uhf_vhf_choices = [('uhf', _("UHF Europe")), ('uhf_vhf', _("UHF/VHF Europe")),
                   ('australia', _("Australia generic"))]
if nimmanager.getTerrestrialsList(
):  # check transponders are available from terrestrial.xml
    uhf_vhf_choices.append(('xml', _("From XML")))
config.plugins.TerrestrialScan.uhf_vhf = ConfigSelection(
    default='uhf', choices=uhf_vhf_choices)
config.plugins.TerrestrialScan.makebouquet = ConfigYesNo(default=True)
config.plugins.TerrestrialScan.makeradiobouquet = ConfigYesNo(default=False)
config.plugins.TerrestrialScan.makexmlfile = ConfigYesNo(default=False)
config.plugins.TerrestrialScan.lcndescriptor = ConfigSelection(
    default=0x83, choices=[(0x83, "0x83"), (0x87, "0x87")])
config.plugins.TerrestrialScan.channel_list_id = ConfigInteger(default=0,
コード例 #31
0
 def initConfigList(self, element=None):
     try:
         self.properties.position = ConfigInteger(
             default=self.title_idx + 1,
             limits=(1, len(self.project.titles)))
         title = self.project.titles[self.title_idx]
         self.list = []
         self.list.append(
             getConfigListEntry("DVD " + _("Track"),
                                self.properties.position))
         self.list.append(
             getConfigListEntry("DVD " + _("Title"),
                                self.properties.menutitle))
         self.list.append(
             getConfigListEntry("DVD " + _("Description"),
                                self.properties.menusubtitle))
         if config.usage.setup_level.index >= 2:  # expert+
             for audiotrack in self.properties.audiotracks:
                 DVB_aud = audiotrack.DVB_lang.value or audiotrack.pid.value
                 self.list.append(
                     getConfigListEntry(
                         _("Burn audio track (%s)") % DVB_aud,
                         audiotrack.active))
                 if audiotrack.active.value:
                     self.list.append(
                         getConfigListEntry(
                             _("Audio track (%s) format") % DVB_aud,
                             audiotrack.format))
                     self.list.append(
                         getConfigListEntry(
                             _("Audio track (%s) language") % DVB_aud,
                             audiotrack.language))
             self.list.append(
                 getConfigListEntry("DVD " + _("Aspect ratio"),
                                    self.properties.aspect))
             if self.properties.aspect.value == "16:9":
                 self.list.append(
                     getConfigListEntry("DVD " + "widescreen",
                                        self.properties.widescreen))
             else:
                 self.list.append(
                     getConfigListEntry("DVD " + "widescreen",
                                        self.properties.crop))
         if len(title.chaptermarks) == 0:
             self.list.append(
                 getConfigListEntry(
                     _("Auto chapter split every ? minutes (0=never)"),
                     self.properties.autochapter))
         infotext = "DVB " + _("Title") + ': ' + title.DVBname + "\n" + _(
             "Description") + ': ' + title.DVBdescr + "\n" + _(
                 "Channel") + ': ' + title.DVBchannel + '\n' + _(
                     "Start time") + title.formatDVDmenuText(
                         ": $D.$M.$Y, $T\n", self.title_idx + 1)
         chaptermarks = title.getChapterMarks(template="$h:$m:$s")
         chapters_count = len(chaptermarks)
         if chapters_count >= 1:
             infotext += str(chapters_count +
                             1) + ' ' + _("chapters") + ': '
             infotext += ' / '.join(chaptermarks)
         self["serviceinfo"].setText(infotext)
         self["config"].setList(self.list)
     except AttributeError:
         pass
コード例 #32
0
profile("LOAD:skin")
from skin import readSkin

profile("LOAD:Tools")
from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_SKIN

InitFallbackFiles()

profile("config.misc")
config.misc.radiopic = ConfigText(
    default=resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi"))
config.misc.blackradiopic = ConfigText(
    default=resolveFilename(SCOPE_CURRENT_SKIN, "black.mvi"))
config.misc.useTransponderTime = ConfigYesNo(default=True)
config.misc.startCounter = ConfigInteger(default=0)  # number of e2 starts...
config.misc.standbyCounter = NoSave(
    ConfigInteger(default=0))  # number of standby
config.misc.DeepStandby = NoSave(
    ConfigYesNo(default=False))  # detect deepstandby
config.misc.RestartUI = ConfigYesNo(
    default=False)  # detect user interface restart
config.misc.prev_wakeup_time = ConfigInteger(default=0)
#config.misc.prev_wakeup_time_type is only valid when wakeup_time is not 0
config.misc.prev_wakeup_time_type = ConfigInteger(default=0)
# 0 = RecordTimer, 1 = ZapTimer, 2 = Plugins, 3 = WakeupTimer
config.misc.epgcache_filename = ConfigText(default='/etc/enigma2/epg.dat',
                                           fixed_size=False)
config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)
config.misc.SyncTimeUsing = ConfigSelection(default="0",
                                            choices=[("0", "Transponder Time"),
コード例 #33
0
	def createConfig(self):
		afterevent = {
			AFTEREVENT.NONE: "nothing",
			AFTEREVENT.WAKEUPTOSTANDBY: "wakeuptostandby",
			AFTEREVENT.STANDBY: "standby",
			AFTEREVENT.DEEPSTANDBY: "deepstandby"
			}[self.timer.afterEvent]

		timertype = {
			TIMERTYPE.WAKEUP: "wakeup",
			TIMERTYPE.WAKEUPTOSTANDBY: "wakeuptostandby",
			TIMERTYPE.AUTOSTANDBY: "autostandby",
			TIMERTYPE.AUTODEEPSTANDBY: "autodeepstandby",
			TIMERTYPE.STANDBY: "standby",
			TIMERTYPE.DEEPSTANDBY: "deepstandby",
			TIMERTYPE.REBOOT: "reboot",
			TIMERTYPE.RESTART: "restart"
			}[self.timer.timerType]

		weekday_table = ("mon", "tue", "wed", "thu", "fri", "sat", "sun")

		# calculate default values
		day = []
		weekday = 0
		for x in (0, 1, 2, 3, 4, 5, 6):
			day.append(0)
		if self.timer.repeated: # repeated
			type = "repeated"
			if self.timer.repeated == 31: # Mon-Fri
				repeated = "weekdays"
			elif self.timer.repeated == 127: # daily
				repeated = "daily"
			else:
				flags = self.timer.repeated
				repeated = "user"
				count = 0
				for x in (0, 1, 2, 3, 4, 5, 6):
					if flags == 1: # weekly
						print "Set to weekday " + str(x)
						weekday = x
					if flags & 1 == 1: # set user defined flags
						day[x] = 1
						count += 1
					else:
						day[x] = 0
					flags >>= 1
				if count == 1:
					repeated = "weekly"
		else: # once
			type = "once"
			repeated = None
			weekday = int(strftime("%u", localtime(self.timer.begin))) - 1
			day[weekday] = 1

		autosleepinstandbyonly = self.timer.autosleepinstandbyonly
		autosleepdelay = self.timer.autosleepdelay
		autosleeprepeat = self.timer.autosleeprepeat

		if SystemInfo["DeepstandbySupport"]:
			shutdownString = _("go to deep standby")
		else:
			shutdownString = _("shut down")
		self.timerentry_timertype = ConfigSelection(choices = [("wakeup", _("wakeup")),("wakeuptostandby", _("wakeup to standby")), ("autostandby", _("auto standby")), ("autodeepstandby", _("auto deepstandby")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("reboot", _("reboot system")), ("restart", _("restart GUI"))], default = timertype)
		self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("wakeuptostandby", _("wakeup to standby")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("nothing", _("do nothing"))], default = afterevent)
		self.timerentry_type = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = type)

		self.timerentry_repeated = ConfigSelection(default = repeated, choices = [("daily", _("daily")), ("weekly", _("weekly")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))])
		self.timerrntry_autosleepdelay = ConfigInteger(default=autosleepdelay, limits = (10, 300))
		self.timerentry_autosleeprepeat = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = autosleeprepeat)
		self.timerrntry_autosleepinstandbyonly = ConfigSelection(choices = [("yes",_("Yes")), ("no", _("No"))],default=autosleepinstandbyonly)

		self.timerentry_date = ConfigDateTime(default = self.timer.begin, formatstring = _("%d.%B %Y"), increment = 86400)
		self.timerentry_starttime = ConfigClock(default = self.timer.begin)
		self.timerentry_endtime = ConfigClock(default = self.timer.end)
		self.timerentry_showendtime = ConfigSelection(default = (((self.timer.end - self.timer.begin) /60 ) > 1), choices = [(True, _("yes")), (False, _("no"))])

		self.timerentry_repeatedbegindate = ConfigDateTime(default = self.timer.repeatedbegindate, formatstring = _("%d.%B %Y"), increment = 86400)

		self.timerentry_weekday = ConfigSelection(default = weekday_table[weekday], choices = [("mon",_("Monday")), ("tue", _("Tuesday")), ("wed",_("Wednesday")), ("thu", _("Thursday")), ("fri", _("Friday")), ("sat", _("Saturday")), ("sun", _("Sunday"))])

		self.timerentry_day = ConfigSubList()
		for x in (0, 1, 2, 3, 4, 5, 6):
			self.timerentry_day.append(ConfigYesNo(default = day[x]))
コード例 #34
0
ファイル: plugin.py プロジェクト: zilizila/enigma2-plugins
from Components.config import config, ConfigSubsection, ConfigInteger
import os
import keymapparser
from struct import pack
from keyids import KEYIDS

global babelkey
global babeldone
global babelon
babelkey = -1
babeldone = 0
babelon = 0

config.plugins.babelzapper = ConfigSubsection()
config.plugins.babelzapper.enabled = ConfigEnableDisable(default=False)
config.plugins.babelzapper.changetime = ConfigInteger(default=1000,
                                                      limits=(200, 10000))
config.plugins.babelzapper.exit2escape = ConfigEnableDisable(default=False)


def main(session, **kwargs):
    session.open(BabelzapperConfiguration)


def autostart(reason, **kwargs):
    #	global session
    if kwargs.has_key("session") and reason == 0:
        session = kwargs["session"]
        print "[BABELZAPPER] autostart"
        session.open(BabelZapperStartup)