diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-12-06 12:32:27 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-12-06 12:32:59 +0000 |
| commit | e315a8360b5a312b9b692408473d942de94557d1 (patch) | |
| tree | 2e71949fb3ad7d33b5a9e1cb60655e0d47246654 /scripts | |
| parent | 323aaa3aa2bcc03c9c46b173f33b9cdfac205e74 (diff) | |
Ensure Result.messages is always unique
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/mammoth | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/scripts/mammoth b/scripts/mammoth index be7ad10..f4865fb 100644 --- a/scripts/mammoth +++ b/scripts/mammoth @@ -34,24 +34,14 @@ def main(): convert_image=convert_image, output_format=args.output_format, ) - for message in _unique([message.message for message in result.messages]): - sys.stderr.write(message) + for message in result.messages: + sys.stderr.write(message.message) sys.stderr.write("\n") with _open_output(output_path) as output: output.write(result.value) -def _unique(values): - output = [] - seen = set() - for value in values: - if value not in seen: - seen.add(value) - output.append(value) - return output - - class ImageWriter(object): def __init__(self, output_dir): self._output_dir = output_dir |
