diff options
author | Nino van Hooff <ninovanhooff@gmail.com> | 2020-05-08 16:58:51 +0300 |
---|---|---|
committer | Nino van Hooff <ninovanhooff@gmail.com> | 2020-05-08 16:58:51 +0300 |
commit | 40327c42593e943ce91a2459eb331933cd376dbd (patch) | |
tree | f1fcd7786938ffa3c247806ea9dfe18d74624fc2 /plugins/GCodeGzWriter | |
parent | 6ca9b4678e7a2bb6bb6f0122b71e32e81f6884a3 (diff) |
Convert doxygen to rst for GcodeReader, GcodeGzReader/Writer,
GCodeProfileReader
Diffstat (limited to 'plugins/GCodeGzWriter')
-rw-r--r-- | plugins/GCodeGzWriter/GCodeGzWriter.py | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/plugins/GCodeGzWriter/GCodeGzWriter.py b/plugins/GCodeGzWriter/GCodeGzWriter.py index cbbfb8f986..e9dcbad76b 100644 --- a/plugins/GCodeGzWriter/GCodeGzWriter.py +++ b/plugins/GCodeGzWriter/GCodeGzWriter.py @@ -13,26 +13,31 @@ from UM.Scene.SceneNode import SceneNode #For typing. from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") -## A file writer that writes gzipped g-code. -# -# If you're zipping g-code, you might as well use gzip! + class GCodeGzWriter(MeshWriter): + """A file writer that writes gzipped g-code. + + If you're zipping g-code, you might as well use gzip! + """ + def __init__(self) -> None: super().__init__(add_to_recent_files = False) - ## Writes the gzipped g-code to a stream. - # - # Note that even though the function accepts a collection of nodes, the - # entire scene is always written to the file since it is not possible to - # separate the g-code for just specific nodes. - # - # \param stream The stream to write the gzipped g-code to. - # \param nodes This is ignored. - # \param mode Additional information on what type of stream to use. This - # must always be binary mode. - # \return Whether the write was successful. def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode = MeshWriter.OutputMode.BinaryMode) -> bool: + """Writes the gzipped g-code to a stream. + + Note that even though the function accepts a collection of nodes, the + entire scene is always written to the file since it is not possible to + separate the g-code for just specific nodes. + + :param stream: The stream to write the gzipped g-code to. + :param nodes: This is ignored. + :param mode: Additional information on what type of stream to use. This + must always be binary mode. + :return: Whether the write was successful. + """ + if mode != MeshWriter.OutputMode.BinaryMode: Logger.log("e", "GCodeGzWriter does not support text mode.") self.setInformation(catalog.i18nc("@error:not supported", "GCodeGzWriter does not support text mode.")) |