示例#1
0
    def __init__(self):
        # Is called on instance creation
        ServiceBase.__init__(self)
        self.connectors = []

        # Default configuration
        self.setOption(
            'smtpserver',
            NoSave(ConfigText(default="smtp.server.com", fixed_size=False)),
            _("SMTP Server"))
        self.setOption('smtpport', NoSave(ConfigNumber(default=587)),
                       _("SMTP Port"))
        self.setOption('smtpssl', NoSave(ConfigYesNo(default=True)),
                       _("SMTP SSL"))
        self.setOption('smtptls', NoSave(ConfigYesNo(default=True)),
                       _("SMTP TLS"))
        self.setOption('timeout', NoSave(ConfigNumber(default=30)),
                       _("Timeout"))

        self.setOption('username',
                       NoSave(ConfigText(default="user", fixed_size=False)),
                       _("User name"))
        self.setOption('password', NoSave(ConfigPassword(default="password")),
                       _("Password"))

        self.setOption(
            'mailfrom',
            NoSave(ConfigText(default="*****@*****.**", fixed_size=False)),
            _("Mail from"))
        self.setOption('mailto', NoSave(ConfigText(fixed_size=False)),
                       _("Mail to or leave empty (From will be used)"))
示例#2
0
 def __init__(self, session, entry, index):
     self.skin = OscamServerEntryConfigScreen.skin
     self.session = session
     Screen.__init__(self, session)
     if entry == None:
         entry = oscamServer()
     self.index = index
     serverIP = self.isIPaddress(entry.serverIP)
     if serverIP and config.plugins.OscamStatus.useIP.value:
         self.isIP = True
     else:
         self.isIP = False
     serverPort = int(entry.serverPort)
     self.serverNameConfigEntry = NoSave(ConfigText(default=entry.serverName, fixed_size=False, visible_width=20))
     if self.isIP:
         self.serverIPConfigEntry = NoSave(ConfigIP(default=serverIP, auto_jump=True))
     else:
         self.serverIPConfigEntry = NoSave(ConfigText(default=entry.serverIP, fixed_size=False, visible_width=20))
         self.serverIPConfigEntry.setUseableChars(u'1234567890aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ.-_')
     self.portConfigEntry = NoSave(ConfigInteger(default=serverPort, limits=(0, 65536)))
     self.usernameConfigEntry = NoSave(ConfigText(default=entry.username, fixed_size=False, visible_width=20))
     self.passwordConfigEntry = NoSave(ConfigPassword(default=entry.password, fixed_size=False))
     self.useSSLConfigEntry = NoSave(ConfigYesNo(entry.useSSL))
     ConfigListScreen.__init__(self, [], session=session)
     self.createSetup()
     self['title'] = StaticText(_('Oscam Server Setup'))
     self['ButtonRedtext'] = StaticText(_('return'))
     self['ButtonGreentext'] = StaticText(_('save'))
     self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'red': self.Close,
      'green': self.Save,
      'cancel': self.Close}, -1)
     self.onLayoutFinish.append(self.LayoutFinished)
     return
示例#3
0
    def initialize_entry(self, setting, entry):
        # fix dotted id
        entry['id'] = entry['id'].replace('.', '_')

        if entry['type'] == 'bool':
            setattr(setting, entry['id'], ConfigYesNo(default=(entry['default'] == 'true')))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'text':
            if entry['option'] == 'true':
                setattr(setting, entry['id'], ConfigPassword(default=entry['default'], fixed_size=False))
            else:
                setattr(setting, entry['id'], ConfigText(default=entry['default'], fixed_size=False))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'enum':
            choicelist = [(str(idx), self._get_label(e).encode('utf-8')) for idx, e in enumerate(entry['lvalues'].split("|"))]
            setattr(setting, entry['id'], ConfigSelection(default=entry['default'], choices=choicelist))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'labelenum':
            choicelist = [(self._get_label(e).encode('utf-8'), self._get_label(e).encode('utf-8')) for e in entry['values'].split("|")]
            setattr(setting, entry['id'], ConfigSelection(default=entry['default'], choices=choicelist))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'ipaddress':
            setattr(setting, entry['id'], ConfigIP(default=map(int, entry['default'].split('.')), auto_jump=True))
            entry['setting_id'] = getattr(setting, entry['id'])

        elif entry['type'] == 'number':
            setattr(setting, entry['id'], ConfigNumber(default=int(entry['default'])))
            entry['setting_id'] = getattr(setting, entry['id'])
        else:
            log.error('%s cannot initialize unknown entry %s', self, entry['type'])
示例#4
0
    def createConfig(self):
        self.usernameEntry = None
        self.passwordEntry = None
        self.username = None
        self.password = None

        if os_path.exists(self.cache_file):
            print 'Loading user cache from ', self.cache_file
            try:
                self.hostdata = load_cache(self.cache_file)
                username = self.hostdata['username']
                password = self.hostdata['password']
            except:
                username = "******"
                password = "******"
        else:
            username = "******"
            password = "******"

        self.username = NoSave(
            ConfigText(default=username, visible_width=50, fixed_size=False))
        self.password = NoSave(
            ConfigPassword(default=password,
                           visible_width=50,
                           fixed_size=False))
