X-Git-Url: https://git.arvados.org/rnaseq-cwl-training.git/blobdiff_plain/199a8093778d96a960242948fdd9970f40e63c68..df03039fa6395469aede858e873b1b03b6dd3264:/bin/util.py diff --git a/bin/util.py b/bin/util.py index 79cc010..522f5df 100644 --- a/bin/util.py +++ b/bin/util.py @@ -1,4 +1,3 @@ - import sys import os import json @@ -35,8 +34,6 @@ class Reporter: def __init__(self): """Constructor.""" - - super(Reporter, self).__init__() self.messages = [] def check_field(self, filename, name, values, key, expected=REPORTER_NOT_SET): @@ -74,8 +71,9 @@ class Reporter: return location + ': ' + message elif isinstance(location, tuple): return '{0}:{1}: '.format(*location) + message - else: - assert False, 'Unknown item "{0}"'.format(item) + + print('Unknown item "{0}"'.format(item), file=sys.stderr) + return NotImplemented @staticmethod def key(item): @@ -86,8 +84,9 @@ class Reporter: return (location, -1, message) elif isinstance(location, tuple): return (location[0], location[1], message) - else: - assert False, 'Unknown item "{0}"'.format(item) + + print('Unknown item "{0}"'.format(item), file=sys.stderr) + return NotImplemented def report(self, stream=sys.stdout): """Report all messages in order."""