当前位置: 首页>>代码示例>>Python>>正文


Python ConfigSubsection.address方法代码示例

本文整理汇总了Python中Components.config.ConfigSubsection.address方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigSubsection.address方法的具体用法?Python ConfigSubsection.address怎么用?Python ConfigSubsection.address使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Components.config.ConfigSubsection的用法示例。


在下文中一共展示了ConfigSubsection.address方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addHost

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import address [as 别名]
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"),
            ("gntp", "GNTP"),
            ("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
开发者ID:Roxy1139,项目名称:enigma2-plugins,代码行数:31,代码来源:plugin.py

示例2: ftpserverFromURI

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import address [as 别名]
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)
	newServer.connectiontype = ConfigYesNo(False)

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

	return FTPServer(newServer)
开发者ID:ebazot,项目名称:FTPBrowser-enigma2,代码行数:27,代码来源:FTPServerManager.py

示例3: add

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import address [as 别名]
	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
开发者ID:OpenDMM,项目名称:enigma2-plugins,代码行数:16,代码来源:FTPServerManager.py

示例4: ConfigYesNo

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import address [as 别名]
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=False)
apModeConfig.address = ConfigIP(default = [0,0,0,0])
apModeConfig.netmask = ConfigIP(default = [255,0,0,0])
apModeConfig.gateway = ConfigIP(default = [0,0,0,0])
apModeConfig.nameserver = ConfigIP(default = [0,0,0,0])

class WirelessAccessPoint(Screen,ConfigListScreen):
	skin = """
		<screen position="center,center" size="590,450" title="Wireless Access Point" >
		<ePixmap pixmap="skin_default/buttons/red.png" position="20,0" size="140,40" alphatest="on" />
		<ePixmap pixmap="skin_default/buttons/green.png" position="160,0" size="140,40" alphatest="on" />
		<ePixmap pixmap="skin_default/buttons/yellow.png" position="300,0" size="140,40" alphatest="on" />
		<ePixmap pixmap="skin_default/buttons/blue.png" position="440,0" size="140,40" alphatest="on" />

		<widget source="key_red" render="Label" position="20,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#9f1313" transparent="1" />
		<widget source="key_green" render="Label" position="160,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#1f771f" transparent="1" />
		<widget source="key_yellow" render="Label" position="300,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#a08500" transparent="1" />
开发者ID:DvbMedia,项目名称:oe-alliance-plugins,代码行数:33,代码来源:plugin.py

示例5: ConfigSubsection

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import address [as 别名]
from . import _

# 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)
	newServer.connectiontype = ConfigYesNo(False)
	i += 1
	del newServer

del append, i

from FTPBrowser import FTPBrowser
from FTPServerManager import ftpserverFromURI

ftpbrowser = None
开发者ID:ebazot,项目名称:FTPBrowser-enigma2,代码行数:32,代码来源:plugin.py


注:本文中的Components.config.ConfigSubsection.address方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。