示例#1
0
def parseLineReplaceWithTable(firstWordTable, line, output, replaceWithTable):
    "Parse the line and replace it if the first word of the line is in the first word table."
    firstWord = gcodec.getFirstWordFromLine(line)
    if firstWord in firstWordTable:
        line = firstWordTable[firstWord]
    elif line.find('replaceWith') > -1:
        line = getReplaceWithLine(line, replaceWithTable)
    gcodec.addLineAndNewlineIfNecessary(line, output)
示例#2
0
def parseLineReplaceWithTable( firstWordTable, line, output, replaceWithTable ):
	"Parse the line and replace it if the first word of the line is in the first word table."
	firstWord = gcodec.getFirstWordFromLine( line )
	if firstWord in firstWordTable:
		line = firstWordTable[ firstWord ]
	elif line.find( 'replaceWith' ) > - 1:
		line = getReplaceWithLine( line, replaceWithTable )
	gcodec.addLineAndNewlineIfNecessary( line, output )
示例#3
0
def parseLineReplace( firstWordTable, line, output ):
	"Parse the line and replace it if the first word of the line is in the first word table."
	firstWord = gcodec.getFirstWordFromLine( line )
	if firstWord in firstWordTable:
		line = firstWordTable[ firstWord ]
	gcodec.addLineAndNewlineIfNecessary( line, output )