Um, yeah...strings are immutable in Python. I should know that.

This commit is contained in:
Jeremy Fincher 2003-09-16 05:58:56 +00:00
parent 66b64bd002
commit e368e90723

View File

@ -55,14 +55,15 @@ if __name__ == '__main__':
except ImportError, e: except ImportError, e:
sys.stderr.write('Invalid script file: %s\n' % e) sys.stderr.write('Invalid script file: %s\n' % e)
sys.exit(-1) sys.exit(-1)
template.replace('%%nick%%', repr(script.defaultNick)) template = template.replace('%%nick%%', repr(script.defaultNick))
template.replace('%%user%%', repr(script.defaultUser)) template = template.replace('%%user%%', repr(script.defaultUser))
template.replace('%%ident%%', repr(script.defaultIdent)) template = template.replace('%%ident%%', repr(script.defaultIdent))
template.replace('%%server%%', repr(script.defaultServer)) template = template.replace('%%server%%', repr(script.defaultServer))
template.replace('%%password%%', repr(script.defaultPassword)) template = template.replace('%%password%%', repr(script.defaultPassword))
template.replace('%%onStart%%', repr(conf.commandsOnStart)) template = template.replace('%%onStart%%', repr(conf.commandsOnStart))
template.replace('%%afterConnect%%', repr(script.afterConnect)) template = template.replace('%%afterConnect%%', repr(script.afterConnect))
template.replace('%%configVariables%%', repr(script.configVariables)) template = template.replace('%%configVariables%%',
repr(script.configVariables))
os.rename(sys.argv[1], sys.argv[1] + '.bak') os.rename(sys.argv[1], sys.argv[1] + '.bak')
fd = file(sys.argv[1], 'w') fd = file(sys.argv[1], 'w')
fd.write(template) fd.write(template)