Made the template have a hole for the python interpreter, to be filled in with the one the script is called with.

This commit is contained in:
Jeremy Fincher 2003-09-25 07:20:44 +00:00
parent 2c8dee38c2
commit d9ebb5e6d0

View File

@ -3,11 +3,17 @@
import supybot import supybot
import os 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 * from questions import *
template = ''' template = '''
#!/usr/bin/env python #!%s
### ###
# Copyright (c) 2002, Jeremiah Fincher # Copyright (c) 2002, Jeremiah Fincher
@ -114,8 +120,9 @@ if __name__ == '__main__':
else: else:
threaded = 'pass' threaded = 'pass'
python = os.path.normpath(sys.executable)
fd = file(name + '.py', 'w') fd = file(name + '.py', 'w')
fd.write(template % (name, name, className, threaded, name)) fd.write(template % (python, name, name, className, threaded, name))
fd.close() fd.close()
print 'Your new plugin template is %s.py.' % name print 'Your new plugin template is %s.py.' % name