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


Python ConfigSubsection.name方法代码示例

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


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

示例1: ftpserverFromURI

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

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

示例3: InitVcsProfile

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import name [as 别名]
def InitVcsProfile(profile=None, name=""):
	if profile is None:
		profile = ConfigSubsection()
	profile.name = ConfigText("", fixed_size=False)
	if not profile.name.value and name:
		profile.name.value = name
		profile.name.save()
	profile.enabled = ConfigYesNo(default=True)
	profile.stretch = ConfigSelection([("0",_("no")), ("1", _("yes"))], default="0")
	profile.aspect = ConfigInteger(2)
	profile.cliprect = ConfigPosition([0,0,720,576], (719,575,720,576))
	return profile
开发者ID:rommalyshev,项目名称:PITERKADET-DEPO,代码行数:14,代码来源:VCS.py

示例4: add

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

示例5: new

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import name [as 别名]
	def new(self):
		newUserConfigSubsection = ConfigSubsection()
		config.plugins.youtubeplayer.users.append(newUserConfigSubsection)
		newUserConfigSubsection.name = ConfigText("User " + str(self.__getUserCount()), False)
		if newUserConfigSubsection.name.value == newUserConfigSubsection.name.default:
			newUserConfigSubsection.name.default = ""
		newUserConfigSubsection.email = ConfigText("", False)
		newUserConfigSubsection.password = ConfigText("", False)
		
		newUser = YouTubeUser(newUserConfigSubsection)

		self.userlist.append(newUser)

		return newUser
开发者ID:13K-OMAR,项目名称:enigma2-plugins-sh4,代码行数:16,代码来源:YouTubeUserConfig.py

