本文整理汇总了Python中actions.Actions.start_settings_server方法的典型用法代码示例。如果您正苦于以下问题:Python Actions.start_settings_server方法的具体用法?Python Actions.start_settings_server怎么用?Python Actions.start_settings_server使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类actions.Actions
的用法示例。
在下文中一共展示了Actions.start_settings_server方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from actions import Actions [as 别名]
# 或者: from actions.Actions import start_settings_server [as 别名]
class GUI:
def __init__(self):
self.wsControlLabels = []
self.wsControlLabels.append(settings.wireless_switch["ws_1_name"] + " On")
self.wsControlLabels.append(settings.wireless_switch["ws_1_name"] + " Off")
self.wsControlLabels.append(settings.wireless_switch["ws_2_name"] + " On")
self.wsControlLabels.append(settings.wireless_switch["ws_2_name"] + " Off")
self.wsControlLabels.append(settings.wireless_switch["ws_3_name"] + " On")
self.wsControlLabels.append(settings.wireless_switch["ws_3_name"] + " Off")
self.wsControlLabels.append("- - -")
self.wsControlLabels.append("Toggle Service on/off")
self.actions = Actions()
def toggleService(self):
settings.update_general()
if settings.general["service_enabled"]:
settings.set("service_enabled", "false")
else:
settings.set("service_enabled", "true")
settings.update_general()
def show(self):
## main loop ##
while True:
if settings.general["service_enabled"]:
self.wsControlLabels[7] = "Disable Service"
else:
self.wsControlLabels[7] = "Enable Service"
idx = Dialog().select(addonname, self.wsControlLabels)
xbmc.log(msg=self.wsControlLabels[idx], level=xbmc.LOGDEBUG)
if idx >= 0 and idx <= 5:
wsID = str(idx / 2 + 1)
powerState = "0"
if idx % 2 == 0:
powerState = "1"
self.actions.ws_control(wsID,powerState)
elif idx == 7:
self.toggleService()
elif idx == 8:
self.actions.start_settings_server()
elif idx == -1:
break
else:
break
sys.modules.clear()