def _LoginThread(self, parent, userinfo, cfg_cache): JWXTLoginThreadMixin._LoginThread(self, parent, userinfo, cfg_cache) wx.CallAfter(parent.notify_status, _(u'获取学年与学期信息')) self._kbList1, self._kbList2 = self._affairs.prepare4curriculum() yr_default, tm_default = self._affairs.curriculum_defaults yr_default = self._kbList1.index(yr_default) tm_default = self._kbList2.index(tm_default) # List of choice initialization postponed, because the lists # are not yet available at the time of overall frame init wx.CallAfter(self.kbL1.SetItems, self._kbList1) wx.CallAfter(self.kbL2.SetItems, self._kbList2) wx.CallAfter(self.kbL2.InvalidateBestSize) wx.CallAfter(self.kbL1.Fit) wx.CallAfter(self.kbL2.Fit) wx.CallAfter(self.kbL1.Select, yr_default) wx.CallAfter(self.kbL2.Select, tm_default) wx.CallAfter(self.SetStatusText, _(u'请选择学年和学期')) wx.CallAfter(parent.notify_status, _(u'准备就绪')) wx.CallAfter(parent.toggle_working) wx.CallAfter(self.Show) return
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