Skip to content

Commit

Permalink
fix update version error
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Apr 24, 2023
1 parent de302ee commit d7bb5aa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion COMTool/autoUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def checkUpdate_neucrack(self):
import requests, json
latest = version.Version()
try:
page = requests.post(self.releaseApiUrl2)
headers = {
"User-Agent": f"comtool_v{version.major}.{version.minor}.{version.dev}"
}
page = requests.post(self.releaseApiUrl2, headers=headers)
if page.status_code != 200:
log.i("request {} fail, check update fail!".format(self.releaseApiUrl))
return False, None
Expand Down
4 changes: 2 additions & 2 deletions COMTool/main2.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def helpWindowClosed(self):

def showUpdate(self, versionInfo):
versionInt = versionInfo.int()
if self.config.basic["skipVersion"] and self.config.basic["skipVersion"] >= versionInt:
if self.config["skipVersion"] and self.config["skipVersion"] >= versionInt:
return
msgBox = QMessageBox()
desc = versionInfo.desc if len(versionInfo.desc) < 300 else versionInfo.desc[:300] + " ... "
Expand All @@ -638,7 +638,7 @@ def showUpdate(self, versionInfo):
auto = autoUpdate.AutoUpdate()
auto.OpenBrowser()
elif result == 1:
self.config.basic["skipVersion"] = versionInt
self.config["skipVersion"] = versionInt



Expand Down
2 changes: 1 addition & 1 deletion COMTool/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __setitem__(self, idx, v):

def __str__(self) -> str:
return json.dumps(self.config)


strStyleShowHideButtonLeft = '''
QPushButton {
Expand Down
4 changes: 2 additions & 2 deletions COMTool/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

major = 3
minor = 2
dev = 0
dev = 1

__version__ = "{}.{}.{}".format(major, minor, dev)

Expand All @@ -26,7 +26,7 @@ def dump_dict(self):
def load_dict(self, obj):
self.major = obj['major']
self.minor = obj['minor']
self.mdev= obj['dev']
self.dev= obj['dev']
self.name = obj['name']
self.desc = obj['desc']

Expand Down

0 comments on commit d7bb5aa

Please sign in to comment.