def from_file(filename): try: with open(filename, 'r') as f: data = sjson.load(f) return TestSuite.from_dict(data) except Exception as e: tty.debug(e) raise sjson.SpackJSONError("error parsing JSON TestSuite:", str(e))
def from_json(stream, name=None): try: d = sjson.load(stream) return Mirror.from_dict(d, name) except Exception as e: raise six.raise_from( sjson.SpackJSONError("error parsing JSON mirror:", str(e)), e, )
def from_file(filename): try: with open(filename, 'r') as f: data = sjson.load(f) test_suite = TestSuite.from_dict(data) content_hash = os.path.basename(os.path.dirname(filename)) test_suite._hash = content_hash return test_suite except Exception as e: tty.debug(e) raise sjson.SpackJSONError("error parsing JSON TestSuite:", str(e))