Merge pull request #318 from cuu/master

Warehouse
This commit is contained in:
GNU 2019-12-29 00:31:15 +08:00 committed by GitHub
commit d7b75ddec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,6 @@ class RPCStack:
class LoadHousePage(Page):
_FootMsg = ["Nav.","","","Back","Cancel"]
_DownloaderTimer = -1
_Value = 0
_URL = None
_ListFontObj = MyLangManager.TrFont("varela18")
@ -188,7 +187,6 @@ class LoadHousePage(Page):
class ImageDownloadProcessPage(Page):
_FootMsg = ["Nav.","","","Back",""]
_DownloaderTimer = -1
_Value = 0
_URL = None
_ListFontObj = MyLangManager.TrFont("varela13")
@ -344,7 +342,9 @@ class Aria2DownloadProcessPage(Page):
self._SizeLabel.Init("0/0Kb",MyLangManager.TrFont("varela12"))
self._SizeLabel.SetColor( self._URLColor )
@property
def GObjectUpdateProcessInterval(self):
downloaded = 0
if self._Screen.CurPage() == self and self._GID is not None:
self._Value = config.RPC.tellStatus(self._GID)
@ -352,9 +352,9 @@ class Aria2DownloadProcessPage(Page):
total = 0
if self._Value["status"] == "waiting":
self._FileNameLabel.SetText( "waiting to download..." )
self._FileNameLabel.SetText("waiting to download...")
if self._Value["status"] == "paused":
self._FileNameLabel.SetText( "download paused..." )
self._FileNameLabel.SetText("download paused...")
if self._Value["status"] == "error":
self._FileNameLabel.SetText("download errors,cancel it please")
@ -362,17 +362,16 @@ class Aria2DownloadProcessPage(Page):
downloaded = self._Value["completedLength"]
total = self._Value["totalLength"]
downloaded = downloaded/1000.0/1000.0
total = total/1000.0/1000.0
downloaded = downloaded / 1000.0 / 1000.0
total = total / 1000.0 / 1000.0
self._SizeLabel.SetText( "%.2f" % downloaded+"/"+ "%.2f" % total +"Mb")
self._SizeLabel.SetText("%.2f" % downloaded+"/"+"%.2f" % total+"Mb")
print("Progress: %d%%" % (self._Value))
self._Screen.Draw()
self._Screen.SwapAndShow()
return True
else:
return False
def CheckDownload(self,aria2_gid):
self._GID = aria2_gid