skeinforge_tools.skeinforge_utilities.gcodec ($Date: 2008/21/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/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 Screw Holder Bottom.gcode and gcodec.py.

>>> from gcodec import *
>>> getFileText('Screw Holder Bottom.gcode')
'( GCode generated by April 17,2007 Skeinforge )
( Extruder Initialization )
M100 P210
M103
M105
(<extrusionDiameter> P0.7

..
many lines of text
..

 
Modules
       
__init__
cStringIO
skeinforge_tools.skeinforge_utilities.euclidean
os
sys

 
Classes
       
DistanceFeedRate

 
class DistanceFeedRate
    A class to limit the z feed rate and round values.
 
  Methods defined here:
__init__(self)
addExtrusionDistanceRatio(self, extrusionDistanceRatio)
Add an extrusion distance ratio tag bracketed line.
addGcodeFromFeedRateThreadZ(self, feedRateMinute, thread, z)
Add a thread to the output.
addGcodeFromThreadZ(self, thread, z)
Add a thread to the output.
addGcodeMovementZ(self, point, z)
Add a movement to the output.
addGcodeMovementZWithFeedRate(self, feedRateMinute, point, z)
Add a movement to the output.
addLine(self, line)
Add a line of text and a newline to the output.
addLines(self, lines)
Add lines of text to the output.
addLinesSetAbsoluteDistanceMode(self, lines)
Add lines of text to the output.
addPerimeterBlock(self, loop, z)
Add the perimeter gcode block for the loop.
addTagBracketedLine(self, tagName, value)
Add a begin tag, balue and end tag.
getArcFeedRateString(self, afterCenterDifferenceAngle, afterPointMinusBefore, centerMinusBefore, feedRateMinute)
Get the start of the arc line.
getBoundaryLine(self, location)
Get boundary gcode line.
getExtrusionDistanceString(self, distance)
Get a z limited gcode movement.
getFirstWordMovement(self, firstWord, location)
Get the start of the arc line.
getLineWithX(self, line, splitLine, x)
Get the line with an x.
getLineWithY(self, line, splitLine, y)
Get the line with a y.
getLineWithZ(self, line, splitLine, z)
Get the line with a z.
getLineWithZLimitedFeedRate(self, feedRateMinute, line, splitLine, location)
Get a replaced limited gcode movement line.
getLinearGcodeMovement(self, point, z)
Get a linear gcode movement.
getLinearGcodeMovementWithFeedRate(self, feedRateMinute, point, z)
Get a z limited gcode movement.
getLinearGcodeMovementWithZLimitedFeedRate(self, feedRateMinute, location)
Get a z limited gcode movement.
getRounded(self, number)
Get number rounded to the number of carried decimal places as a string.
getZLimitedFeedRate(self, deltaZ, distance, feedRateMinute)
Get the z limited feed rate.
parseSplitLine(self, firstWord, splitLine)
Parse gcode split line and store the parameters.
resetLocationOutput(self)
Reset the added location and the output.

 
Functions
       
createInitFile()
Create the __init__.py file.
findWords(fileNames, search)
Find in files the search.
getAbsoluteFolderPath(filePath, folderName='')
Get the double value of the word after the first letter.
getDoubleAfterFirstLetter(word)
Get the double value of the word 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.
getDoubleFromCharacterSplitLine(character, splitLine)
Get the double value of the string after the first occurence of the character in the split line.
getDoubleFromCharacterSplitLineValue(character, splitLine, value)
Get the double value of the string after the first occurence of the character in the split line, if it does not exist return the value.
getFeedRateMinute(feedRateMinute, splitLine)
Get the feed rate per minute if the split line has a feed rate.
getFilePathWithUnderscoredBasename(fileName, suffix)
Get the file path with all spaces in the basename replaced with underscores.
getFileText(fileName, readMode='r', printWarning=True)
Get the entire text of a file.
getFileTextInFileDirectory(fileInDirectory, fileName, readMode='r')
Get the entire text of a file in the directory of the file in directory.
getFilesWithFileTypeWithoutWords(fileType, words=[], fileInDirectory='')
Get files which have a given file type, but with do not contain a word in a list.
getFilesWithFileTypesWithoutWords(fileTypes, words=[], fileInDirectory='')
Get files which have a given file type, but with do not contain a word in a list.
getFirstWord(splitLine)
Get the first word of a split line.
getGcodeFileText(fileName, gcodeText)
Get the gcode text from a file if it the gcode text is empty and if the file is a gcode file.
getHasSuffix(name, suffix)
Determine if the word ends with the suffix.
getLocationFromSplitLine(oldLocation, splitLine)
Get the location from the split line.
getModuleWithDirectoryPath(directoryPath, fileName)
Get the module from the fileName and folder name.
getModuleWithPath(path)
Get the module from the path.
getPluginFilenamesFromDirectoryPath(directoryPath)
Get the file names of the python plugins in the directory path.
getPythonDirectoryNames(directoryName)
Get the python directories.
getPythonDirectoryNamesRecursively(directoryName='')
Get the python directories recursively.
getPythonFilenamesExceptInit(fileInDirectory='')
Get the python fileNames of the directory which the fileInDirectory is in, except for the __init__.py file.
getPythonFilenamesExceptInitRecursively(directoryName='')
Get the python fileNames of the directory recursively, except for the __init__.py files.
getSummarizedFilename(fileName)
Get the fileName basename if the file is in the current working directory, otherwise return the original full name.
getTextIfEmpty(fileName, text)
Get the text from a file if it the text is empty.
getTextLines(text)
Get the all the lines of text of a text.
getUnmodifiedGCodeFiles(fileInDirectory='')
Get gcode files which are not modified.
getVersionFileName()
Get the file name of the version date.
getWithoutBracketsEqualTab(line)
Get a string without the greater than sign, the bracket and less than sign, the equal sign or the tab.
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.
isProcedureDone(gcodeText, procedure)
Determine if the procedure has been done on the gcode text.
isProcedureDoneOrFileIsEmpty(gcodeText, procedure)
Determine if the procedure has been done on the gcode text or the file is empty.
isThereAFirstWord(firstWord, lines, startIndex)
Parse gcode until the first word if there is one.
replaceWords(fileNames, original, replacement)
Replace in files the original with the replacement.
writeFileMessageEnd(end, fileName, fileText, message)
Write to a fileName with a suffix and print a message.
writeFileText(fileName, fileText, writeMode='w+')
Write a text to a file.

 
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)