示例#5
0
	def setupConfig(self):
		#Streamserver base config
		self.config = Config()
		self.config.streamserver = ConfigSubsection()
		self.config.streamserver.source = ConfigSelection(StreamServerControl.INPUT_MODES, default=str(eStreamServer.INPUT_MODE_LIVE))
		self.config.streamserver.audioBitrate = ConfigInteger(96, StreamServerControl.AUDIO_BITRATE_LIMITS)
		self.config.streamserver.videoBitrate = ConfigInteger(1500, StreamServerControl.VIDEO_BITRATE_LIMITS)
		self.config.streamserver.autoBitrate = ConfigOnOff(default=False)
		self.config.streamserver.resolution = ConfigSelection(list(StreamServerControl.RESOLUTIONS.keys()), default=StreamServerControl.RES_KEY_PAL)
		self.config.streamserver.framerate = ConfigSelection(StreamServerControl.FRAME_RATES, default=StreamServerControl.FRAME_RATE_23_976)
		# extended encoder settings
		self.config.streamserver.gopLength = ConfigInteger(default=eStreamServer.GOP_LENGTH_AUTO, limits=[eStreamServer.GOP_LENGTH_MIN, eStreamServer.GOP_LENGTH_MAX])
		self.config.streamserver.gopOnSceneChange = ConfigOnOff(default=False)
		self.config.streamserver.openGop = ConfigOnOff(default=False)
		self.config.streamserver.bFrames = ConfigInteger(default=eStreamServer.BFRAMES_DEFAULT, limits=[eStreamServer.BFRAMES_MIN, eStreamServer.BFRAMES_MAX])
		self.config.streamserver.pFrames = ConfigInteger(default=eStreamServer.PFRAMES_DEFAULT, limits=[eStreamServer.PFRAMES_MIN, eStreamServer.PFRAMES_MAX])
		self.config.streamserver.slices = ConfigInteger(default=eStreamServer.SLICES_DEFAULT, limits=[eStreamServer.SLICES_MIN, eStreamServer.SLICES_MAX])
		self.config.streamserver.level = ConfigSelection(StreamServerControl.LEVELS, default=str(eStreamServer.LEVEL_DEFAULT))
		self.config.streamserver.profile = ConfigSelection(StreamServerControl.PROFILES, default=str(eStreamServer.PROFILE_DEFAULT))
		#servers
		self.config.streamserver.rtsp = ConfigSubsection()
		self.config.streamserver.rtsp.enabled = ConfigOnOff(default=False)
		self.config.streamserver.rtsp.port = ConfigInteger(554, StreamServerControl.PORT_LIMITS)
		self.config.streamserver.rtsp.path = ConfigText(default="stream", fixed_size=False)
		self.config.streamserver.rtsp.user = ConfigText(default="", fixed_size=False)
		self.config.streamserver.rtsp.password = ConfigPassword(default="")
		self.config.streamserver.hls = ConfigSubsection()
		self.config.streamserver.hls.enabled = ConfigOnOff(default=False)
		self.config.streamserver.hls.path = ConfigText(default="stream", fixed_size=False)
		self.config.streamserver.hls.user = ConfigText(default="", fixed_size=False)
		self.config.streamserver.hls.password = ConfigPassword(default="")
		self.config.streamserver.hls.port = ConfigInteger(8080, StreamServerControl.PORT_LIMITS)
		self.config.streamserver.lastservice = ConfigText(default=config.tv.lastservice.value)
		self.config.streamserver.mediator = ConfigSubsection()
		self.config.streamserver.mediator.enabled = ConfigOnOff(default=False)
		self.config.streamserver.mediator.boxid = ConfigText()
		self.config.streamserver.mediator.boxkey = ConfigText()
		self.config.streamserver.mediator.streaminggroups = ConfigSubsection()
		self.config.streamserver.mediator.streaminggroups.member_alias = ConfigText(default="dreambox", fixed_size=False)
		self.config.streamserver.mediator.streaminggroups.stream_alias = ConfigText(default="", fixed_size=False)
		self.config.streamserver.mediator.streaminggroups.hide_empty = ConfigYesNo(default=False)
		self.config.streamserver.client = ConfigSubsection()
		self.config.streamserver.client.boxid = ConfigText(default="", fixed_size=False)
		self.config.streamserver.client.boxkey = ConfigText(default="", fixed_size=False)

		self.loadConfig()