示例6: new

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import name [as 别名]
	def new(self):
		newServerConfigSubsection = ConfigSubsection()
		config.plugins.vlcplayer.servers.append(newServerConfigSubsection)
		newServerConfigSubsection.name = ConfigText("Server " + str(self.__getServerCount()), False)
		if newServerConfigSubsection.name.value == newServerConfigSubsection.name.default:
			newServerConfigSubsection.name.default = ""
		newServerConfigSubsection.addressType = ConfigSelectionExtended(
				[("FQDN", "FQDN"),
				 ("IP", "IP-Address")
				], "IP")
		newServerConfigSubsection.hostip = ConfigMutable(
				{"IP": ConfigIP([192,168,1,1]),
				 "FQDN": ConfigText("fqdname", False)
				}, newServerConfigSubsection.addressType.value)
		newServerConfigSubsection.httpport = ConfigInteger(8080, (0,65535))
		newServerConfigSubsection.password = ConfigText("", False)
		newServerConfigSubsection.basedir = ConfigText("/", False)
		newServerConfigSubsection.dvdPath = ConfigText("", False)
		newServerConfigSubsection.transcodeVideo = ConfigYesNo()
		newServerConfigSubsection.transcodeAudio = ConfigYesNo(True)
		newServerConfigSubsection.videocodec = ConfigSelection(
				[("mp1v", "MPEG1"),
				 ("mp2v", "MPEG2")
				], "mp2v")
		newServerConfigSubsection.videobitrate = ConfigInteger(2000, (100, 9999))
		newServerConfigSubsection.audiocodec = ConfigSelection(
				[("mpga", "MPEG Layer 1 (mpga)"),
				 ("mp2a", "MPEG Layer 2 (mp2a)"),
				 ("mp3", "MPEG Layer 3 (mp3)")
				], "mp2a")
		newServerConfigSubsection.audiobitrate = ConfigInteger(128, (64, 320))
		newServerConfigSubsection.samplerate = ConfigSelection(
				[("32000", "32000"),
				 ("44100", "44100"),
				 ("48000", "48000")
				], "44100")
		newServerConfigSubsection.audiochannels = ConfigInteger(2, (1, 9))
		newServerConfigSubsection.videonorm = ConfigSelection(
				[("720,576,4:3,25,i", "720 x 576 (4:3) @ 25fps (PAL)"),
				 ("720,576,16:9,25,i", "720 x 576 (16:9) @ 25fps (PAL)"),
				 ("720,576,16:9,24,i", "720 x 576 (16:9) @ 24fps (PAL)"), 
				 ("704,576,4:3,25,i", "704 x 576 (4:3) @ 25fps (PAL)"),
				 ("704,576,16:9,25,i", "704 x 576 (16:9) @ 25fps (PAL)"),
				 ("544,576,4:3,25,i", "544 x 576 (4:3) @ 25fps (PAL)"),
				 ("544,576,16:9,25,i", "544 x 576 (16:9) @ 25fps (PAL)"),
				 ("480,576,4:3,25,i", "480 x 576 (4:3) @ 25fps (PAL)"),
				 ("480,576,16:9,25,i", "480 x 576 (16:9) @ 25fps (PAL)"),
				 ("480,288,4:3,25,i", "480 x 288 (4:3) @ 25fps (PAL)"),
				 ("480,288,16:9,25,i", "480 x 288 (16:9) @ 25fps (PAL)"),
				 ("352,576,4:3,25,i", "352 x 576 (4:3) @ 25fps (PAL)"),
				 ("352,576,16:9,25,i", "352 x 576 (16:9) @ 25fps (PAL)"),
				 ("352,288,4:3,25,i", "352 x 288 (4:3) @ 25fps (PAL)"),
				 ("352,288,16:9,25,i", "352 x 288 (16:9) @ 25fps (PAL)"),
				 ("720,480,4:3,30,i", "720 x 480 (4:3) @ 30fps (NTSC)"),
				 ("720,480,16:9,30,i", "720 x 480 (16:9) @ 30fps (NTSC)"),
				 ("640,480,4:3,30,i", "640 x 480 (4:3) @ 30fps (NTSC)"),
				 ("640,480,16:9,30,i", "640 x 480 (16:9) @ 30fps (NTSC)"),
				 ("544,480,4:3,30,i", "544 x 480 (4:3) @ 30fps (NTSC)"),
				 ("544,480,16:9,30,i", "544 x 480 (16:9) @ 30fps (NTSC)"),
				 ("480,480,4:3,30,i", "480 x 480 (4:3) @ 30fps (NTSC)"),
				 ("480,480,16:9,30,i", "480 x 480 (16:9) @ 30fps (NTSC)"),
				 ("480,240,4:3,30,i", "480 x 240 (4:3) @ 30fps (NTSC)"),
				 ("480,240,16:9,30,i", "480 x 240 (16:9) @ 30fps (NTSC)"),
				 ("353,480,4:3,30,i", "353 x 480 (4:3) @ 30fps (NTSC)"),
				 ("353,480,16:9,30,i", "353 x 480 (16:9) @ 30fps (NTSC)"),
				 ("352,240,4:3,30,i", "352 x 240 (4:3) @ 30fps (NTSC)"),
				 ("352,240,16:9,30,i", "352 x 240 (16:9) @ 30fps (NTSC)"),
				 ("1920,1080,16:9,50,p", "1920 x 1080 (16:9) @ 50p (HTDV)"),
				 ("1920,1080,16:9,25,p", "1920 x 1080 (16:9) @ 25p (HTDV)"),
				 ("1920,1080,16:9,25,i", "1920 x 1080 (16:9) @ 25i (HTDV)"),
				 ("1440,1080,16:9,25,p", "1440 x 1080 (16:9) @ 25p (HTDV)"),
				 ("1440,1080,16:9,25,i", "1440 x 1080 (16:9) @ 25i (HTDV)"),
				 ("1280,720,16:9,50,p", "1280 x 720 (16:9) @ 50p (HDTV)"),
				 ("1280,720,16:9,25,p", "1280 x 720 (16:9) @ 25p (HDTV)"),
				 ("720,576,16:9,50,p", "720 x 576 (16:9) @ 50p (HDTV)")
				], "352,288,4:3,25,i")
		newServerConfigSubsection.overscancorrection = ConfigInteger(0, (0, 100))
		newServerConfigSubsection.soverlay = ConfigYesNo()
		newServer = VlcServer(newServerConfigSubsection)

		self.serverlist.append(newServer)

		return newServer
