Skip to content

Commit

Permalink
Generalize priority in data line regex
Browse files Browse the repository at this point in the history
Also add custom MDN inventory with non-integer priority values.

Fixes #147
  • Loading branch information
bskinn committed Nov 10, 2020
1 parent 4513593 commit 646d67c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sphobjinv/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def _general_import(self):
import_errors = {
SourceTypes.BytesPlaintext: TypeError,
SourceTypes.BytesZlib: (zlib_error, TypeError),
SourceTypes.FnamePlaintext: (OSError, TypeError),
SourceTypes.FnamePlaintext: (OSError, TypeError, UnicodeDecodeError),
SourceTypes.FnameZlib: (OSError, TypeError, zlib_error),
SourceTypes.DictJSON: (ValidationError),
}
Expand Down
2 changes: 1 addition & 1 deletion src/sphobjinv/re.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
: # Dividing colon
(?P<{2}>\w+) # --> Role
\s+ # Dividing space
(?P<{3}>-?\d+) # --> Priority
(?P<{3}>\S+) # --> Priority
\s+ # Dividing space
(?P<{4}>\S+) # --> URI
\s+ # Dividing space
Expand Down
Binary file added tests/resource/objects_mdn.inv
Binary file not shown.

0 comments on commit 646d67c

Please sign in to comment.