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


Python ConfigSubsection.port方法代码示例

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


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

示例1: ftpserverFromURI

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import port [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

示例2: add

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import port [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

示例3: ConfigSubsection

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import port [as 别名]
config.plugins.vTuner = ConfigSubsection()
config.plugins.vTuner.client = ConfigSubsection()
config.plugins.vTuner.client.enabled = ConfigYesNo(default=True)
config.plugins.vTuner.client.mode = ConfigSubList()
   
for i in [0,1,2]:
    mode = ConfigSubsection()
    if i == 0:
        # first type must not be none
        mode.type = ConfigSelection(default="-s2", choices = [("-s2", _("DVB-S2 connected to DVB-S/S2")),("-c", _("DVB-C")),("-t", _("DVB-T")), ("-S2", _("DVB-S/S2 connected to DVB-S2")), ("-s", _("DVB-S connected to DVB-S/S2")), ("-S", _("DVB-S connected to DVB-S")) ])
    else:
        mode.type = ConfigSelection(default="", choices = [("", _("unused")), ("-s2", _("DVB-S2 connected to DVB-S/S2")),("-c", _("DVB-C")),("-t", _("DVB-T")), ("-S2", _("DVB-S2 connected to DVB-S2")), ("-s", _("DVB-S connected to DVB-S/S2")), ("-S", _("DVB-S connected to DVB-S")) ])
    mode.discover = ConfigYesNo(default=True)
    mode.ip = ConfigText( default="0.0.0.0" )
    mode.port = ConfigInteger(default = 39305, limits=(0, 49152) )
    mode.group = ConfigInteger(default = 1, limits=(1, 255) )
    config.plugins.vTuner.client.mode.append(mode) 
    
def configCB(result, session):
    if result is True:
        f = open('/etc/vtunerc.conf','w')
        f.write("# this file is auto generated and will be overwritten\n")
        f.write("# DO NOT EDIT\n")
        if config.plugins.vTuner.client.enabled.value:
            f.write('DAEMON="/usr/sbin/vtunerc.mipsel"\n')
        else:
            f.write('DAEMON="/bin/true"\n')
        
        options=""
        for mode in config.plugins.vTuner.client.mode:
开发者ID:gdachs,项目名称:vtuner,代码行数:32,代码来源:vTunerConfig.py

示例4: ConfigSubsection

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import port [as 别名]
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

def createSingleton(session):
	global ftpbrowser
	if not ftpbrowser:
开发者ID:ebazot,项目名称:FTPBrowser-enigma2,代码行数:33,代码来源:plugin.py


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