示例#6
0
	def __init__(self, session, args = None):
		global connected
		global conn
		self.skin = ModemSetup.skin
		secret = getSecretString()
		user = secret[:secret.find('*')]
		password = secret[secret.find('*')+1:]
		self.username = ConfigText(user, fixed_size=False)
		self.password = ConfigPassword(password, fixed_size=False)
		self.phone = ConfigText(getTelephone(), fixed_size=False)
		self.phone.setUseableChars(u"0123456789")
		lst = [ (_("Username"), self.username),
			(_("Password"), self.password),
			(_("Phone number"), self.phone) ]
		self["list"] = ConfigList(lst)
		self["key_green"] = Button("")
		self["key_red"] = Button("")
		self["state"] = Label("")
		self["actions"] = NumberActionMap(["ModemActions"],
		{
			"cancel": self.close,
			"left": self.keyLeft,
			"right": self.keyRight,
			"connect": self.connect,
			"disconnect": self.disconnect,
			"deleteForward": self.deleteForward,
			"deleteBackward": self.deleteBackward,
			"0": self.keyNumber,
			"1": self.keyNumber,
			"2": self.keyNumber,
			"3": self.keyNumber,
			"4": self.keyNumber,
			"5": self.keyNumber,
			"6": self.keyNumber,
			"7": self.keyNumber,
			"8": self.keyNumber,
			"9": self.keyNumber
		}, -1)

		self["ListActions"] = ActionMap(["ListboxDisableActions"],
		{
			"moveUp": self.nothing,
			"moveDown": self.nothing,
			"moveTop": self.nothing,
			"moveEnd": self.nothing,
			"pageUp": self.nothing,
			"pageDown": self.nothing
		}, -1)

		self.stateTimer = eTimer()
		self.stateTimer.callback.append(self.stateLoop)

		conn.appClosed.append(self.pppdClosed)
		conn.dataAvail.append(self.dataAvail)

		Screen.__init__(self, session)
		self.onClose.append(self.__closed)
		self.onLayoutFinish.append(self.__layoutFinished)
	def createConfig(self):
		self.sharenameEntry = None
		self.mounttypeEntry = None
		self.activeEntry = None
		self.ipEntry = None
		self.sharedirEntry = None
		self.optionsEntry = None
		self.usernameEntry = None
		self.passwordEntry = None
		self.hdd_replacementEntry = None
		self.sharetypelist = [("nfs", _("NFS share")), ("cifs", _("CIFS share"))]

		mounttype = self.mountinfo.get('mounttype')
		if not mounttype:
			mounttype = "nfs"
		active = self.mountinfo.get('active', 'True') == 'True'
		if self.mountinfo.has_key('ip'):
			if self.mountinfo['ip'] is False:
				ip = [192, 168, 0, 0]
			else:
				ip = self.convertIP(self.mountinfo['ip'])
		else:
			ip = [192, 168, 0, 0]
		sharename = self.mountinfo.get('sharename', "Sharename")
		sharedir = self.mountinfo.get('sharedir', "/media/hdd")
		username = self.mountinfo.get('username', "")
		password = self.mountinfo.get('password', "")
		hdd_replacement = self.mountinfo.get('hdd_replacement', False)
		if hdd_replacement == 'True':
			hdd_replacement = True
		else:
			hdd_replacement = False
		if sharename is False:
			sharename = "Sharename"
		if sharedir is False:
			sharedir = "/media/hdd"
		if mounttype == "nfs":
			defaultOptions = "rw,nolock,soft"
		else:
			defaultOptions = "rw"
		if username is False:
			username = ""
		if password is False:
			password = ""
		options = self.mountinfo.get('options', defaultOptions)

		self.activeConfigEntry = NoSave(ConfigEnableDisable(default = active))
		self.ipConfigEntry = NoSave(ConfigIP(default = ip))
		self.sharenameConfigEntry = NoSave(ConfigText(default = sharename, visible_width = 50, fixed_size = False))
		self.sharedirConfigEntry = NoSave(ConfigText(default = sharedir, visible_width = 50, fixed_size = False))
		self.optionsConfigEntry = NoSave(ConfigText(default = defaultOptions, visible_width = 50, fixed_size = False))
		if options is not False:
			self.optionsConfigEntry.value = options
		self.usernameConfigEntry = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False))
		self.passwordConfigEntry = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False))
		self.mounttypeConfigEntry = NoSave(ConfigSelection(self.sharetypelist, default = mounttype ))
		self.hdd_replacementConfigEntry = NoSave(ConfigYesNo(default = hdd_replacement))
示例#8
0
 def createConfigEntry(self, name, type, default, *args, **kwargs):
     if type == 'text':
         setattr(self.__rootConfigListEntry, name, ConfigText(default=default, fixed_size=False))
     elif type == 'directory':
         setattr(self.__rootConfigListEntry, name, ConfigDirectory(default=default))
     elif type == 'yesno':
         setattr(self.__rootConfigListEntry, name, ConfigYesNo(default=default))
     elif type == 'password':
         setattr(self.__rootConfigListEntry, name, ConfigPassword(default=default))
     else:
         print repr(self), 'cannot create entry of unknown type:', type
示例#9
0
def addHost(name):
	s = ConfigSubsection()
	s.name = ConfigText(default=name, fixed_size=False)
	s.enable_incoming = ConfigYesNo(default=False)
	s.enable_outgoing = ConfigYesNo(default=False)
	s.address = ConfigText(fixed_size=False)
	s.password = ConfigPassword()
	s.protocol = ConfigSelection(default="growl", choices=[("growl", "Growl"), ("snarl", "Snarl"), ("prowl", "Prowl"), ("syslog", "Syslog UDP")])
	s.level = ConfigSelection(default="-1", choices=[("-1", _("Low (Yes/No)")), ("0", _("Normal (Information)")), ("1", _("High (Warning)")), ("2", _("Highest (Emergency)"))])
	s.blacklist = ConfigSet(choices=[])
	config.plugins.growlee.hosts.append(s)
	return s
示例#10
0
	def __init__(self):
		# Is called on instance creation
		ServiceBase.__init__(self)
		#self.sockets = []

		# Default configuration
		self.setOption('growlhost', NoSave(ConfigText(default="host", fixed_size=False)), _("Growl Host name"))
		self.setOption('growlport', NoSave(ConfigNumber(default=23053)), _("Growl Port"))
		self.setOption('timeout', NoSave(ConfigNumber(default=3)), _("Timeout"))
		self.setOption('password', NoSave(ConfigPassword()), _("Password"))
		self.setOption('sticky', NoSave(ConfigYesNo(default=True)), _("Send as sticky"))
		self.setOption('priority', NoSave(ConfigNumber(default=1)), _("Send with priority"))
示例#11
0
	def createConfig(self):
		username = '******'
		password = '******'
		print 'Loading user cache from ', self.cache_file
		try:
			hostdata = load_cache(self.cache_file)
			username = hostdata['username']
			password = hostdata['password']
		except:
			pass
		self.username = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False))
		self.password = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False))
