mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-03 16:52:34 +01:00
Update supybot-newplugin to generate the current year for the copyright line.
This commit is contained in:
parent
1d1f8c43fc
commit
0d693e8b9d
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
###
|
###
|
||||||
# Copyright (c) 2002-2004, Jeremiah Fincher
|
# Copyright (c) 2002-2005, Jeremiah Fincher
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -33,6 +33,7 @@ import supybot
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import os.path
|
import os.path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ def error(s):
|
|||||||
sys.stderr.write(textwrap.fill(s))
|
sys.stderr.write(textwrap.fill(s))
|
||||||
sys.stderr.write(os.linesep)
|
sys.stderr.write(os.linesep)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
if sys.version_info < (2, 3, 0):
|
if sys.version_info < (2, 3, 0):
|
||||||
error('This script requires Python 2.3 or newer.')
|
error('This script requires Python 2.3 or newer.')
|
||||||
|
|
||||||
@ -49,7 +50,7 @@ from supybot.questions import *
|
|||||||
|
|
||||||
copyright = '''
|
copyright = '''
|
||||||
###
|
###
|
||||||
# Copyright (c) 2004, %s
|
# Copyright (c) %s, %%s
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -76,7 +77,9 @@ copyright = '''
|
|||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
###
|
###
|
||||||
'''.strip() # Here we use strip() instead of lstrip() on purpose.
|
''' % time.strftime('%Y')
|
||||||
|
# Here we use strip() instead of lstrip() on purpose.
|
||||||
|
copyright = copyright.strip()
|
||||||
|
|
||||||
pluginTemplate = '''
|
pluginTemplate = '''
|
||||||
%s
|
%s
|
||||||
@ -149,7 +152,7 @@ reload(plugin) # In case we\'re being reloaded.
|
|||||||
|
|
||||||
if world.testing:
|
if world.testing:
|
||||||
import test
|
import test
|
||||||
|
|
||||||
Class = plugin.Class
|
Class = plugin.Class
|
||||||
configure = config.configure
|
configure = config.configure
|
||||||
|
|
||||||
@ -208,7 +211,7 @@ def main():
|
|||||||
name = something('What should the name of the plugin be?')
|
name = something('What should the name of the plugin be?')
|
||||||
if name.endswith('.py'):
|
if name.endswith('.py'):
|
||||||
name = name[:-3]
|
name = name[:-3]
|
||||||
|
|
||||||
if os.path.exists(name):
|
if os.path.exists(name):
|
||||||
error('A file or directory named %s already exists; remove or '
|
error('A file or directory named %s already exists; remove or '
|
||||||
'rename it and run this program again.' % name)
|
'rename it and run this program again.' % name)
|
||||||
|
Loading…
Reference in New Issue
Block a user