gcodec ($Date: 2008/21/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap_v0.1/gcodec.py

Gcodec is a collection of utilities to decode and encode gcode.
 
To run gcodec, install python 2.x on your machine, which is avaliable from http://www.python.org/download/
 
Then in the folder which gcodec is in, type 'python' in a shell to run the python interpreter.  Finally type 'from gcodec import *' to import this program.
 
Below is an example of gcodec use.  This example is run in a terminal in the folder which contains Hollow Square.gcode and gcodec.py.
 
>>> from gcodec import *
>>> getFileText('Hollow Square.gcode')
'( GCode generated by April 17,2007 Skeinforge )
( Extruder Initialization )
M100 P210
M103
M105
(<extrusionDiameter> P0.7
(<extrusionWidth> P0.654
(<layerThickness> P0.654
G21
G90
G28
( Extruder Movement )
( Extruder paths for layer 0 of Hollow Square )
(<extrusionStart>
G1 X2.727 Y-2.505 Z0.33 F600.0
 
..
many lines of text
..

 
Modules
       
os

 
Functions
       
getDoubleAfterFirstLetter(word)
Get the double value of the word after the first letter.
 
Keyword arguments:
word -- string with value starting after the first letter
getDoubleForLetter(letter, splitLine)
Get the double value of the word after the first occurence of the letter in the split line.
getFeedrateMinute(feedrateMinute, splitLine)
Get the feedrate per minute if the split line has a feedrate.
getFileText(filename)
Get the entire text of a file.
 
Keyword arguments:
filename -- name of the file
getFilesWithFileTypeWithoutWords(fileType, words=[], fileInDirectory='')
Get files which have a given file type, but with do not contain a word in a list.
 
Keyword arguments:
fileType -- file type required
words -- list of words which the file must not have
getGNUDirectoryOrFile(isDirectory, filename, wasCancelled)
Get the GNU Triangulated Surface files in the directory the file is in if isDirectory is true.  Otherwise, return the file in a list.
getGNUGcode(fileInDirectory='')
Get GNU Triangulated Surface files and gcode files which are not modified.
getGNUTriangulatedSurfaceFiles(fileInDirectory='')
Get GNU Triangulated Surface files.
getGcodeDirectoryOrFile(isDirectory, filename, wasCancelled)
Get the gcode files in the directory the file is in if isDirectory is true.  Otherwise, return the file in a list.
getLocationFromSplitLine(oldLocation, splitLine)
getSummarizedFilename(filename)
Get the filename basename if the file is in the current working directory, otherwise return the original full name.
getTextLines(text)
Get the all the lines of text of a text.
 
Keyword arguments:
text -- text
getUnmodifiedGCodeFiles(fileInDirectory='')
Get gcode files which are not modified.
indexOfStartingWithSecond(letter, splitLine)
Get index of the first occurence of the given letter in the split line, starting with the second word.  Return - 1 if letter is not found
isFileWithFileTypeWithoutWords(fileType, filename, words)
Determine if file has a given file type, but with does not contain a word in a list.
 
Keyword arguments:
fileType -- file type required
filename -- name of the file
words -- list of words which the filename must not have
isProcedureDone(gcodeText, procedure)
Determine if the procedure has been done on the gcode text.
replaceWords(filenames, wordReplacements)
Replace in files the first word of a tuple with the second word of the tuple, from a list of tuples.
writeFileMessageEnd(end, filename, fileText, message)
Write to a filename with a suffix and print a message.
writeFileText(filename, fileText)
Write a text to a file.
 
Keyword arguments:
filename -- name of the file
fileText -- text which will be written to the file

 
Data
        __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GPL 3.0'

 
Author
        Enrique Perez (perez_enrique@yahoo.com)