def getFileOrGcodeDirectory(fileName, wasCancelled, words=[]):
 if isEmptyOrCancelled(fileName, wasCancelled):
  return []
 if isDirectorySetting():
  dotIndex = fileName.rfind('.')
  if (dotIndex < 0):
   print 'The file name should have a suffix, like myfile.xml.'
   print 'Since the file name does not have a suffix, nothing will be done'
  suffix = fileName[(dotIndex + 1):]
  return archive.getFilesWithFileTypeWithoutWords(suffix, words, fileName)
 return [fileName]

def getFileOrGcodeDirectory ( fileName , wasCancelled , words = [ ] ) : if isEmptyOrCancelled ( fileName , wasCancelled ) : return [ ] if isDirectorySetting ( ) : dotIndex = fileName . rfind ( '.' ) if ( dotIndex < 0 ) : print 'The file name should have a suffix, like myfile.xml.' print 'Since the file name does not have a suffix, nothing will be done' suffix = fileName [ ( dotIndex + 1 ) : ] return archive . getFilesWithFileTypeWithoutWords ( suffix , words , fileName ) return [ fileName ]
get the gcode files in the directory the file is in if directory setting is true .