本文整理汇总了Python中Components.config.ConfigSubsection.save方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigSubsection.save方法的具体用法?Python ConfigSubsection.save怎么用?Python ConfigSubsection.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Components.config.ConfigSubsection
的用法示例。
在下文中一共展示了ConfigSubsection.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ftpserverFromURI
# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import save [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)
示例2: GrowleeConfiguration
# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import save [as 别名]
s.password.value = password
s.protocol.value = growlee.protocol.value
s.level.value = growlee.level.value
s.blacklist.value = growlee.blacklist.value
growlee.enable_incoming.value = False
growlee.enable_outgoing.value = False
growlee.address.value = ""
growlee.password.value = ""
growlee.prowl_api_key.value = ""
growlee.protocol.value = "growl"
growlee.level.value = "-1"
growlee.blacklist.value = []
growlee.hostcount.value += 1
growlee.save()
del s
del i, growlee
class GrowleeConfiguration(Screen, ConfigListScreen):
skin = """
<screen name="GrowleeConfiguration" position="center,center" size="560,400" title="Growlee Setup" >
<ePixmap position="0,0" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
<ePixmap position="140,0" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
<ePixmap position="280,0" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
<ePixmap position="420,0" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
<widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />