def getFileOrDirectoryTypesUnmodifiedGcode( fileName, fileTypes, wasCancelled ): "Get the gcode files in the directory the file is in if directory setting is true. Otherwise, return the file in a list." if isEmptyOrCancelled( fileName, wasCancelled ): return [] if isDirectorySetting(): return gcodec.getFilesWithFileTypesWithoutWords( fileTypes, [], fileName ) + gcodec.getUnmodifiedGCodeFiles( fileName ) return [ fileName ]
def getFileOrDirectoryTypesUnmodifiedGcode( fileName, fileTypes, wasCancelled ): "Get the gcode files in the directory the file is in if directory preference is true. Otherwise, return the file in a list." if isEmptyOrCancelled( fileName, wasCancelled ): return [] if isDirectoryPreference(): return gcodec.getFilesWithFileTypesWithoutWords( fileTypes, [], fileName ) + gcodec.getUnmodifiedGCodeFiles( fileName ) return [ fileName ]
def commentFile(fileName=''): "Comment a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len(unmodified) == 0: print("There are no unmodified gcode files in this folder.") return fileName = unmodified[0] writeCommentFileGivenText(fileName, gcodec.getFileText(fileName))
def commentFile( fileName = '' ): "Comment a gcode file. If no fileName is specified, comment the first gcode file in this folder that is not modified." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return fileName = unmodified[ 0 ] writeCommentFileGivenText( fileName, gcodec.getFileText( fileName ) )
def beholdFile( fileName = '' ): "Behold a gcode file. If no fileName is specified, behold the first gcode file in this folder that is not modified." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return fileName = unmodified[ 0 ] gcodeText = gcodec.getFileText( fileName ) displayBeholdFileGivenText( gcodeText )
def statisticFile( fileName = '' ): "Write statistics for a gcode file. If no fileName is specified, write statistics for the first gcode file in this folder that is not modified." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return fileName = unmodified[ 0 ] statisticPreferences = StatisticPreferences() preferences.getReadPreferences( statisticPreferences ) writeStatisticFileGivenText( fileName, gcodec.getFileText( fileName ), statisticPreferences )
def statisticFile( fileName = '' ): "Write statistics for a gcode file. If no fileName is specified, write statistics for the first gcode file in this folder that is not modified." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return fileName = unmodified[ 0 ] statisticPreferences = StatisticPreferences() preferences.readPreferences( statisticPreferences ) writeStatisticFileGivenText( fileName, gcodec.getFileText( fileName ), statisticPreferences )
def writeVectorFile( fileName = '' ): "Write scalable vector graphics for a gcode file. If no fileName is specified, write scalable vector graphics for the first gcode file in this folder." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There is no gcode file in this folder." ) return fileName = unmodified[ 0 ] vectorwritePreferences = VectorwritePreferences() preferences.readPreferences( vectorwritePreferences ) gcodeText = gcodec.getFileText( fileName ) writeVectorFileGivenText( fileName, gcodeText, vectorwritePreferences )
def bevelFile( fileName = '' ): "Bevel a gcode linear move file. If no fileName is specified, bevel the first unmodified gcode file in this folder." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being beveled.' ) gcodeText = gcodec.getFileText( fileName ) if gcodeText == '': return gcodec.writeFileMessageSuffix( fileName, getBevelGcode( filletPreferences, gcodeText ), 'The beveled file is saved as ', '_fillet' )
def arcRadiusFile( fileName = '' ): "Fillet a gcode linear move file into a helical radius move file. If no fileName is specified, arc radius the first unmodified gcode file in this folder." if fileName == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print( "There are no unmodified gcode files in this folder." ) return fileName = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being filleted into arc radiuses.' ) gcodeText = gcodec.getFileText( fileName ) if gcodeText == '': return gcodec.writeFileMessageSuffix( fileName, getArcRadiusGcode( filletPreferences, gcodeText ), 'The arc radius file is saved as ', '_fillet' )
def getGNUTranslatorFilesUnmodified(): "Get the file types from the translators in the import plugins folder." return gcodec.getFilesWithFileTypesWithoutWords( getImportPluginFileNames() ) + [ gcodec.getUnmodifiedGCodeFiles() ]
def getGNUTranslatorFilesUnmodified(): "Get the file types from the translators in the import plugins folder." return gcodec.getFilesWithFileTypesWithoutWords( getImportPluginFilenames() ) + [ gcodec.getUnmodifiedGCodeFiles() ]