示例#12
0
    def __init__(self, session, params=None):
        debug("[EmailConfigAccount] __init__")
        self._session = session
        Screen.__init__(self, session)
        self.setTitle(_("Account Setup"))
        self.list = []
        ConfigListScreen.__init__(self, self.list, session=session)
        self["buttonred"] = Label(_("cancel"))
        self["buttongreen"] = Label(_("ok"))
        self["setupActions"] = ActionMap(
            ["SetupActions"], {
                "green": self.save,
                "red": self.cancel,
                "save": self.save,
                "cancel": self.cancel,
                "ok": self.save,
            }, -2)

        if params:
            (self._name, self._server, self._port, self._user, self._password,
             self._interval, self._maxmail, self._listall) = params
        else:
            (self._name, self._server, self._port, self._user, self._password,
             self._interval, self._maxmail,
             self._listall) = ("", "", "993", "", "", "60", "50", False)
        self._cName = ConfigText(self._name, fixed_size=False)
        self._cServer = ConfigText(self._server, fixed_size=False)
        self._cPort = ConfigSelection(choices=[("143", "143"),
                                               ("993", "993 (SSL)")],
                                      default=self._port)
        self._cUser = ConfigText(self._user, fixed_size=False)
        self._cPassword = ConfigPassword(self._password, fixed_size=False)
        self._cInterval = ConfigText(self._interval, fixed_size=False)
        self._cInterval.setUseableChars('0123456789,')
        self._cMaxmail = ConfigText(self._maxmail, fixed_size=False)
        self._cMaxmail.setUseableChars('0123456789,')
        self._cListall = ConfigEnableDisable(self._listall)

        self.list = [
            getConfigListEntry(_("account name"), self._cName),
            getConfigListEntry(_("IMAP Server"), self._cServer),
            getConfigListEntry(_("IMAP Port"), self._cPort),
            getConfigListEntry(_("user name"), self._cUser),
            getConfigListEntry(_("password"), self._cPassword),
            getConfigListEntry(_("mail check interval (minutes)"),
                               self._cInterval),
            getConfigListEntry(_("maximum mail size to fetch"),
                               self._cMaxmail),
            getConfigListEntry(_("list all mailboxes"), self._cListall)
        ]
        self["config"].list = self.list
        self["config"].l.setList(self.list)
示例#13
0
    def prepare(self):
        self.activityTimer.stop()

        self.provider_delete = ConfigYesNo(default=False)
        self.provider_enabled = ConfigYesNo(default=False)
        self.provider_enabled.value = self.provider.enabled
        self.provider_name = ConfigText(default='',
                                        fixed_size=False,
                                        visible_width=20)
        self.provider_name.value = self.provider.name if self.provider.name != 'New' else ''
        self.provider_settings_level = ConfigSelection(
            default='simple', choices=['simple', 'expert'])
        self.provider_settings_level.value = self.provider.settings_level
        self.provider_m3u_url = ConfigText(default='',
                                           fixed_size=False,
                                           visible_width=20)
        self.provider_m3u_url.value = self.provider.m3u_url
        self.provider_epg_url = ConfigText(default='',
                                           fixed_size=False,
                                           visible_width=20)
        self.provider_epg_url.value = self.provider.epg_url
        self.provider_username = ConfigText(default='', fixed_size=False)
        self.provider_username.value = self.provider.username
        self.provider_password = ConfigPassword(default='', fixed_size=False)
        self.provider_password.value = self.provider.password
        self.provider_multi_vod = ConfigEnableDisable(default=False)
        self.provider_multi_vod.value = self.provider.multi_vod
        self.provider_picons = ConfigYesNo(default=False)
        self.provider_picons.value = self.provider.picons
        self.provider_bouquet_pos = ConfigSelection(default='bottom',
                                                    choices=['bottom', 'top'])
        if self.provider.bouquet_top:
            self.provider_bouquet_pos.value = 'top'
        self.provider_all_bouquet = ConfigYesNo(default=False)
        self.provider_all_bouquet.value = self.provider.all_bouquet
        self.provider_iptv_types = ConfigEnableDisable(default=False)
        self.provider_iptv_types.value = self.provider.iptv_types
        self.provider_streamtype_tv = ConfigSelection(
            default='', choices=[' ', '1', '4097', '5001', '5002'])
        self.provider_streamtype_tv.value = self.provider.streamtype_tv
        self.provider_streamtype_vod = ConfigSelection(
            default='', choices=[' ', '4097', '5001', '5002'])
        self.provider_streamtype_vod.value = self.provider.streamtype_vod
        # n.b. first option in stream type choice lists is an intentional single space
        self.provider_sref_override = ConfigEnableDisable(default=False)
        self.provider_sref_override.value = self.provider.sref_override
        self.provider_bouquet_download = ConfigEnableDisable(default=False)
        self.provider_bouquet_download.value = self.provider.bouquet_download

        self.create_setup()
        self['pleasewait'].hide()
        self['actions'].setEnabled(True)
def initConfig():
    config_root = config.plugins.openHAB = ConfigSubsection()
    config_root.host = ConfigText(fixed_size=False)
    config_root.port = ConfigNumber(8080)
    config_root.user = ConfigText(fixed_size=False)
    config_root.password = ConfigPassword()
    config_root.sitemap = ConfigText(default="default", fixed_size=False)
    config_root.refresh = ConfigIntSelection([1, 2, 3, 5, 10], default=3)
    config_root.dimmer_step = ConfigIntSelection([1, 2, 3, 5, 10], default=5)
    config_root.debug = ConfigIntSelection([(OFF_LEVEL, _("no")), (DEBUG_LEVEL, _("debug")), (TRACE_LEVEL, _("trace"))], 
                                           default=OFF_LEVEL)
    config_root.graphic_sliders = ConfigYesNo(default=False)
    return config_root
示例#15
0
 def _createConfigElements(self):
     append = self._configElements.append
     for item in self._config:
         Log.i(item)
         if item["type"] == self.TYPE_TEXT:
             append((ConfigText(default=item["value"],
                                fixed_size=False), item))
         elif item["type"] == self.TYPE_PASSWORD:
             append((ConfigPassword(default=item["value"],
                                    fixed_size=False), item))
         elif item["type"] == self.TYPE_PIN:
             val = item["value"] or 0
             append((ConfigInteger(default=int(val)), item))
	def add(self):
		newServer = ConfigSubsection()
		config.plugins.ftpbrowser.server.append(newServer)
		newServer.name = ConfigText("Name", fixed_size=False)
		newServer.address = ConfigText("192.168.2.12", fixed_size=False)
		newServer.username = ConfigText("root", fixed_size=False)
		newServer.password = ConfigPassword("dreambox")
		newServer.port = ConfigInteger(21, (1, 65535))
		newServer.passive = ConfigYesNo(False)
		config.plugins.ftpbrowser.servercount.value += 1
		config.plugins.ftpbrowser.servercount.save()

		self.updateServerList()
		self.changed = True
