ProfileWriter.py 1.0 KB

12345678910111213141516171819202122232425
  1. # Copyright (c) 2015 Ultimaker B.V.
  2. # Uranium is released under the terms of the LGPLv3 or higher.
  3. from UM.PluginObject import PluginObject
  4. ## Base class for profile writer plugins.
  5. #
  6. # This class defines a write() function to write profiles to files with.
  7. class ProfileWriter(PluginObject):
  8. ## Initialises the profile writer.
  9. #
  10. # This currently doesn't do anything since the writer is basically static.
  11. def __init__(self):
  12. super().__init__()
  13. ## Writes a profile to the specified file path.
  14. #
  15. # The profile writer may write its own file format to the specified file.
  16. #
  17. # \param path \type{string} The file to output to.
  18. # \param profiles \type{Profile} or \type{List} The profile(s) to write to the file.
  19. # \return \code True \endcode if the writing was successful, or \code
  20. # False \endcode if it wasn't.
  21. def write(self, path, profiles):
  22. raise NotImplementedError("Profile writer plugin was not correctly implemented. No write was specified.")