Can now write to files

main
Nicholas Hope 2022-08-13 21:01:38 -04:00
parent d817af07ee
commit bead2da226
1 changed files with 4 additions and 3 deletions

View File

@ -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]