Ejemplo n.º 1
0
    def _LoginThread(self, prnt, userinfo, cfg_obj):
        # Call the common login routine thru the mixin...
        JWXTLoginThreadMixin._LoginThread(self, prnt, userinfo, cfg_obj)

        wx.CallAfter(prnt.notify_status, _(u'准备查询成绩'))
        if not self._affairs.prepare4scores():
            wx.CallAfter(prnt.notify_status, _(u'页面打开失败,请稍后再试>_<'))
            wx.CallAfter(prnt.toggle_working)
            wx.CallAfter(self.Destroy)
            return

        wx.CallAfter(prnt.notify_status, _(u'查询中'))
        if not self._affairs.get_scores():
            wx.CallAfter(prnt.notify_status, _(u'成绩查询失败,请稍后再试- -'))
            wx.CallAfter(prnt.toggle_working)
            wx.CallAfter(self.Destroy)
            return

        # the score table is at our disposal (=
        tbl = self._affairs.scores
        wx.CallAfter(self._init_grid, self.scoregrid, tbl)

        # Show method invoked before logout, so that result appears more
        # timely, enhancing user experience.
        wx.CallAfter(self.Show)

        # Call LogoutThread code...
        # That piece of code is already meant to be executed in a separate
        # thread, so directly invoking is perfectly OK.
        # self pointer and parent window
        JWXTLoginThreadMixin._LogoutThread(self, prnt, toggle=False) # evt=None

        # The LogoutThread doesn't change the current progressbar visibility
        # (we suppressed its toggling behavior), so we must turn off it manually
        wx.CallAfter(prnt.toggle_working)
        return