mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2026-10-22 18:02:08 +03:00
skip unwanted updates
This commit is contained in:
1 parent
602df9123b
commit
599483d66c
1 file changed
+15
-5
+15
-5
@@ -107,7 +107,13 @@ class SpanshUpdater():
|
|||||||
try:
|
try:
|
||||||
response = requests.get(version_url, timeout=2)
|
response = requests.get(version_url, timeout=2)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
if self.plugin_version != response.text:
|
skip_version = ''
|
||||||
|
try:
|
||||||
|
with open(self.savestate_filepath, 'r') as savestate_fh:
|
||||||
|
skip_version = json.load(savestate_fh)["SkipVersion"]
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
if self.plugin_version != response.text and not skip_version == response.text:
|
||||||
self.update_available = True
|
self.update_available = True
|
||||||
self.latest_version = response.text
|
self.latest_version = response.text
|
||||||
self.zip_name = self.zip_name.replace("VERSION", self.latest_version.replace('.', ''))
|
self.zip_name = self.zip_name.replace("VERSION", self.latest_version.replace('.', ''))
|
||||||
@@ -124,13 +130,17 @@ class SpanshUpdater():
|
|||||||
file_content = {}
|
file_content = {}
|
||||||
try:
|
try:
|
||||||
with open(self.savestate_filepath, 'r') as savestate_fh:
|
with open(self.savestate_filepath, 'r') as savestate_fh:
|
||||||
file_content = json.loads(savestate_fh)
|
file_content = json.load(savestate_fh)
|
||||||
except:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
except:
|
||||||
|
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||||
|
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
|
||||||
|
sys.stderr.write(''.join('!! ' + line for line in lines))
|
||||||
finally:
|
finally:
|
||||||
file_content["SkipUpdate"] = self.latest_version
|
file_content["SkipVersion"] = self.latest_version
|
||||||
with open(self.savestate_filepath, 'w') as savestate_fh:
|
with open(self.savestate_filepath, 'w') as savestate_fh:
|
||||||
savestate_fh.write(json.dumps(file_content))
|
json.dump(file_content, savestate_fh)
|
||||||
|
|
||||||
|
|
||||||
class UpdatePopup(tk.Toplevel):
|
class UpdatePopup(tk.Toplevel):
|
||||||
|
|||||||
Reference in new issue
Block a user