本文整理汇总了Python中ubuntui.ev.EventLoop.remove_alarms方法的典型用法代码示例。如果您正苦于以下问题:Python EventLoop.remove_alarms方法的具体用法?Python EventLoop.remove_alarms怎么用?Python EventLoop.remove_alarms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntui.ev.EventLoop
的用法示例。
在下文中一共展示了EventLoop.remove_alarms方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finish
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def finish(self, step_model, step_widget, done=False):
""" handles processing step with input data
Arguments:
step_model: step_model returned from widget
done: if True continues on to the summary view
"""
if done:
EventLoop.remove_alarms()
return controllers.use('summary').render(self.results)
# Set next button focus here now that the step is complete.
self.view.steps.popleft()
if len(self.view.steps) > 0:
next_step = self.view.steps[0]
next_step.generate_additional_input()
self.view.step_pile.focus_position = self.view.step_pile.focus_position + 1 # noqa
else:
app.log.debug(
"End of step list setting the view "
"summary button in focus.")
index = self.view.current_summary_button_index
app.log.debug("Next focused button: {}".format(index))
self.view.step_pile.focus_position = index
future = async.submit(partial(common.do_step,
step_model,
step_widget,
app.ui.set_footer,
gui=True),
partial(self.__handle_exception, 'E002'))
future.add_done_callback(self.get_result)
示例2: __handle_bootstrap_done
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def __handle_bootstrap_done(self, future):
app.log.debug("handle bootstrap")
result = future.result()
if result.returncode < 0:
# bootstrap killed via user signal, we're quitting
return
if result.returncode > 0:
err = result.stderr.read().decode()
app.log.error(err)
return self.__handle_exception(Exception("error "))
utils.pollinate(app.session_id, 'J004')
EventLoop.remove_alarms()
app.ui.set_footer('Bootstrap complete...')
self.__post_bootstrap_exec()
示例3: finish
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [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)
示例4: __handle_exception
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def __handle_exception(self, tag, exc):
utils.pollinate(app.session_id, tag)
EventLoop.remove_alarms()
app.ui.show_exception_message(exc)
示例5: ConjureUI
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
from conjureup import async
from conjureup.app_config import app
from ubuntui.ev import EventLoop
import macumba
import errno
class ConjureUI(Frame):
def show_exception_message(self, ex):
if isinstance(ex, async.ThreadCancelledException):
pass
elif isinstance(ex, macumba.errors.ServerError):
errmsg = ex.args[1]
elif hasattr(ex, 'errno') and ex.errno == errno.ENOENT:
# handle oserror
errmsg = ex.args[1]
else:
errmsg = ex.args[0]
errmsg += ("\n\n"
"Review log messages at /var/log/conjure-up/combined.log "
"If appropriate, please submit a bug here: "
"https://bugs.launchpad.net/conjure-up/+filebug")
self.frame.body = ErrorView(errmsg)
app.log.exception("Showing dialog for exception:")
EventLoop.remove_alarms()
def show_error_message(self, msg):
self.frame.body = ErrorView(msg)
示例6: finish
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def finish():
EventLoop.remove_alarms()
示例7: _handle_exception
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def _handle_exception(self, tag, exc):
track_exception(exc.args[0])
app.ui.show_exception_message(exc)
self.showing_error = True
EventLoop.remove_alarms()
示例8: __handle_exception
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def __handle_exception(self, tag, exc):
track_exception(exc.args[0], is_fatal=True)
EventLoop.remove_alarms()
app.ui.show_exception_message(exc)
示例9: _handle_exception
# 需要导入模块: from ubuntui.ev import EventLoop [as 别名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 别名]
def _handle_exception(self, tag, exc):
utils.pollinate(app.session_id, tag)
app.ui.show_exception_message(exc)
self.showing_error = True
EventLoop.remove_alarms()