當前位置: 首頁>>代碼示例>>Python>>正文


Python EventLoop.remove_alarms方法代碼示例

本文整理匯總了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)
開發者ID:graywen24,項目名稱:conjure-up,代碼行數:34,代碼來源:gui.py

示例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()
開發者ID:battlemidget,項目名稱:conjure-up,代碼行數:17,代碼來源:gui.py

示例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)
開發者ID:battlemidget,項目名稱:conjure-up,代碼行數:43,代碼來源:gui.py

示例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)
開發者ID:graywen24,項目名稱:conjure-up,代碼行數:6,代碼來源:gui.py

示例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)
開發者ID:graywen24,項目名稱:conjure-up,代碼行數:32,代碼來源:__init__.py

示例6: finish

# 需要導入模塊: from ubuntui.ev import EventLoop [as 別名]
# 或者: from ubuntui.ev.EventLoop import remove_alarms [as 別名]
def finish():
    EventLoop.remove_alarms()
開發者ID:benluteijn,項目名稱:conjure-up,代碼行數:4,代碼來源:gui.py

示例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()
開發者ID:conjure-up,項目名稱:conjure-up,代碼行數:7,代碼來源:gui.py

示例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)
開發者ID:conjure-up,項目名稱:conjure-up,代碼行數:6,代碼來源:gui.py

示例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()
開發者ID:graywen24,項目名稱:conjure-up,代碼行數:7,代碼來源:gui.py


注:本文中的ubuntui.ev.EventLoop.remove_alarms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。