Exemplo n.º 1
0
 def GetJobProgressRatio(self):
     if self.status == industry.STATUS_INSTALLED:
         timeLeft = blue.os.GetWallclockTime() - util.DateToBlue(self.startDate)
         totalTime = long(self.time.total_seconds()) * const.SEC
         return float(timeLeft) / totalTime
     elif self.status == industry.STATUS_PAUSED:
         timeLeft = blue.os.GetWallclockTime() - util.DateToBlue(self.startDate)
         totalTime = long(self.time.total_seconds()) * const.SEC
         return float(timeLeft) / totalTime
     elif self.status > industry.STATUS_COMPLETED:
         return 1.0
     else:
         return 0.0
Exemplo n.º 2
0
 def GetJobTimeLeftLabel(self):
     if self.status == industry.STATUS_UNSUBMITTED:
         time = self.time.total_seconds() * const.SEC
     elif self.status == industry.STATUS_INSTALLED:
         time = util.DateToBlue(self.endDate) - blue.os.GetWallclockTime()
     elif self.status == industry.STATUS_PAUSED:
         time = util.DateToBlue(self.endDate) - util.DateToBlue(self.pauseDate)
     elif self.status == industry.STATUS_READY:
         time = 0
     else:
         return '-'
     time = long(max(time, 0L))
     return FormatTimeInterval(time)
Exemplo n.º 3
0
 def _PollJobCompletionThreaded(self):
     for job in self.installed.values():
         if job.status == industry.STATUS_INSTALLED and util.DateToBlue(
                 job.endDate) < blue.os.GetWallclockTime():
             job.status = industry.STATUS_READY
             sm.ScatterEvent('OnIndustryJob', job.jobID, job.ownerID,
                             job.blueprintID, job.installerID, job.status,
                             None)
Exemplo n.º 4
0
 def _PollJobCompletionThreaded(self):
     """
     Polls the weakref dictionary of loaded jobs to see if their end date has passed
     in which case the job is completed. Scatters an OnIndustryJob event if they change.
     """
     for job in self.installed.values():
         if job.status == industry.STATUS_INSTALLED and util.DateToBlue(
                 job.endDate) < blue.os.GetWallclockTime():
             job.status = industry.STATUS_READY
             sm.ScatterEvent('OnIndustryJob', job.jobID, job.ownerID,
                             job.blueprintID, job.installerID, job.status,
                             None)
Exemplo n.º 5
0
 def GetEndDateLabel(self):
     return util.FmtDate(util.DateToBlue(self.endDate), 'ls')
Exemplo n.º 6
0
 def GetStartDateLabel(self):
     return util.FmtDate(util.DateToBlue(self.startDate), 'ls')