ProfileReader.py 930 B

12345678910111213141516171819202122232425262728
  1. # Copyright (c) 2016 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from UM.PluginObject import PluginObject
  4. # Exception when there is no profile to import from a given files.
  5. # Note that this should not be treated as an exception but as an information instead.
  6. class NoProfileException(Exception):
  7. pass
  8. class ProfileReader(PluginObject):
  9. """A type of plug-ins that reads profiles from a file.
  10. The profile is then stored as instance container of the type user profile.
  11. """
  12. def __init__(self):
  13. super().__init__()
  14. def read(self, file_name):
  15. """Read profile data from a file and return a filled profile.
  16. :return: :type{Profile|Profile[]} The profile that was obtained from the file or a list of Profiles.
  17. """
  18. raise NotImplementedError("Profile reader plug-in was not correctly implemented. The read function was not implemented.")