ProfileWriter.py 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. class ProfileWriter(PluginObject):
  5. """Base class for profile writer plugins.
  6. This class defines a write() function to write profiles to files with.
  7. """
  8. def __init__(self):
  9. """Initialises the profile writer.
  10. This currently doesn't do anything since the writer is basically static.
  11. """
  12. super().__init__()
  13. def write(self, path, profiles):
  14. """Writes a profile to the specified file path.
  15. The profile writer may write its own file format to the specified file.
  16. :param path: :type{string} The file to output to.
  17. :param profiles: :type{Profile} or :type{List} The profile(s) to write to the file.
  18. :return: True if the writing was successful, or False if it wasn't.
  19. """
  20. raise NotImplementedError("Profile writer plugin was not correctly implemented. No write was specified.")