Skip to content

Commit 6942384

Browse files
author
Turnermator13
committed
v2.0.12 fixes
1 parent c992934 commit 6942384

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Arduino Racing Dash ChangeLog
22
--------------------
33

4+
v2.0.12:
5+
Update Optimisations
6+
Fixes
7+
48
v2.0.11:
59
Try extended updater functions now idna errors are fixed
610

acSLI/acSLIApp/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import acSLIApp.utils as Utils
1111

1212
#################
13-
Version = "2.0.11"
13+
Version = "2.0.12"
1414
ArduinoVersion = "2.0.7"
1515
#################
1616

acSLI/acSLIApp/loader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class ConfigLoader:
1818
cfgTickFreq = 6
1919
cfgEnableUpdater = 1
2020
cfgLapOffset = 0
21-
cfgSendStats = 1
2221

2322
def __init__(self):
2423
global instance, cfgPath

acSLI/acSLIApp/updater.py

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ class Updater:
1919
updaterError = False
2020
hasUpdated = False
2121
appWindow = 0
22+
currVersion = 0
2223
remoteVersion = 0
2324
reqArduinoUpdate = 0
2425
changeLog = 0
25-
statsURL = "/Gkbl4Z"
26+
statsURL = 0
2627

2728
lblVersionTxt = 0
2829
lblLog = 0
@@ -33,20 +34,22 @@ class Updater:
3334
def __init__(self, currVersion):
3435
global instance
3536
instance = self
37+
self.currVersion = currVersion
3638

3739
try:
3840
if Config.instance.cfgEnableUpdater == 1:
3941
conn = http.client.HTTPSConnection("raw.githubusercontent.com", 443)
4042
conn.request("GET", "/Turnermator13/ArduinoRacingDash/master/version.txt")
41-
versionFile = conn.getresponse()
42-
versionStr = re.findall(r"\'(.+?)\'", str(versionFile.read()))[0]
43-
self.remoteVersion = versionStr.split("|")[0]
44-
self.reqArduinoUpdate = versionStr.split("|")[1]
45-
self.changeLog = versionStr.split("|")[2]
43+
versionStr = re.findall(r"\'(.+?)\'", str(conn.getresponse().read()))[0].split("|")
44+
self.remoteVersion = versionStr[0]
45+
self.reqArduinoUpdate = versionStr[1]
46+
self.changeLog = versionStr[2]
47+
self.statsURL = versionStr[3]
4648
conn.close()
4749
except Exception as e:
4850
Log.error("Couldn't get Version Information: %s" % e)
4951
self.updaterError = True
52+
logStats("Login")
5053

5154
if (self.remoteVersion != 0) and (self.remoteVersion != Config.instance.cfgRemoteVersion)\
5255
and (int("".join(self.remoteVersion.split("."))) > int("".join(currVersion.split(".")))):
@@ -69,36 +72,12 @@ def __init__(self, currVersion):
6972
.setSize(360, 10).setAlign("center").setFontSize(20).setColor(Utils.rgb(Utils.colours["red"]))
7073
self.lblLog = Label(self.appWindow.app, self.changeLog, 20, 60)\
7174
.setSize(360, 10).setAlign("center").setColor(Utils.rgb(Utils.colours["green"]))
72-
self.logStats(currVersion)
7375
else:
74-
self.logStats(currVersion)
7576
if self.updaterError:
7677
Log.info("Updater Encounter an Error. Version Check Incomplete")
7778
elif Config.instance.cfgEnableUpdater == 1:
7879
Log.info("Running Latest Version (v%s)" % self.remoteVersion)
7980

80-
#Logs basic version stats to goo.gl analytics, no personal information saved and no information downloaded
81-
def logStats(self, version):
82-
if Config.instance.cfgSendStats == 1:
83-
try:
84-
h1 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/1.0 (KHTML, like Gecko) Login/1.0"
85-
if not os.path.isfile("apps/python/acSLI/acSLIApp/.cache"):
86-
h1 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/1.0 (KHTML, like Gecko) New/1.0"
87-
open("apps/python/acSLI/acSLIApp/.cache", 'w').write("".join(version.split(".")))
88-
else:
89-
file = open("apps/python/acSLI/acSLIApp/.cache", 'r')
90-
if file.read() != "".join(version.split(".")):
91-
h1 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/1.0 (KHTML, like Gecko) Update/1.0"
92-
open("apps/python/acSLI/acSLIApp/.cache", 'w').write("".join(version.split(".")))
93-
file.close()
94-
95-
stats = http.client.HTTPConnection("goo.gl")
96-
stats.request("GET", str(self.statsURL), headers={str("User-Agent"): str(h1), str("Referer"): str("http://v%s" % version)})
97-
stats.getresponse()
98-
stats.close()
99-
except Exception as e:
100-
Log.error("Couldn't Log Stats: %s" % e)
101-
10281

10382
class updateFiles(threading.Thread):
10483

@@ -111,6 +90,7 @@ def run(self):
11190
try:
11291
Log.info("Updating Files. Please Wait.")
11392
updateProg()
93+
logStats("Update")
11494

11595
conn = http.client.HTTPSConnection("raw.githubusercontent.com", 443)
11696
conn.request("GET", "/Turnermator13/ArduinoRacingDash/v" + instance.remoteVersion + "/fileList.txt")
@@ -186,6 +166,23 @@ def dispButton(self):
186166
.setAlign("center").hasCustomBackground().setBackgroundTexture("apps/python/acSLI/image/backBtnAuto.png")
187167

188168

169+
#Logs basic version stats to goo.gl analytics, no personal information saved and no information downloaded
170+
def logStats(type):
171+
global instance
172+
try:
173+
h1 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/1.0 (KHTML, like Gecko) %s/1.0" % type
174+
if not os.path.isfile("apps/python/acSLI/acSLIApp/.cache"):
175+
h1 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/1.0 (KHTML, like Gecko) New/1.0"
176+
open("apps/python/acSLI/acSLIApp/.cache", 'w').write("".join(instance.currVersion.split(".")))
177+
178+
stats = http.client.HTTPConnection("goo.gl")
179+
stats.request("GET", str(instance.statsURL), headers={str("User-Agent"): str(h1), str("Referer"): str("http://v%s" % instance.currVersion)})
180+
stats.getresponse()
181+
stats.close()
182+
except Exception as e:
183+
Log.error("Couldn't Log Stats: %s" % e)
184+
185+
189186
def bFunc_Yes(dummy, variables):
190187
global instance
191188
instance.appWindow.setVisible(0)

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.11|0|Compatibility Fixes, lapOffset Added|/Gkbl4Z
1+
2.0.12|0|Optimisations and Fixes|/miIkZT

0 commit comments

Comments
 (0)