mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Upgrade FIT SDK to 21.188 (#4776) [skip ci]
The presence of a \ in a string will produce an error in python 3.13 Using raw strings in all regexes avoids this.
This commit is contained in:
18912
util/fit/fit_example.h
18912
util/fit/fit_example.h
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ for line in lines:
|
||||
match = re.search("FIT_GARMIN_PROD", line)
|
||||
if match:
|
||||
name = re.search("(FIT_GARMIN_PRODUCT_)([^ \t]*)", line)
|
||||
id = re.search("\(FIT_GARMIN_PRODUCT, ([ 0-9]*)", line)
|
||||
id = re.search(r"\(FIT_GARMIN_PRODUCT, ([ 0-9]*)", line)
|
||||
if name and id:
|
||||
# extract name
|
||||
print(pre+ '{ "manu":1, "prod":' + id.group(1).strip() + ', "name":"' + name.group(2).strip().replace('_',' ').title() + '" }', end="")
|
||||
@@ -36,7 +36,7 @@ print("\n ],\n")
|
||||
print(' "MANUFACTURERS":[')
|
||||
pre=" "
|
||||
for line in lines:
|
||||
match = re.search("MANUFACTURER_([^ \t]*).*\(FIT_MANUFACTURER, ([ 0-9]*)", line)
|
||||
match = re.search(r"MANUFACTURER_([^ \t]*).*\(FIT_MANUFACTURER, ([ 0-9]*)", line)
|
||||
if match:
|
||||
print(pre+ '{ "manu":' + match.group(2).strip() + ', "name":"' + match.group(1).strip().replace('_',' ').title() + '" }', end="")
|
||||
pre=",\n "
|
||||
@@ -59,7 +59,7 @@ for line in fieldlines:
|
||||
print(' "MESSAGES":[')
|
||||
pre=" "
|
||||
for line in lines:
|
||||
match = re.search("FIT_MESG_NUM_([^ \t]*).*\(FIT_MESG_NUM, ([ 0-9]*)", line)
|
||||
match = re.search(r"FIT_MESG_NUM_([^ \t]*).*\(FIT_MESG_NUM, ([ 0-9]*)", line)
|
||||
if match:
|
||||
num = int(match.group(2).strip())
|
||||
if num > 0:
|
||||
|
||||
Reference in New Issue
Block a user