Skip to content

Commit

Permalink
some versions of xz format numbers with commas, so need to strip them…
Browse files Browse the repository at this point in the history
… out
  • Loading branch information
jdidion committed Nov 19, 2017
1 parent 9e83741 commit 96a595f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xphyle/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ def name(self) -> str:
return 'bgzip'

# TODO: This is a bug: bgzip doesn't actually allow bgz extension, but the
# way Formats currently works does not support on extension being used with
# way Formats currently works does not support an extension being used with
# multiple formats.

@property
Expand Down Expand Up @@ -1068,9 +1068,9 @@ def get_list_command(self, path: str) -> List[str]:

def parse_file_listing(self, listing: str) -> Tuple[int, int, float]:
parsed = listing.splitlines(keepends=False)
print(parsed)
compressed, uncompressed = (
int(re.match(r'.+?(\d+) B\)?', size).group(1))
int(re.sub('[\.,]', '', re.match(
r'.+?([\d\.,]+) B\)?', size).group(1)))
for size in parsed[3:5])
ratio = float(parsed[5][22:])
return (compressed, uncompressed, ratio)
Expand Down

0 comments on commit 96a595f

Please sign in to comment.