本文整理汇总了Python中tomato.devices.Device.getCapabilities方法的典型用法代码示例。如果您正苦于以下问题:Python Device.getCapabilities方法的具体用法?Python Device.getCapabilities怎么用?Python Device.getCapabilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomato.devices.Device
的用法示例。
在下文中一共展示了Device.getCapabilities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getCapabilities
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getCapabilities [as 别名]
def getCapabilities(self, user):
capabilities = Device.getCapabilities(self, user)
isUser = self.topology.checkAccess(Permission.ROLE_USER, user)
capabilities["configure"].update({
"template": self.state == State.CREATED,
"args": self.state != State.STARTED,
})
capabilities.update(other={
"console": isUser and self.getVncPort() and self.state == State.STARTED
})
return capabilities
示例2: getCapabilities
# 需要导入模块: from tomato.devices import Device [as 别名]
# 或者: from tomato.devices.Device import getCapabilities [as 别名]
def getCapabilities(self, user):
capabilities = Device.getCapabilities(self, user)
isUser = self.topology.checkAccess(Permission.ROLE_USER, user)
capabilities["configure"].update({
"template": self.state == State.CREATED,
"root_password": True,
"gateway4": True,
"gateway6": True,
})
capabilities["action"].update({
"execute": isUser and self.state == State.STARTED,
})
capabilities.update(other={
"console": isUser and self.getVncPort() and self.state == State.STARTED
})
return capabilities