Can now write to files
parent
d817af07ee
commit
bead2da226
|
@ -82,13 +82,13 @@ def appendToActuals(targetDir, fileList):
|
|||
realExists = exists(realFilePath)
|
||||
|
||||
# creates if it doesn't exist, so must come after the exists() call
|
||||
cfgFile = open(realFilePath, 'a')
|
||||
cfgFile = open(realFilePath, 'a+')
|
||||
|
||||
if (realExists == False or not strInFile(execStr, cfgFile)):
|
||||
# since the file was created if it didn't exist,
|
||||
# and it was opened in append mode, this will
|
||||
# always place it at the end
|
||||
cfgFile.write( execStr.encode('utf8') )
|
||||
cfgFile.write('\n' + execStr)
|
||||
|
||||
cfgFile.close()
|
||||
|
||||
|
@ -106,7 +106,8 @@ def getRealName(fileName):
|
|||
targetNames = {
|
||||
"demo": "demoman",
|
||||
"heavy": "heavyweapons",
|
||||
"engi": "engineer"
|
||||
"engi": "engineer",
|
||||
"default": "autoexec"
|
||||
}
|
||||
if className in targetNames:
|
||||
className = targetNames[className]
|
||||
|
|
Loading…
Reference in New Issue