def addFromUpperLowerFile( self, fileName ): "Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory." fileText = preferences.getFileInGivenPreferencesDirectory( os.path.dirname( __file__ ), fileName ) if fileText == '': return fileLines = gcodec.getTextLines( fileText ) for line in fileLines: self.addLine( line )
def addFromUpperLowerFile(self, fileName): "Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory." fileText = preferences.getFileInGivenPreferencesDirectory( os.path.dirname(__file__), fileName) if fileText == '': return fileLines = gcodec.getTextLines(fileText) for line in fileLines: self.addLine(line)
def getReplaced( exportText ): "Get text with words replaced according to replace.csv file." replaceText = preferences.getFileInGivenPreferencesDirectory( os.path.dirname( __file__ ), 'Replace.csv' ) if replaceText == '': return exportText lines = gcodec.getTextLines( replaceText ) for line in lines: replacedLine = line.replace( ',', ' ' ) replacedLine = replacedLine.replace( '\t', ' ' ) splitLine = replacedLine.split() if len( splitLine ) > 1: exportText = exportText.replace( splitLine[ 0 ], splitLine[ 1 ] ) return exportText
def getReplaced(exportText): "Get text with words replaced according to replace.csv file." replaceText = preferences.getFileInGivenPreferencesDirectory( os.path.dirname(__file__), 'Replace.csv') if replaceText == '': return exportText lines = gcodec.getTextLines(replaceText) for line in lines: replacedLine = line.replace(',', ' ') replacedLine = replacedLine.replace('\t', ' ') splitLine = replacedLine.split() if len(splitLine) > 1: exportText = exportText.replace(splitLine[0], splitLine[1]) return exportText
def getEndText(): return preferences.getFileInGivenPreferencesDirectory( os.path.dirname( __file__ ), preferences.endFile )
def getStartText(): return preferences.getFileInGivenPreferencesDirectory( os.path.dirname( __file__ ), preferences.startFile )
def getEndText(): return preferences.getFileInGivenPreferencesDirectory( os.path.dirname(__file__), preferences.endFile)
def getStartText(): return preferences.getFileInGivenPreferencesDirectory( os.path.dirname(__file__), preferences.startFile)