本文整理汇总了Python中service.Service.set方法的典型用法代码示例。如果您正苦于以下问题:Python Service.set方法的具体用法?Python Service.set怎么用?Python Service.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.Service
的用法示例。
在下文中一共展示了Service.set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import set [as 别名]
#.........这里部分代码省略.........
self.buttons['nodes'] = nodes = Button(self.window, text="Nodes")
self.buttons['groups'] = groups = Button(self.window, text="Groups")
self.buttons['groupsedit'] = groups
self.buttons['managers'] = managers = Button(self.window, text="Managers")
services.grid(row=0, column=0)
nodes.grid(row=0, column=1)
groups.grid(row=0, column=2)
managers.grid(row=0, column=3)
nodes['command'] = self.switchtonodes
groups['command'] = self.switchtogroups
managers['command'] = self.switchtomanagers
services['command'] = self.switchtoservices
self.frames['services'] = ServicesFrame(self.window, self)
self.frames['servicesedit'] = ServiceseditFrame(self.window, self)
self.frames['nodes'] = NodesFrame(self.window, self)
self.frames['groups'] = GroupsFrame(self.window, self)
self.frames['groupsedit'] = GroupseditFrame(self.window, self)
self.frames['managers'] = ManagersFrame(self.window, self)
def switchtonodes(self) :
if self.current :
self.frames[self.current].detach()
self.buttons[self.current]['relief'] = RAISED
self.current = 'nodes'
self.buttons[self.current]['relief'] = SUNKEN
self.frames[self.current].attach()
def switchtogroups(self) :
if self.current :
self.frames[self.current].detach()
self.buttons[self.current]['relief'] = RAISED
self.current = 'groups'
self.buttons[self.current]['relief'] = SUNKEN
self.frames[self.current].attach()
def switchtogroupsedit(self) :
if self.current :
self.frames[self.current].detach()
self.buttons[self.current]['relief'] = RAISED
self.current = 'groupsedit'
self.buttons[self.current]['relief'] = SUNKEN
self.frames[self.current].attach()
def switchtomanagers(self) :
if self.current :
self.frames[self.current].detach()
self.buttons[self.current]['relief'] = RAISED
self.current = 'managers'
self.buttons[self.current]['relief'] = SUNKEN
self.frames[self.current].attach()
def switchtoservices(self) :
if self.current :
self.frames[self.current].detach()
self.buttons[self.current]['relief'] = RAISED
self.current = 'services'
self.buttons[self.current]['relief'] = SUNKEN
self.frames[self.current].attach()
def switchtoservicesedit(self) :
if self.current :
self.frames[self.current].detach()
self.buttons[self.current]['relief'] = RAISED
self.current = 'servicesedit'
self.buttons[self.current]['relief'] = SUNKEN
self.frames[self.current].attach()
def start(self) :
self.switchtoservices()
self.window.mainloop()
def save(self) :
config.save()
def reloadgroups(self) :
self.frames['groups'].reloadgroups()
self.frames['groupsedit'].reloadgroups()
def reloadnodes(self) :
self.frames['nodes'].reloadnodes()
def reloadservices(self) :
self.frames['services'].reloadservices()
self.frames['servicesedit'].reloadservices()
def reloadmanagers(self) :
self.frames['managers'].reloadmanagers()
self.frames['nodes'].reloadmanagers()
def openselector(self, selection, callback, selectmode=BROWSE) :
selector = SelectorFrame(self.window, selectmode)
selector.load(selection, callback)
def do(self, action, service, callback) :
self.service = Service(config)
self.service.set(action, service, callback)
self.service.start()