Example #1
0
 def send():
     try:
         oneStep = 1.0/float((2 + self.tracksCount + int(self.doConnect)))
         self.progress = 100 * (float(int(self.prepareFinished) + int(self.connecttracksFinished)
                                + self.tracksFinished + int(self.laststepsFinished)) * oneStep)
         
         txtVorbereitungen = self.lang["finished"] if self.prepareFinished else self.lang["elapsed"]
         txtTracks = "{} / {}".format(self.tracksFinished, self.tracksCount)
         txtConnect = "" if not self.doConnect else (self.lang["finished"] if self.connecttracksFinished else self.lang["elapsed"])
         txtLaststeps = self.lang["finished"] if self.laststepsFinished else self.lang["elapsed"]
         txtTime = core.secsToTime(time.time()-self.starttime)
         
         if self.finished or self.canceld:
             txtRestTime = "00:00"
         elif self.resttimeAtTime == 0 and self.resttime == 0:
             txtRestTime = "???"
         else:
             secs = self.resttime-(time.time()-self.resttimeAtTime)
             if secs < 0:
                 txtRestTime = "???"
             else:
                 txtRestTime = core.secsToTime(secs)
         
         wx.CallAfter(self.setStatus,
                      txtVorbereitungen, txtTracks, txtConnect, txtLaststeps, txtTime, txtRestTime, self.progress)
     except:
         pass