Пример #1
0
 def _runTask(self):
     newValue = self.getPage()._getSiteUrl()
     # fire evt to start busy animation
     self.refreshPage(u"begin-autodiscover", newValue)  #$NON-NLS-1$
     rval = False
     try:
         # reset previous value
         self.getSession().setProperty(u"siteurl-page.discover-info",
                                       None)  #$NON-NLS-1$
         discoverInfo = self.getPage()._getModel().autodiscover(newValue)
         #print u"ZAutodiscoverTask info",discoverInfo #$NON-NLS-1$ FIXME (PJ) remove this debug line
         self.getSession().setProperty(u"siteurl-page.discover-info",
                                       discoverInfo)  #$NON-NLS-1$
         # cache successful results
         if discoverInfo and discoverInfo.siteId:
             cacheMap = self.getSession().getProperty(
                 u"siteurl-page.discover-info-cache")  #$NON-NLS-1$
             if cacheMap is None:
                 cacheMap = {}
                 self.getSession().setProperty(
                     u"siteurl-page.discover-info-cache",
                     cacheMap)  #$NON-NLS-1$
             cacheMap[newValue] = discoverInfo
         rval = True
     except Exception, e:
         # FIXME (PJ) show friendly error messages
         # fire evt to show error message to user.
         zex = ZException(rootCause=e)
         data = (u"Auto discovery error", zex.getStackTrace(), zex
                 )  #$NON-NLS-1$
         self.refreshPage(u"error-autodiscover", data)  #$NON-NLS-1$
Пример #2
0
 def _runTask(self):
     newValue = self.getPage()._getSiteUrl()
     # fire evt to start busy animation
     self.refreshPage(u"begin-autodiscover",newValue) #$NON-NLS-1$
     rval = False
     try:
         # reset previous value
         self.getSession().setProperty(u"siteurl-page.discover-info", None) #$NON-NLS-1$
         discoverInfo = self.getPage()._getModel().autodiscover(newValue)
         #print u"ZAutodiscoverTask info",discoverInfo #$NON-NLS-1$ FIXME (PJ) remove this debug line
         self.getSession().setProperty(u"siteurl-page.discover-info", discoverInfo) #$NON-NLS-1$
         # cache successful results
         if discoverInfo and discoverInfo.siteId:
             cacheMap = self.getSession().getProperty(u"siteurl-page.discover-info-cache") #$NON-NLS-1$
             if cacheMap is None:
                 cacheMap = {}
                 self.getSession().setProperty(u"siteurl-page.discover-info-cache", cacheMap) #$NON-NLS-1$
             cacheMap[newValue] = discoverInfo
         rval = True
     except Exception, e:
         # FIXME (PJ) show friendly error messages
         # fire evt to show error message to user.
         zex = ZException(rootCause = e)
         data = (u"Auto discovery error", zex.getStackTrace(), zex) #$NON-NLS-1$
         self.refreshPage(u"error-autodiscover", data) #$NON-NLS-1$
Пример #3
0
    def _reportException(self, exception):
        if not isinstance(exception, ZException):
            exception = ZException(
                _extstr(u"backgroundtaskimpl.UnexpectedBGTaskError") %
                self.getName(), exception)  #$NON-NLS-1$
        self.logger.exception(exception)

        self._raiseError(exception.getMessage(), exception.getStackTrace())
Пример #4
0
def ZShowExceptionWithFeedback(parent, zexception):
    if not isinstance(zexception, ZException):
        zexception = ZException(rootCause=zexception)

    dlg = ZExceptionWithFeedbackDialog(parent, zexception)
    dlg.CentreOnParent()
    rval = dlg.ShowModal()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)

    if rval == wx.ID_OK:
        from zoundry.appframework.ui.util.feedbackutil import ZFeedbackUtil

        ZFeedbackUtil().doFeedback(parent, zexception.getMessage(), zexception.getStackTrace())
Пример #5
0
 def _runTask(self):
     # fire evt to start busy animation
     self.refreshPage(u"begin-listblogs") #$NON-NLS-1$
     rval = False
     try:
         blogs = self.getPage()._getModel().listBlogs(self.siteId, self.username, self.password, self.apiUrl)
         idx = 0
         idBlogList = []
         for blog in blogs:
             idBlogList.append( (idx, blog) )
             idx = idx + 1
         self.getSession().setProperty(u"apiinfo-page.modifykey", self.key) #$NON-NLS-1$
         self.getSession().setProperty(u"apiinfo-page.id-bloglist", idBlogList) #$NON-NLS-1$
         rval = True
     except Exception, e:
         # FIXME (PJ) show friendly error messages
         zex = ZException(rootCause = e)
         data = (u"Error fetching list of blogs", zex.getStackTrace(), zex) #$NON-NLS-1$
         # fire evt to show error message to user.
         self.refreshPage(u"error-listblogs", data) #$NON-NLS-1$
Пример #6
0
 def _runTask(self):
     # fire evt to start busy animation
     self.refreshPage(u"begin-listblogs")  #$NON-NLS-1$
     rval = False
     try:
         blogs = self.getPage()._getModel().listBlogs(
             self.siteId, self.username, self.password, self.apiUrl)
         idx = 0
         idBlogList = []
         for blog in blogs:
             idBlogList.append((idx, blog))
             idx = idx + 1
         self.getSession().setProperty(u"apiinfo-page.modifykey",
                                       self.key)  #$NON-NLS-1$
         self.getSession().setProperty(u"apiinfo-page.id-bloglist",
                                       idBlogList)  #$NON-NLS-1$
         rval = True
     except Exception, e:
         # FIXME (PJ) show friendly error messages
         zex = ZException(rootCause=e)
         data = (u"Error fetching list of blogs", zex.getStackTrace(), zex
                 )  #$NON-NLS-1$
         # fire evt to show error message to user.
         self.refreshPage(u"error-listblogs", data)  #$NON-NLS-1$
Пример #7
0
    def _reportException(self, exception):
        if not isinstance(exception, ZException):
            exception = ZException(_extstr(u"backgroundtaskimpl.UnexpectedBGTaskError") % self.getName(), exception) #$NON-NLS-1$
        self.logger.exception(exception)

        self._raiseError(exception.getMessage(), exception.getStackTrace())