示例#17
0
文件: config.py 项目: Lumoc/E2Lox
    def __init__(self, session, plugin_path, config_filename):
        self._config_saver = ConfigSaver("{}/{}".format(
            plugin_path, config_filename))
        self._connection_configuration = self._config_saver.get_connection_configuration(
        )
        self._session = session
        Screen.__init__(self, self._session)
        self._list = []
        self.__ipadress_config_list_entry = ConfigIP(
            default=self._connection_configuration.ipaddress.split('.'))
        self.__port_config_list_entry = ConfigInteger(
            default=self._connection_configuration.port, limits=(0, 65535))
        self.__username_config_list_entry = ConfigText(
            default=self._connection_configuration.username,
            fixed_size=False,
            visible_width=False
        )  #fixed_size -> input length is length of default, visible_width only one charactar visible
        self.__password_config_list_entry = ConfigPassword(
            default=self._connection_configuration.password,
            fixed_size=False,
            visible_width=False,
            censor="*")

        self._list.append(
            getConfigListEntry(_("IP address"),
                               self.__ipadress_config_list_entry))
        self._list.append(
            getConfigListEntry(_("Port"), self.__port_config_list_entry))
        self._list.append(
            getConfigListEntry(_("Username"),
                               self.__username_config_list_entry))
        self._list.append(
            getConfigListEntry(_("Password"),
                               self.__password_config_list_entry))

        ConfigListScreen.__init__(self, self._list)
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))

        self["setupActions"] = ActionMap(
            ["SetupActions"], {
                "save": self.save,
                "red": self.cancel,
                "cancel": self.cancel,
                "ok": self.save
            }, -2)

        self.onLayoutFinish.append(self.layoutFinished)
示例#18
0
    def createConfig(self):
        self.sharetypelist = []
        self.sharetypelist.append(("nfs", _("NFS share")))
        self.sharetypelist.append(("cifs", _("CIFS share")))

        mounttype = self.mountinfo['mounttype']
        active = self.mountinfo['active']
        ip = self.convertIP(self.mountinfo['ip'])
        sharename = self.mountinfo['sharename']
        sharedir = self.mountinfo['sharedir']
        options = self.mountinfo['options']
        username = self.mountinfo['username']
        password = self.mountinfo['password']
        hdd_replacement = self.mountinfo['hdd_replacement']
        if mounttype == "nfs":
            defaultOptions = iAutoMount.DEFAULT_OPTIONS_NFS['options']
        else:
            defaultOptions = iAutoMount.DEFAULT_OPTIONS_CIFS['options']

        self._cfgActive = NoSave(ConfigOnOff(default=active))
        self._cfgIp = NoSave(ConfigIP(default=ip))
        self._cfgSharename = NoSave(
            ConfigText(default=sharename, visible_width=50, fixed_size=False))
        self._cfgSharedir = NoSave(
            ConfigText(default=sharedir, visible_width=50, fixed_size=False))
        self._cfgOptions = NoSave(
            ConfigText(default=defaultOptions,
                       visible_width=50,
                       fixed_size=False))
        if options is not False:
            self._cfgOptions.value = options
        self._cfgUsername = NoSave(
            ConfigText(default=username, visible_width=50, fixed_size=False))
        self._cfgPassword = NoSave(
            ConfigPassword(default=password,
                           visible_width=50,
                           fixed_size=False))
        self._cfgMounttype = NoSave(
            ConfigSelection(self.sharetypelist, default=mounttype))
        self._cfgHddReplacement = NoSave(ConfigYesNo(default=hdd_replacement))
def ftpserverFromURI(uri, name="", save=True):
	scheme, host, port, path, username, password = _parse(uri, defaultPort=21)

	newServer = ConfigSubsection()
	if save:
		config.plugins.ftpbrowser.server.append(newServer)
	newServer.name = ConfigText(fixed_size=False)
	newServer.name.value = name or host
	newServer.address = ConfigText(fixed_size=False)
	newServer.address.value = host
	newServer.username = ConfigText(fixed_size=False)
	newServer.username.value = username
	newServer.password = ConfigPassword()
	newServer.password.value = password
	newServer.port = ConfigInteger(0, (0, 65535))
	newServer.port.value = port
	newServer.passive = ConfigYesNo(False)

	if save:
		newServer.save()
		config.plugins.ftpbrowser.servercount.value += 1
		config.plugins.ftpbrowser.servercount.save()

	return FTPServer(newServer)
示例#20
0
文件: plugin.py 项目: openhdf/enigma2
from Wlan import iWlan, iStatus, getWlanConfigName

plugin_path = eEnv.resolve(
    "${libdir}/enigma2/python/Plugins/SystemPlugins/WirelessLan")

list = ["Unencrypted", "WEP", "WPA", "WPA/WPA2", "WPA2"]

weplist = ["ASCII", "HEX"]

config.plugins.wlan = ConfigSubsection()
config.plugins.wlan.essid = NoSave(ConfigText(default="", fixed_size=False))
config.plugins.wlan.hiddenessid = NoSave(ConfigYesNo(default=False))
config.plugins.wlan.encryption = NoSave(ConfigSelection(list, default="WPA2"))
config.plugins.wlan.wepkeytype = NoSave(
    ConfigSelection(weplist, default="ASCII"))
config.plugins.wlan.psk = NoSave(ConfigPassword(default="", fixed_size=False))


