Merge pull request #63 from 4k1/hotfix/v1.2_refactored

Removed unnecessary codes and fixed a bit
This commit is contained in:
GNU 2018-07-27 20:47:42 +08:00 committed by GitHub
commit 5dd47f599b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,13 +24,6 @@ class UpdateConfirmPage(ConfirmPage):
_RetroArchConf = "/home/cpi/.config/retroarch/retroarch.cfg"
_LayoutMode = "Unknown"
_DownloadPage = None
_URL = ""
_MD5 = ""
_Version = ""
_GIT = False
def ModifyRetroArchConf(self,keys):
try:
@ -91,7 +84,8 @@ class UpdateConfirmPage(ConfirmPage):
elif self._LayoutMode == "snes":
keymap = ["k","j","i","u"]
else:
return "Internal error."
finalizeWithDialog("Internal error.")
return
print("mode: " + self._LayoutMode)
if not os.path.isfile(self._RetroArchConf):
@ -107,33 +101,6 @@ class UpdateConfirmPage(ConfirmPage):
finalizeWithDialog(self.ModifyRetroArchConf(keymap))
return
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
return
if self._GIT == True:
cmdpath = "feh --bg-center /home/cpi/apps/launcher/sys.py/gameshell/wallpaper/updating.png; cd /home/cpi/apps/launcher ;git pull; git reset --hard %s ; feh --bg-center /home/cpi/apps/launcher/sys.py/gameshell/wallpaper/loading.png " % self._Version
pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
self._GIT = False
return
if self._DownloadPage == None:
self._DownloadPage = UpdateDownloadPage()
self._DownloadPage._Screen = self._Screen
self._DownloadPage._Name = "Downloading..."
self._DownloadPage.Init()
self._DownloadPage._MD5 = self._MD5
self._Screen.PushPage(self._DownloadPage)
self._Screen.Draw()
self._Screen.SwapAndShow()
if self._URL != None and validators.url(self._URL):
self._DownloadPage.StartDownload(self._URL, "/tmp")
else:
print "error url %s " % self._URL
def OnReturnBackCb(self):
self.ReturnToUpLevelPage()
self._Screen.Draw()