MCPcopy Create free account
hub / github.com/PlayOnLinux/POL-POM-4 / TimerAction

Method TimerAction

python/setupwindow/POL_SetupFrame.py:309–343  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

307 return self.Result
308
309 def TimerAction(self, event):
310 ## If the setup window is downloading a file, it is a good occasion to update the progress bar
311 if (self.Timer_downloading == True):
312 if (self.downloader.taille_bloc != 0):
313 downloaded = self.downloader.nb_blocs * self.downloader.taille_bloc
314 octetsLoadedB = downloaded / 1048576.0
315 octetsLoadedN = str(round(octetsLoadedB, 1))
316
317 # may be -1 on older FTP servers which do not return a file size in response to a retrieval request
318 if self.downloader.taille_fichier >= 0:
319 self.gauge.SetRange(self.downloader.taille_fichier)
320
321 try:
322 self.gauge.SetValue(downloaded)
323 except wx._core.PyAssertionError:
324 pass
325
326 tailleFichierB = self.downloader.taille_fichier / 1048576.0
327 tailleFichierN = str(round(tailleFichierB, 1))
328 else:
329 tailleFichierN = "?"
330
331 estimation_txt = octetsLoadedN + " " + _("of") + " " + tailleFichierN + " " + _("MB downloaded")
332 self.txtEstimation.SetLabel(estimation_txt)
333
334 if (self.downloader.finished == True):
335 if (self.downloader.failed == True):
336 self.release_but_fail(self)
337 else:
338 self.release(self)
339 self.Timer_downloading = False
340
341 if (self.Timer_animate == True):
342 self.current_angle = ((self.current_angle + 1) % 12)
343 self.animation.SetBitmap(self.GetLoaderFromAngle(self.current_angle + 1))
344
345 ### Theses methods command the window. There are called directly by the server
346 def POL_SetupWindow_message(self, message, title):

Callers

nothing calls this directly

Calls 3

release_but_failMethod · 0.95
releaseMethod · 0.95
GetLoaderFromAngleMethod · 0.95

Tested by

no test coverage detected