本文整理汇总了Python中Components.config.ConfigSubsection.type方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigSubsection.type方法的具体用法?Python ConfigSubsection.type怎么用?Python ConfigSubsection.type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Components.config.ConfigSubsection
的用法示例。
在下文中一共展示了ConfigSubsection.type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createConfig
# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import type [as 别名]
def createConfig(self, foo):
global tuning
if not tuning:
tuning = ConfigSubsection()
tuning.type = ConfigSelection(
default = "manual_transponder",
choices = { "manual_transponder" : _("Manual transponder"),
"predefined_transponder" : _("Predefined transponder") } )
tuning.sat = ConfigSatlist(list=nimmanager.getRotorSatListForNim(self.feid))
tuning.sat.addNotifier(self.tuningSatChanged)
self.updateTransponders()
orb_pos = self.fe_data.get("orbital_position", None)
if orb_pos is not None:
for x in nimmanager.getRotorSatListForNim(self.feid):
opos = str(orb_pos)
if x[0] == orb_pos and tuning.sat.value != opos:
tuning.sat.value = opos
del self.fe_data["orbital_position"]
ScanSetup.createConfig(self, self.fe_data)
示例2: ConfigSubsection
# 需要导入模块: from Components.config import ConfigSubsection [as 别名]
# 或者: from Components.config.ConfigSubsection import type [as 别名]
from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigInteger, ConfigYesNo, ConfigText, ConfigSelection, ConfigSubList, ConfigIP
from Components.Sources.StaticText import StaticText
from Components.MenuList import MenuList
from Components.MultiContent import MultiContentEntryText
from Components.ActionMap import ActionMap
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')