# Python: module skeinforge_tools.export

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

`Export is a script to pick an export plugin and optionally print the output to a file.
The default 'Activate Export' checkbox is on. When it is on, the functions described below will work, when it is off, the functions
will not be called.
Export presents the user with a choice of the export plugins in the export_plugins folder. The chosen plugin will then modify the
gcode or translate it into another format. There is also the "Do Not Change Output" choice, which will not change the output.
To print the output to a file, add the file output name to the "Also Send Output To" field. A common choice is sys.stdout to print
the output in the shell screen. Another common choice is sys.stderr. The default is nothing, in which case the output will not be
printed to a file. The 'File Extension' field determines the file extension added to the name of the output file, the default is gcode.
If the "Delete M110 Gcode Line" checkbox is true, export will delete the M110 gcode line, whose only purpose is to indicate that
the gcode is generated by skeinforge. If the "Delete Comments" checkbox is true, export will delete the comments. The M110
gcode and the comments are not necessary to run a fabricator.
When export is exporting the code, if there is a file replace.csv, it will replace the word in the first column be its replacement in
the second column. There is an example file replace_example.csv to demonstrate the comma separated format, which can be
edited in a text editor or a spreadsheet.
An export plugin is a script in the export_plugins folder which has the functions getOuput and writeOutput.
To run export, in a shell type:
> python export.py
The following examples export the files Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains
Screw Holder Bottom.stl & export.py. The function writeOutput checks to see if the text has been exported, if not they call
getUnpauseChainGcode in unpause.py to unpause the text; once they have the unpaused text, then it exports.
> python export.py
This brings up the dialog, after clicking 'Export', the following is printed:
File Screw Holder Bottom.stl is being chain exported.
The exported file is saved as Screw Holder Bottom_export.gcode
>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 export
>>> export.main()
This brings up the export dialog.
>>> export.writeOutput()
Screw Holder Bottom.stl
File Screw Holder Bottom.stl is being chain exported.
The exported file is saved as Screw Holder Bottom_export.gcode`

Modules

``

__init__ skeinforge_tools.analyze cStringIO skeinforge_tools.skeinforge_utilities.euclidean | skeinforge_tools.skeinforge_utilities.gcodec skeinforge_tools.skeinforge_utilities.intercircle skeinforge_tools.skeinforge_utilities.interpret os | skeinforge_tools.polyfile skeinforge_tools.skeinforge_utilities.preferences sys time | skeinforge_tools.unpause

Classes

``

ExportPreferences
ExportSkein

class ExportPreferences
`` | `A class to handle the export preferences.`

Methods defined here:

__init__(self)
  `Set the default preferences, execute title & preferences fileName.`

execute(self)
  `Export button has been clicked.`

class ExportSkein
`` | `A class to export a skein of extrusions.`

Methods defined here:

__init__(self)

addLine(self, line)
  `Add a line of text and a newline to the output.`

getLineWithTruncatedNumber(self, character, line)
  `Get a line with the number after the character truncated.`

parseGcode(self, exportPreferences, gcodeText)
  `Parse gcode text and store the export gcode.`

parseLine(self, exportPreferences, line)
  `Parse a gcode line.`

Functions

``

getExportGcode(gcodeText, exportPreferences=None)
  `Export a gcode linear move text.`

getReplaced(exportText)
  `Get text with words replaced according to replace.csv file.`

getSelectedPlugin(exportPreferences)
  `Get the selected plugin module.`

main(hashtable=None)
  `Display the export dialog.`

writeOutput(fileName='')
  `Export a gcode linear move file. Chain export the gcode if it is not already exported.
  If no fileName is specified, export the first unmodified gcode file in this folder.`

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)