Skip to content

Commit

Permalink
Make '0' an alias for n/a
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Oct 24, 2014
1 parent 0c1cf05 commit 2c0ce8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion buildcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
| n/a # alias for 0L0
| - # alias for 0L0
| \d+[LMH] # Or <number><level> where level is L(ow), M(ed) or H(igh)
| 0 # alias for n/a
"""
newItemPriceRe = re.compile(r"""
^
Expand Down Expand Up @@ -119,7 +120,7 @@ class UnitsAndLevel(object):
def __init__(self, category, reading):
if reading in (None, "unk", "-1L-1", "-1L0", "0L-1"):
self.units, self.level = -1, -1
elif reading in ("-", "-L-", "n/a"):
elif reading in ("-", "-L-", "n/a", "0"):
self.units, self.level = 0, 0
else:
matches = self.splitLRe.match(reading) or self.splitAtRe.match(reading)
Expand Down

0 comments on commit 2c0ce8b

Please sign in to comment.