From d9ebb5e6d0282f382dc3e8b5afc18238c5029517 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 25 Sep 2003 07:20:44 +0000 Subject: [PATCH] Made the template have a hole for the python interpreter, to be filled in with the one the script is called with. --- scripts/supybot-newplugin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/supybot-newplugin.py b/scripts/supybot-newplugin.py index eec5e37ae..5da10ccca 100755 --- a/scripts/supybot-newplugin.py +++ b/scripts/supybot-newplugin.py @@ -3,11 +3,17 @@ import supybot import os +import sys +import os.path + +if sys.version_info < (2, 3, 0): + sys.stderr.write('This script requires Python 2.3 or newer.\n') + sys.exit(-1) from questions import * template = ''' -#!/usr/bin/env python +#!%s ### # Copyright (c) 2002, Jeremiah Fincher @@ -114,8 +120,9 @@ if __name__ == '__main__': else: threaded = 'pass' + python = os.path.normpath(sys.executable) fd = file(name + '.py', 'w') - fd.write(template % (name, name, className, threaded, name)) + fd.write(template % (python, name, name, className, threaded, name)) fd.close() print 'Your new plugin template is %s.py.' % name