Skip to content

Commit

Permalink
Fix: combined ft in wasn't detected anymore
Browse files Browse the repository at this point in the history
Previous to #2280 the use of `<feet>ft<inch>in` was reported by class 3091. This detection got lost in that PR.

This fix just returns the unit for feet as it was given as input, hence enabling the detection again (in the new class 30915)
  • Loading branch information
Famlam authored and frodrigo committed Aug 5, 2024
1 parent 76c68ed commit 6aa8a1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/Number.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test(self):
assert not a.node(None, {"maxspeed":d}), ("maxspeed='{0}'".format(d))
assert not a.node(None, {"minspeed:forward":d}), ("minspeed:forward='{0}'".format(d))

for d in ["50 millimeters", "40 metre", "30 feet", "30 in", "10 mile"]:
for d in ["50 millimeters", "40 metre", "30 feet", "30 in", "10 mile", "6ft 6in"]:
self.check_err(a.node(None, {"distance": d}), ("distance='{0}'".format(d)))

assert not a.node(None, {"maxspeed":"1", "waterway": "river"})
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parseNumberUnitString(string, defaultUnit = None):
if m:
return {
"value": float(m.group(1) + m.group(2)) + float(m.group(1) + m.group(4))/12,
"unit": "'"
"unit": m.group(3)
}
# Regular numbers with optional unit
m = re.fullmatch(_numunit_re, string)
Expand Down

0 comments on commit 6aa8a1e

Please sign in to comment.