Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adds Another Format

  • Loading branch information...
commit b901bcbe20ddd8e624de0457a9b86ea2418fcdea 1 parent 609db82
@sudorandom sudorandom authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 cargoscanner.py
View
11 cargoscanner.py
@@ -353,7 +353,7 @@ def _add_type(name, count):
continue
# aiming for format "PERSON'S NAME\tShipType\tdistance"
- if fmt_line.count("\t") == 2:
+ if fmt_line.count("\t") > 2:
_, item, _ = fmt_line.split("\t", 2)
if _add_type(item.strip(), 1):
continue
@@ -367,6 +367,15 @@ def _add_type(name, count):
except ValueError:
pass
+ # aiming for format "Item Name\t..."
+ try:
+ if fmt_line.count("\t") > 0:
+ item, _ = fmt_line.split("\t", 1)
+ if _add_type(item.strip(), 1):
+ continue
+ except ValueError:
+ pass
+
bad_lines.append(line)
return results.values(), bad_lines
Please sign in to comment.
Something went wrong with that request. Please try again.