From 6690b080857261416e3bb1abd495b6768f318080 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 24 Sep 2003 16:21:13 +0000 Subject: [PATCH] Changed the name of the generated file and made sure to os.chmod it if we can. --- scripts/supybot-wizard.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/supybot-wizard.py b/scripts/supybot-wizard.py index 6f13857bb..c14b03587 100755 --- a/scripts/supybot-wizard.py +++ b/scripts/supybot-wizard.py @@ -483,21 +483,25 @@ if __name__ == '__main__': template = fd.read() fd.close() + format = pprint.pformat template = template.replace('"%%nick%%"', repr(nick)) template = template.replace('"%%user%%"', repr(user)) template = template.replace('"%%ident%%"', repr(ident)) template = template.replace('"%%password%%"', repr(password)) template = template.replace('"%%server%%"', repr(server)) - template = template.replace('"%%onStart%%"', repr(onStart)) - template = template.replace('"%%afterConnect%%"', repr(afterConnect)) - template = template.replace('"%%configVariables%%"', repr(configVariables)) - template = template.replace('"%%ident%%"', repr(ident)) + template = template.replace('"%%onStart%%"', format(onStart)) + template = template.replace('"%%afterConnect%%"', format(afterConnect)) + template = template.replace('"%%configVariables%%"', + format(configVariables)) - filename = '%s.py' % nick + filename = '%s-botscript.py' % nick fd = file(filename, 'w') fd.write(template) 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, 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