class WlanStatus(Screen):
    skin = """
		<screen name="WlanStatus" position="center,center" size="560,400" title="Wireless network status" >
			<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
			<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />

			<widget source="LabelBSSID" render="Label" position="10,60" size="200,25" valign="left" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
			<widget source="LabelESSID" render="Label" position="10,100" size="200,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
			<widget source="LabelQuality" render="Label" position="10,140" size="200,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
			<widget source="LabelSignal" render="Label" position="10,180" size="200,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
			<widget source="LabelBitrate" render="Label" position="10,220" size="200,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
			<widget source="LabelEnc" render="Label" position="10,260" size="200,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
			<widget source="BSSID" render="Label" position="220,60" size="330,25" valign="center" font="Regular;20" transparent="1" foregroundColor="#FFFFFF" />
示例#21
0
    }.get((getMachineBrand(), getMachineName()), 39)

config.plugins.icetv = ConfigSubsection()

config.plugins.icetv.server = ConfigSubsection()
config.plugins.icetv.server.name = ConfigText(default="api.icetv.com.au")

config.plugins.icetv.member = ConfigSubsection()
config.plugins.icetv.member.email_address = ConfigText(show_help=False, fixed_size=False)
config.plugins.icetv.member.token = ConfigText()
config.plugins.icetv.member.id = ConfigNumber()
config.plugins.icetv.member.region_id = ConfigNumber()
config.plugins.icetv.member.country = ConfigText(default="AUS")
config.plugins.icetv.member.send_logs = ConfigYesNo(default=True)

config.plugins.icetv.member.password = NoSave(ConfigPassword(censor="●", show_help=False, fixed_size=False))

config.plugins.icetv.device = ConfigSubsection()
config.plugins.icetv.device.label = ConfigText(default="%s %s" % (getMachineBrand(), getMachineName()), show_help=False)
config.plugins.icetv.device.id = ConfigNumber()
config.plugins.icetv.device.type_id = ConfigNumber(default=getIceTVDeviceType())

config.plugins.icetv.last_update_time = ConfigNumber()
if config.plugins.icetv.last_update_time.value != 0:
    config.plugins.icetv.last_update_time.value = 0
    config.plugins.icetv.last_update_time.save()
    configfile.save()
config.plugins.icetv.last_update_time.disableSave()

config.plugins.icetv.enable_epg = ConfigYesNo(default=False)
config.plugins.icetv.configured = ConfigYesNo(default=False)
示例#22
0
config.streamserver.resolution = ConfigSelection(
    StreamServerControl.RESOLUTIONS.keys(),
    default=StreamServerControl.RES_KEY_PAL)
config.streamserver.framerate = ConfigSelection(
    StreamServerControl.FRAME_RATES, default=StreamServerControl.FRAME_RATE_25)
config.streamserver.rtsp = ConfigSubsection()
config.streamserver.rtsp.enabled = ConfigOnOff(default=False)
config.streamserver.rtsp.port = ConfigInteger(554,
                                              StreamServerControl.PORT_LIMITS)
config.streamserver.rtsp.path = ConfigText(default="stream", fixed_size=False)
config.streamserver.hls = ConfigSubsection()
config.streamserver.hls.enabled = ConfigOnOff(default=False)
config.streamserver.hls.port = ConfigInteger(8080,
                                             StreamServerControl.PORT_LIMITS)
config.streamserver.user = ConfigText(default="", fixed_size=False)
config.streamserver.password = ConfigPassword(default="")
config.streamserver.lastservice = ConfigText(
    default=config.tv.lastservice.value)
config.streamserver.mediator = ConfigSubsection()
config.streamserver.mediator.enabled = ConfigOnOff(default=False)
config.streamserver.mediator.boxid = ConfigText()
config.streamserver.mediator.boxkey = ConfigText()
config.streamserver.mediator.streaminggroups = ConfigSubsection()
config.streamserver.mediator.streaminggroups.member_alias = ConfigText(
    default="dreambox", fixed_size=False)
config.streamserver.mediator.streaminggroups.stream_alias = ConfigText(
    default="", fixed_size=False)
config.streamserver.mediator.streaminggroups.hide_empty = ConfigYesNo(
    default=False)
config.streamserver.client = ConfigSubsection()
config.streamserver.client.boxid = ConfigText(default="", fixed_size=False)
示例#23
0
list.append("WPA2")
list.append("WPA/WPA2")

weplist = []
weplist.append("ASCII")
weplist.append("HEX")

config.plugins.wlan = ConfigSubsection()
config.plugins.wlan.essid = NoSave(ConfigText(default = "home", fixed_size = False))
config.plugins.wlan.hiddenessid = NoSave(ConfigText(default = "home", fixed_size = False))

config.plugins.wlan.encryption = ConfigSubsection()
config.plugins.wlan.encryption.enabled = NoSave(ConfigYesNo(default = False))
config.plugins.wlan.encryption.type = NoSave(ConfigSelection(list, default = "WPA/WPA2" ))
config.plugins.wlan.encryption.wepkeytype = NoSave(ConfigSelection(weplist, default = "ASCII"))
config.plugins.wlan.encryption.psk = NoSave(ConfigPassword(default = "mysecurewlan", fixed_size = False))

class NetworkWizard(WizardLanguage, Rc):
	skin = """
		<screen position="0,0" size="720,576" title="Welcome..." flags="wfNoBorder" >
			<widget name="text" position="153,40" size="340,300" font="Regular;22" />
			<widget source="list" render="Listbox" position="53,340" size="440,180" scrollbarMode="showOnDemand" >
				<convert type="StringList" />
			</widget>
			<widget name="config" position="53,340" zPosition="1" size="440,180" transparent="1" scrollbarMode="showOnDemand" />
			<ePixmap pixmap="skin_default/buttons/button_red.png" position="40,225" zPosition="0" size="15,16" transparent="1" alphatest="on" />
			<widget name="languagetext" position="55,225" size="95,30" font="Regular;18" />
			<widget name="wizard" pixmap="skin_default/wizard.png" position="40,50" zPosition="10" size="110,174" alphatest="on" />
			<widget name="rc" pixmaps="skin_default/rc.png,skin_default/rcold.png" position="500,50" zPosition="10" size="154,500" alphatest="on" />
			<widget name="arrowdown" pixmap="skin_default/arrowdown.png" position="-100,-100" zPosition="11" size="37,70" alphatest="on" />
			<widget name="arrowdown2" pixmap="skin_default/arrowdown.png" position="-100,-100" zPosition="11" size="37,70" alphatest="on" />
