Update start lines

This commit is contained in:
oldnapalm
2024-12-11 12:58:48 -03:00
parent 28504bec76
commit 993b86a64f
4 changed files with 235 additions and 322 deletions
+228 -228
View File
File diff suppressed because it is too large Load Diff
-39
View File
@@ -1,39 +0,0 @@
# -*- mode: python -*-
block_cipher = None
import sys
sys.modules['FixTk'] = None
a = Analysis(['get_profile.py'],
pathex=['../protobuf'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='get_profile',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
import subprocess
subprocess.call(['C:\\Program Files (x86)\\Windows Kits\\10\\App Certification Kit\\signtool.exe', 'sign',
'/f', '..\\ssl\\cert-zwift-com.p12', '/fd', 'sha1',
'/t', 'http://timestamp.digicert.com',
'dist\\get_profile.exe'])
+7 -16
View File
@@ -22,10 +22,7 @@ world_names = {
'13': 'Scotland'
}
with open('../data/start_lines.txt') as f:
data = json.load(f, object_hook=lambda d: {int(k) if k.lstrip('-').isdigit() else k: v for k, v in d.items()})
new_routes = []
data = {}
for directory in os.listdir(worlds):
world = directory[5:]
@@ -38,18 +35,12 @@ for directory in os.listdir(worlds):
tree = ET.fromstring(re.sub(r"(<\?xml[^>]+\?>)", r"\1<root>", xml) + "</root>")
route = tree.find('route')
nameHash = int.from_bytes(int(route.get('nameHash')).to_bytes(4, 'little'), 'little', signed=True)
new_routes.append(nameHash)
if not nameHash in data:
checkpoints = list(tree.find('highrescheckpoint').iter('entry'))
data[nameHash] = {
'name': '%s - %s' % (world_names[world], route.get('name').strip()),
'road': int(checkpoints[0].get('road')),
'time': int(float(checkpoints[0].get('time')) * 1000000 + 5000)
}
for route in list(data.keys()):
if not route in new_routes:
del data[route]
checkpoints = list(tree.find('highrescheckpoint').iter('entry'))
data[nameHash] = {
'name': '%s - %s' % (world_names[world], route.get('name').strip()),
'road': int(checkpoints[0].get('road')),
'time': int(float(checkpoints[0].get('time')) * 1000000 + 5000)
}
with open('../data/start_lines.txt', 'w') as f:
json.dump({k: v for k, v in sorted(data.items(), key=lambda d: d[1]['name'])}, f, indent=2)
-39
View File
@@ -1,39 +0,0 @@
# -*- mode: python -*-
block_cipher = None
import sys
sys.modules['FixTk'] = None
a = Analysis(['strava_auth.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='strava_auth',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
import subprocess
subprocess.call(['C:\\Program Files (x86)\\Windows Kits\\10\\App Certification Kit\\signtool.exe', 'sign',
'/f', '..\\ssl\\cert-zwift-com.p12', '/fd', 'sha1',
'/t', 'http://timestamp.digicert.com',
'dist\\strava_auth.exe'])