本文整理汇总了Python中ubuntui.ev.EventLoop.exit方法的典型用法代码示例。如果您正苦于以下问题:Python EventLoop.exit方法的具体用法?Python EventLoop.exit怎么用?Python EventLoop.exit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntui.ev.EventLoop
的用法示例。
在下文中一共展示了EventLoop.exit方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finish
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def finish(self, needs_lxd_setup=False, lxdnetwork=None, back=False):
""" Processes the new LXD setup and loads the controller to
finish bootstrapping the model.
Arguments:
back: if true loads previous controller
needs_lxd_setup: if true prompt user to run lxd init
"""
if back:
return controllers.use('clouds').render()
if needs_lxd_setup:
EventLoop.remove_alarms()
EventLoop.exit(1)
if lxdnetwork is None:
return app.ui.show_exception_message(
Exception("Unable to configure LXD network bridge."))
formatted_network = self.__format_input(lxdnetwork)
app.log.debug("LXD Config {}".format(formatted_network))
out = self.__format_conf(formatted_network)
with NamedTemporaryFile(mode="w", encoding="utf-8",
delete=False) as tempf:
app.log.debug("Saving LXD config to {}".format(tempf.name))
utils.spew(tempf.name, out)
sh = utils.run('sudo mv {} /etc/default/lxd-bridge'.format(
tempf.name), shell=True)
if sh.returncode > 0:
return app.ui.show_exception_message(
Exception("Problem saving config: {}".format(
sh.stderr.decode('utf8'))))
app.log.debug("Restarting lxd-bridge")
utils.run("sudo systemctl restart lxd-bridge.service", shell=True)
utils.pollinate(app.session_id, 'L002')
controllers.use('newcloud').render(
cloud='localhost', bootstrap=True)
示例2: unhandled_input
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def unhandled_input(self, key):
if key in ['q', 'Q']:
EventLoop.exit(0)
示例3: cancel
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def cancel(self, btn):
EventLoop.exit(0)
示例4: finish
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def finish(self):
EventLoop.remove_alarms()
EventLoop.exit(0)
示例5: cancel
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def cancel(self, button):
pollinate(app.session_id, 'UC')
EventLoop.exit(0)
示例6: cancel
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def cancel(self, button):
EventLoop.exit(0)
示例7: unhandled_input
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def unhandled_input(key):
if key in ['q', 'Q']:
async.shutdown()
EventLoop.exit(0)
示例8: done_cb
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import exit [as 别名]
def done_cb(self):
log.debug("done_cb called")
EventLoop.exit(0)