From 143c1680700b1c523af433904f68f1dad3edf76e Mon Sep 17 00:00:00 2001 From: cuu Date: Sun, 27 May 2018 10:50:11 +0800 Subject: [PATCH] fix update read json --- Menu/GameShell/10_Settings/Update/__init__.py | 14 ++++++++++---- sys.py/config.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Menu/GameShell/10_Settings/Update/__init__.py b/Menu/GameShell/10_Settings/Update/__init__.py index c4aa6a3..8ad8216 100644 --- a/Menu/GameShell/10_Settings/Update/__init__.py +++ b/Menu/GameShell/10_Settings/Update/__init__.py @@ -282,7 +282,7 @@ class UpdatePage(Page): self._Screen.SwapAndShow() elif "gitversion" in json_: ### just use git to run update - if confirm.VERSION != json_["gitversion"]: + if config.VERSION != json_["gitversion"]: self._ConfirmPage._URL = None self._ConfirmPage._MD5 = None self._ConfirmPage._GIT = True @@ -292,10 +292,16 @@ class UpdatePage(Page): self._Screen.Draw() self._ConfirmPage.SnapMsg("Update to %s ?" % json_["gitversion"] ) self._Screen.SwapAndShow() - + else: + self._Screen.Draw() + self._Screen._MsgBox.SetText("Out of update") + self._Screen._MsgBox.Draw() + self._Screen.SwapAndShow() + pygame.time.delay(600) + return True - except: - print("r.json error") + except Exception, e: + print("r.json() error %s" % str(e)) else: print(" requests get error %d ", r.status_code) diff --git a/sys.py/config.py b/sys.py/config.py index b9c8025..227e5d6 100644 --- a/sys.py/config.py +++ b/sys.py/config.py @@ -10,7 +10,7 @@ Battery = "/sys/class/power_supply/axp20x-battery/uevent" MPD_socket = "/tmp/mpd.socket" -UPDATE_URL="http://192.168.31.236:81/version.php" +UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/launcher/master/launcher_ver.json" VERSION="1.0"