Example #1
0
	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 )
Example #2
0
 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)
Example #3
0
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
Example #4
0
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
Example #5
0
def getEndText():
	return preferences.getFileInGivenPreferencesDirectory( os.path.dirname( __file__ ), preferences.endFile )
Example #6
0
def getStartText():
	return preferences.getFileInGivenPreferencesDirectory( os.path.dirname( __file__ ), preferences.startFile )
Example #7
0
def getEndText():
    return preferences.getFileInGivenPreferencesDirectory(
        os.path.dirname(__file__), preferences.endFile)
Example #8
0
def getStartText():
    return preferences.getFileInGivenPreferencesDirectory(
        os.path.dirname(__file__), preferences.startFile)