开发者ID:Haehnchen,项目名称:enigma2-plugins,代码行数:85,代码来源:VlcServerConfig.py

示例7: initProfileConfig

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import name [as 别名]
def initProfileConfig():
	s = ConfigSubsection()
	s.name =  ConfigText(default = "")
	s.code= ConfigText(default = "")
	config.plugins.Cradio.stations.append(s)
	return s
开发者ID:satdreamgr,项目名称:GreekNetRadio,代码行数:8,代码来源:plugin.py

示例8: new

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import name [as 别名]
	def new(self):
		newServerConfigSubsection = ConfigSubsection()
		config.plugins.vlcplayer.servers.append(newServerConfigSubsection)
		newServerConfigSubsection.name = ConfigText("Server " + str(self.__getServerCount()), False)
		if newServerConfigSubsection.name.value == newServerConfigSubsection.name.default:
			newServerConfigSubsection.name.default = ""
		newServerConfigSubsection.addressType = ConfigSelectionExtended(
				[("FQDN", _("FQDN")),
				 ("IP", _("IP-Address"))
				], "IP")
		newServerConfigSubsection.hostip = ConfigMutable(
				{"IP": ConfigIP([192,168,1,1]),
				 "FQDN": ConfigText("fqdname", False)
				}, newServerConfigSubsection.addressType.value)
		newServerConfigSubsection.httpport = ConfigInteger(8080, (0,65535))
		newServerConfigSubsection.vlctype = ConfigYesNo(False)
		newServerConfigSubsection.basedir = ConfigText("/", False)
		newServerConfigSubsection.pingonopen = ConfigYesNo(True)
		newServerConfigSubsection.usecachedir = ConfigYesNo(False)
		newServerConfigSubsection.cachedir = ConfigText("/media/hdd/movie", False)
		newServerConfigSubsection.dvdPath = ConfigText("", False)
		newServerConfigSubsection.transcodeVideo = ConfigYesNo()
		newServerConfigSubsection.transcodeAudio = ConfigYesNo(True)
		newServerConfigSubsection.videocodec = ConfigSelection(
				[("mp1v", "MPEG1"),
				 ("mp2v", "MPEG2")
				], "mp2v")
		newServerConfigSubsection.videobitrate = ConfigInteger(2000, (100, 9999))
		newServerConfigSubsection.audiocodec = ConfigSelection(
				[("mpga", "MPEG Layer 1 (mpga)"),
				 ("mp2a", "MPEG Layer 2 (mp2a)"),
				 ("mp3", "MPEG Layer 3 (mp3)")
				], "mp2a")
		newServerConfigSubsection.audiobitrate = ConfigInteger(128, (64, 320))
		newServerConfigSubsection.samplerate = ConfigSelection(
				[("32000", "32000"),
				 ("44100", "44100"),
				 ("48000", "48000"),
				 ("0", "0")
				], "44100")
		newServerConfigSubsection.audiochannels = ConfigInteger(2, (1, 9))
		newServerConfigSubsection.videonorm = ConfigSelection(
				[("720,576,4:3,25,i", "720 x 576 (4:3) @ 25fps (PAL)"),
				 ("720,576,16:9,25,i", "720 x 576 (16:9) @ 25fps (PAL)"),
				 ("704,576,4:3,25,i", "704 x 576 (4:3) @ 25fps (PAL)"),
				 ("704,440,4:3,25,i", "704 x 440 (4:3) @ 25fps (PAL)"),
				 ("704,420,4:3,25,i", "704 x 420 (4:3) @ 25fps (PAL)"),
				 ("704,400,4:3,25,i", "704 x 400 (4:3) @ 25fps (PAL)"),
				 ("704,576,16:9,25,i", "704 x 576 (16:9) @ 25fps (PAL)"),
				 ("544,576,4:3,25,i", "544 x 576 (4:3) @ 25fps (PAL)"),
				 ("544,576,16:9,25,i", "544 x 576 (16:9) @ 25fps (PAL)"),
				 ("480,576,4:3,25,i", "480 x 576 (4:3) @ 25fps (PAL)"),
				 ("480,576,16:9,25,i", "480 x 576 (16:9) @ 25fps (PAL)"),
				 ("480,288,4:3,25,i", "480 x 288 (4:3) @ 25fps (PAL)"),
				 ("480,288,16:9,25,i", "480 x 288 (16:9) @ 25fps (PAL)"),
				 ("352,576,4:3,25,i", "352 x 576 (4:3) @ 25fps (PAL)"),
				 ("352,576,16:9,25,i", "352 x 576 (16:9) @ 25fps (PAL)"),
				 ("352,288,4:3,25,i", "352 x 288 (4:3) @ 25fps (PAL)"),
				 ("352,288,16:9,25,i", "352 x 288 (16:9) @ 25fps (PAL)"),
				 ("720,480,4:3,30,i", "720 x 480 (4:3) @ 30fps (NTSC)"),
				 ("720,480,16:9,30,i", "720 x 480 (16:9) @ 30fps (NTSC)"),
				 ("640,480,4:3,30,i", "640 x 480 (4:3) @ 30fps (NTSC)"),
				 ("640,480,16:9,30,i", "640 x 480 (16:9) @ 30fps (NTSC)"),
				 ("544,480,4:3,30,i", "544 x 480 (4:3) @ 30fps (NTSC)"),
				 ("544,480,16:9,30,i", "544 x 480 (16:9) @ 30fps (NTSC)"),
				 ("480,480,4:3,30,i", "480 x 480 (4:3) @ 30fps (NTSC)"),
				 ("480,480,16:9,30,i", "480 x 480 (16:9) @ 30fps (NTSC)"),
				 ("480,240,4:3,30,i", "480 x 240 (4:3) @ 30fps (NTSC)"),
				 ("480,240,16:9,30,i", "480 x 240 (16:9) @ 30fps (NTSC)"),
				 ("353,480,4:3,30,i", "353 x 480 (4:3) @ 30fps (NTSC)"),
				 ("353,480,16:9,30,i", "353 x 480 (16:9) @ 30fps (NTSC)"),
				 ("352,240,4:3,30,i", "352 x 240 (4:3) @ 30fps (NTSC)"),
				 ("352,240,16:9,30,i", "352 x 240 (16:9) @ 30fps (NTSC)"),
				 ("1920,1080,16:9,50,p", "1920 x 1080 (16:9) @ 50p (HTDV)"),
				 ("1920,1080,16:9,25,p", "1920 x 1080 (16:9) @ 25p (HTDV)"),
				 ("1920,1080,16:9,25,i", "1920 x 1080 (16:9) @ 25i (HTDV)"),
				 ("1440,1080,16:9,25,p", "1440 x 1080 (16:9) @ 25p (HTDV)"),
				 ("1440,1080,16:9,25,i", "1440 x 1080 (16:9) @ 25i (HTDV)"),
				 ("1280,720,16:9,50,p", "1280 x 720 (16:9) @ 50p (HDTV)"),
				 ("1280,720,16:9,25,p", "1280 x 720 (16:9) @ 25p (HDTV)"),
				 ("720,576,16:9,50,p", "720 x 576 (16:9) @ 50p (HDTV)")
				], "352,288,4:3,25,i")
		newServerConfigSubsection.overscancorrection = ConfigInteger(0, (0, 100))
		newServerConfigSubsection.soverlay = ConfigYesNo()
		newServerConfigSubsection.subyellow = ConfigYesNo()
		
		newServerConfigSubsection.langInputType = ConfigSelectionExtended(
				[("track", _("tracks")),
				 ("language", _("languages"))
				], "language")
		newServerConfigSubsection.typeAudio = ConfigMutable(
				{"track": ConfigSelection([
							("-1","-1"),
							("0","0"),
							("1","1"),
							("2","2"),
							("3","3"),
							("4","4"),
							("5","5"),
							("6","6"),
#.........这里部分代码省略.........
开发者ID:68foxboris,项目名称:enigma2-plugins,代码行数:103,代码来源:VlcServerConfig.py

示例9: ConfigSubsection

# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import name [as 别名]
# for localized messages  	 
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,代码行数:33,代码来源:plugin.py


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