mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
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:
parent
2c8dee38c2
commit
d9ebb5e6d0
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user