skeinforge_tools.analyze_plugins.comment ($Date: 2008/21/04 $) | index /home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/analyze_plugins/comment.py

`Comment is a script to comment a gcode file.
The default 'Activate Comment' checkbox is on. When it is on, the functions described below will work when called from the
skeinforge toolchain, when it is off, the functions will not be called from the toolchain. The functions will still be called, whether
or not the 'Activate Comment' checkbox is on, when comment is run directly.
To run comment, in a shell in the folder which comment is in type:
> python comment.py
An explanation of the gcodes is at:
http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter
and at:
http://reprap.org/bin/view/Main/MCodeReference
A gode example is at:
http://forums.reprap.org/file.php?12,file=565
This example comments the gcode file Screw Holder_comb.gcode. This example is run in a terminal in the folder which contains
Screw Holder_comb.gcode and comment.py.
> python
Python 2.5.1 (r251:54863, Sep 22 2007, 01:43:31)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import comment
>>> comment.main()
This brings up the comment dialog.
>>> comment.commentFile()
The commented file is saved as Screw Holder_comb_comment.gcode`

Modules
`` |  |
__init__ cStringIO | skeinforge_tools.skeinforge_utilities.gcodec skeinforge_tools.polyfile | skeinforge_tools.skeinforge_utilities.preferences sys |

Classes
`` |  | CommentPreferences CommentSkein
class CommentPreferences
`` | `A class to handle the comment preferences.`
| Methods defined here: __init__(self) `Set the default preferences, execute title & preferences fileName.` execute(self) `Write button has been clicked.`
class CommentSkein
`` | `A class to comment a gcode skein.`
| Methods defined here: __init__(self) addComment(self, comment) `Add a gcode comment and a newline to the output.` linearMove(self, splitLine) `Comment a linear move.` parseGcode(self, gcodeText) `Parse gcode text and store the commented gcode.` parseLine(self, line) `Parse a gcode line and add it to the commented gcode.` setHelicalMoveEndpoint(self, splitLine) `Get the endpoint of a helical move.`

Functions
`` |  | commentFile(fileName='') `Comment a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified.` getCommentGcode(gcodeText) `Get gcode text with added comments.` main() `Display the comment dialog.` writeCommentFileGivenText(fileName, gcodeText) `Write a commented gcode file for a gcode file.` writeOutput(fileName, gcodeText='') `Write a commented gcode file for a skeinforge gcode file, if 'Write Commented File for Skeinforge Chain' is selected.`

Data
`` |  | __author__ = 'Enrique Perez (perez_enrique@yahoo.com)' __date__ = '$Date: 2008/21/04 $' __license__ = 'GPL 3.0' absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

Author
`` |  | Enrique Perez (perez_enrique@yahoo.com)