__init__.py 381 B

123456789101112
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. import json
  4. import os
  5. def readFixture(fixture_name: str) -> bytes:
  6. with open("{}/{}.json".format(os.path.dirname(__file__), fixture_name), "rb") as f:
  7. return f.read()
  8. def parseFixture(fixture_name: str) -> dict:
  9. return json.loads(readFixture(fixture_name).decode())