示例#24
0
apModeConfig.encrypt = ConfigYesNo(default=False)
apModeConfig.method = ConfigSelection(default="0",
                                      choices=[("0", _("WEP")),
                                               ("1", _("WPA")),
                                               ("2", _("WPA2")),
                                               ("3", _("WPA/WPA2"))])
apModeConfig.wep = ConfigYesNo(default=False)
#apModeConfig.wep_default_key = ConfigSelection(default = "0", choices = [ ("0", "0"), ("1", "1"), ("2", "2"), ("3", "3") ] )
apModeConfig.wep_default_key = fixedValue(value="0")
apModeConfig.wepType = ConfigSelection(
    default="64",
    choices=[("64", _("Enable 64 bit (Input 10 hex keys)")),
             ("128", _("Enable 128 bit (Input 26 hex keys)"))])
apModeConfig.wep_key0 = ConfigPassword(default="",
                                       visible_width=50,
                                       fixed_size=False)
apModeConfig.wpa = ConfigSelection(default="0",
                                   choices=[("0", _("not set")),
                                            ("1", _("WPA")), ("2", _("WPA2")),
                                            ("3", _("WPA/WPA2"))])
apModeConfig.wpa_passphrase = ConfigPassword(default="",
                                             visible_width=50,
                                             fixed_size=False)
apModeConfig.wpagrouprekey = ConfigInteger(default=600, limits=(0, 3600))
apModeConfig.wpa_key_mgmt = fixedValue(value="WPA-PSK")
apModeConfig.wpa_pairwise = fixedValue(value="TKIP CCMP")
apModeConfig.rsn_pairwise = fixedValue(value="CCMP")

apModeConfig.usedhcp = ConfigYesNo(default=True)
apModeConfig.address = ConfigIP(default=[0, 0, 0, 0])
示例#25
0
simpleRSS.interval = ConfigNumber(default=15)
simpleRSS.feedcount = ConfigNumber(default=0)
simpleRSS.autostart = ConfigEnableDisable(default=False)
simpleRSS.keep_running = ConfigEnableDisable(default=True)
simpleRSS.feed = ConfigSubList()
i = 0
while i < simpleRSS.feedcount.value:
    s = ConfigSubsection()
    s.uri = ConfigText(default="http://", fixed_size=False)
    s.autoupdate = ConfigEnableDisable(default=True)
    simpleRSS.feed.append(s)
    i += 1
    del s
simpleRSS.enable_google_reader = ConfigYesNo(default=False)
simpleRSS.google_username = ConfigText(default="", fixed_size=False)
simpleRSS.google_password = ConfigPassword(default="")

del simpleRSS, i

# Global Poller-Object
rssPoller = None

# Main Function


def main(session, **kwargs):
    # Get Global rssPoller-Object
    global rssPoller

    # Create one if we have none (no autostart)
    if rssPoller is None:
示例#26
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from Components.config import config, configfile, ConfigDirectory, ConfigInteger, ConfigPassword, ConfigSelection, ConfigSubsection, ConfigText, getConfigListEntry
from Plugins.Plugin import PluginDescriptor
from .ui import tvEvent, tvJetzt, tvMain


