mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-03 01:39:23 +01:00
Changed the name of the generated file and made sure to os.chmod it if we can.
This commit is contained in:
parent
1e736dc0f7
commit
6690b08085
@ -483,21 +483,25 @@ if __name__ == '__main__':
|
|||||||
template = fd.read()
|
template = fd.read()
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
format = pprint.pformat
|
||||||
template = template.replace('"%%nick%%"', repr(nick))
|
template = template.replace('"%%nick%%"', repr(nick))
|
||||||
template = template.replace('"%%user%%"', repr(user))
|
template = template.replace('"%%user%%"', repr(user))
|
||||||
template = template.replace('"%%ident%%"', repr(ident))
|
template = template.replace('"%%ident%%"', repr(ident))
|
||||||
template = template.replace('"%%password%%"', repr(password))
|
template = template.replace('"%%password%%"', repr(password))
|
||||||
template = template.replace('"%%server%%"', repr(server))
|
template = template.replace('"%%server%%"', repr(server))
|
||||||
template = template.replace('"%%onStart%%"', repr(onStart))
|
template = template.replace('"%%onStart%%"', format(onStart))
|
||||||
template = template.replace('"%%afterConnect%%"', repr(afterConnect))
|
template = template.replace('"%%afterConnect%%"', format(afterConnect))
|
||||||
template = template.replace('"%%configVariables%%"', repr(configVariables))
|
template = template.replace('"%%configVariables%%"',
|
||||||
template = template.replace('"%%ident%%"', repr(ident))
|
format(configVariables))
|
||||||
|
|
||||||
filename = '%s.py' % nick
|
filename = '%s-botscript.py' % nick
|
||||||
fd = file(filename, 'w')
|
fd = file(filename, 'w')
|
||||||
fd.write(template)
|
fd.write(template)
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
if not sys.platform.startswith('win'):
|
||||||
|
os.chmod(filename, 0755)
|
||||||
|
|
||||||
myPrint("""All done! Your new bot script is %s. If you're running a *nix,
|
myPrint("""All done! Your new bot script is %s. If you're running a *nix,
|
||||||
you can start your bot script with the command line "./%s". If you're not
|
you can start your bot script with the command line "./%s". If you're not
|
||||||
running a *nix or similar machine, you'll just have to start it like you
|
running a *nix or similar machine, you'll just have to start it like you
|
||||||
|
Loading…
Reference in New Issue
Block a user