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


Python WebService.link_registration方法代碼示例

本文整理匯總了Python中stoqlib.lib.webservice.WebService.link_registration方法的典型用法代碼示例。如果您正苦於以下問題:Python WebService.link_registration方法的具體用法?Python WebService.link_registration怎麽用?Python WebService.link_registration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stoqlib.lib.webservice.WebService的用法示例。


在下文中一共展示了WebService.link_registration方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: next_step

# 需要導入模塊: from stoqlib.lib.webservice import WebService [as 別名]
# 或者: from stoqlib.lib.webservice.WebService import link_registration [as 別名]
    def next_step(self):
        # We already sent the details, but may still be on the same step.
        # Also, if the user didn't choose to "register now", respect his
        # decision
        if not self.model.register_now or self.wizard.link_request_done:
            return FinishInstallationStep(self.wizard)

        webapi = WebService()
        response = webapi.link_registration(
            self.model.name, self.model.email, self.model.phone)
        response.addCallback(self._on_response_done)
        response.addErrback(self._on_response_error)

        # FIXME: This is a hack, remove it when we can avoid
        #        calling dialog.run()
        if not reactor.running:
            reactor.run()

        self.send_progress.show()
        self.send_progress.set_text(_('Sending...'))
        self.send_progress.set_pulse_step(0.05)
        self.wizard.next_button.set_sensitive(False)
        glib.timeout_add(50, self._pulse)

        # Cancel the request after 30 seconds without a reply
        glib.timeout_add(30000, self._cancel_request)

        # Stay on the same step while sending the details
        return self
開發者ID:adrianoaguiar,項目名稱:stoq,代碼行數:31,代碼來源:config.py

示例2: next_step

# 需要導入模塊: from stoqlib.lib.webservice import WebService [as 別名]
# 或者: from stoqlib.lib.webservice.WebService import link_registration [as 別名]
    def next_step(self):
        # We already sent the details, but may still be on the same step.
        # Also, if the user didn't choose to "register now", respect his
        # decision
        if not self.model.register_now or self.wizard.link_request_done:
            return FinishInstallationStep(self.wizard)

        webapi = WebService()
        webapi.link_registration(
            self.model.name, self.model.email, self.model.phone,
            callback=lambda r: schedule_in_main_thread(self._on_response_done, r),
            errback=lambda e: schedule_in_main_thread(self._on_response_error, e))

        self.send_progress.show()
        self.send_progress.set_text(_('Sending...'))
        self.send_progress.set_pulse_step(0.05)
        self.wizard.next_button.set_sensitive(False)
        GLib.timeout_add(50, self._pulse)

        # Cancel the request after 30 seconds without a reply
        GLib.timeout_add(30000, self._cancel_request)

        # Stay on the same step while sending the details
        return self
開發者ID:hackedbellini,項目名稱:stoq,代碼行數:26,代碼來源:config.py


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