config.plugins.tvspielfilm = ConfigSubsection()
config.plugins.tvspielfilm.font_size = ConfigSelection(default='large', choices=[('verylarge', 'Sehr gross'), ('large', 'Gross'), ('normal', 'Normal')])
config.plugins.tvspielfilm.meintvs = ConfigSelection(default='no', choices=[('yes', 'Ja'), ('no', 'Nein')])
config.plugins.tvspielfilm.login = ConfigText(default='', fixed_size=False)
config.plugins.tvspielfilm.password = ConfigPassword(default='', fixed_size=False)
config.plugins.tvspielfilm.encrypt = ConfigSelection(default='no', choices=[('yes', 'Ja'), ('no', 'Nein')])
config.plugins.tvspielfilm.picon = ConfigSelection(default='yes', choices=[('yes', 'Ja'), ('no', 'Nein')])
config.plugins.tvspielfilm.piconfolder = ConfigDirectory(default='/media/usb/picon/')
config.plugins.tvspielfilm.color = ConfigSelection(default='0x00000000', choices=[('0x00000000', 'Skin Default'),
 ('0x00F0A30A', 'Amber'),
 ('0x007895BC', 'Blue'),
 ('0x00825A2C', 'Brown'),
 ('0x000050EF', 'Cobalt'),
 ('0x00911D10', 'Crimson'),
 ('0x001BA1E2', 'Cyan'),
 ('0x00008A00', 'Emerald'),
 ('0x0070AD11', 'Green'),
 ('0x006A00FF', 'Indigo'),
 ('0x00BB0048', 'Magenta'),
 ('0x0076608A', 'Mauve'),
 ('0x006D8764', 'Olive'),
 ('0x00C3461B', 'Orange'),
 ('0x00F472D0', 'Pink'),
示例#27
0
            if what not in line:
                file_write.write(line)

        file_write.close()


config.plugins.m2b = ConfigSubsection()
config.plugins.m2b.m3ufile = ConfigSelection(choices=get_m3u_name())
config.plugins.m2b.type = ConfigSelection(
    default='Gstreamer',
    choices=[('Gstreamer', _('Gstreamer')),
             ('LiveStreamerhls', _('LiveStreamer/hls')),
             ('LiveStreamerhlsvariant', _('LiveStreamer/hlsvariant')),
             ('Multicast', _('Multicast'))])
config.plugins.m2b.passw = ConfigPassword(default='',
                                          visible_width=50,
                                          fixed_size=False)


class TSmediam2b_setup(ConfigListScreen, Screen):
    def __init__(self, session, m3uFile=None):
        self.session = session
        Screen.__init__(self, session)
        self.skin = 'TSmediam2b_setup'
        self.setTitle(_('m3u/xml bouquet converter'))
        config.plugins.m2b.m3ufile = ConfigSelection(choices=get_m3u_name())
        if m3uFile:
            config.plugins.m2b.m3ufile.value = m3uFile
            config.plugins.m2b.m3ufile.save()
        self.list = []
        self.converted = False
示例#28
0
# Config
from Components.config import config, ConfigInteger, ConfigSubList, \
  ConfigSubsection, ConfigText, ConfigPassword, ConfigYesNo

config.plugins.ftpbrowser = ConfigSubsection()
config.plugins.ftpbrowser.server = ConfigSubList()
config.plugins.ftpbrowser.servercount = ConfigInteger(0)
i = 0
append = config.plugins.ftpbrowser.server.append
while i < config.plugins.ftpbrowser.servercount.value:
    newServer = ConfigSubsection()
    append(newServer)
    newServer.name = ConfigText("Name", fixed_size=False)
    newServer.address = ConfigText("192.168.2.12", fixed_size=False)
    newServer.username = ConfigText("root", fixed_size=False)
    newServer.password = ConfigPassword("dreambox")
    newServer.port = ConfigInteger(21, (1, 65535))
    newServer.passive = ConfigYesNo(False)
    i += 1
    del newServer

del append, i

from FTPBrowser import FTPBrowser
from FTPServerManager import ftpserverFromURI

ftpbrowser = None


def createSingleton(session):
    global ftpbrowser
示例#29
0
EXTM3U_ENTRY = '#EXTINF:-1 tvg-name="%(SDN)s" tvg-id="%(CID)s" tvg-logo="%(PICON)s" group-title="%(CAT)s",%(SDN)s'
API_BASE = 'https://api.real-debrid.com/rest/1.0'
PAPI_DOWNLOADS = r'%(BASE)s/downloads?auth_token=%(PAPI)s&limit=100&page=%(PAGE)s'
VISIBLE_WIDTH = 20
VERSION_DEF = PLUGIN_VERSION
VERSION_CHOICES = [(VERSION_DEF, VERSION_DEF)]
PAPI_DEF = ''
PORT_DEF = 8268
DEBUG_DEF = False
PAPI = PAPI_DEF
PORT = PORT_DEF
DEBUG = DEBUG_DEF

config.plugins.rdebrid = ConfigSubsection()
config.plugins.rdebrid.papi = ConfigPassword(default=PAPI_DEF,
                                             fixed_size=False,
                                             visible_width=VISIBLE_WIDTH)
config.plugins.rdebrid.port = ConfigNumber(default=PORT_DEF)
config.plugins.rdebrid.debug = ConfigBoolean(default=DEBUG_DEF)
config.plugins.rdebrid.version = ConfigSelection(default=VERSION_DEF,
                                                 choices=VERSION_CHOICES)
if not openatv_like:
    SAVED_SETUP = Screens.Setup.setupdom

DEBUG_FILE = '/tmp/rdebrid-debug.log'


def debug(s):
    if DEBUG:
        f = open(DEBUG_FILE, 'a+')
        f.write(s)
示例#30
0
config.plugins.LastFM.menu = ConfigSelection(default="plugin",
                                             choices=[("plugin",
                                                       _("Plugin menu")),
                                                      ("extensions",
                                                       _("Extensions menu"))])
config.plugins.LastFM.name = ConfigText(default=_("Last.FM"),
                                        fixed_size=False,
                                        visible_width=20)
config.plugins.LastFM.description = ConfigText(
    default=_("Listen to Last.FM Internet Radio"),
    fixed_size=False,
    visible_width=80)
config.plugins.LastFM.showcoverart = ConfigYesNo(default=True)
config.plugins.LastFM.username = ConfigText("user", fixed_size=False)
config.plugins.LastFM.password = ConfigPassword(default="passwd",
                                                fixed_size=False)
config.plugins.LastFM.timeoutstatustext = ConfigInteger(3, limits=(0, 10))
config.plugins.LastFM.timeouttabselect = ConfigInteger(2, limits=(0, 10))
config.plugins.LastFM.metadatarefreshinterval = ConfigInteger(1,
                                                              limits=(0, 100))
config.plugins.LastFM.recommendedlevel = ConfigInteger(3, limits=(0, 100))
config.plugins.LastFM.sendSubmissions = ConfigYesNo(default=False)

config.plugins.LastFM.useproxy = ConfigYesNo(default=False)
config.plugins.LastFM.proxyport = ConfigInteger(6676, limits=(1, 65536))

config.plugins.LastFM.sreensaver = ConfigSubsection()
config.plugins.LastFM.sreensaver.use = ConfigYesNo(default=True)
config.plugins.LastFM.sreensaver.wait = ConfigInteger(30, limits=(0, 1000))
config.plugins.LastFM.sreensaver.showcoverart = ConfigYesNo(default=True)
config.plugins.LastFM.sreensaver.coverartanimation = ConfigYesNo(default=True)