Update supybot-newplugin to generate the current year for the copyright line.

This commit is contained in:
James Vega 2005-01-28 20:33:50 +00:00
parent 1d1f8c43fc
commit 0d693e8b9d

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2002-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -33,6 +33,7 @@ import supybot
import os
import sys
import time
import os.path
import optparse
@ -40,7 +41,7 @@ def error(s):
sys.stderr.write(textwrap.fill(s))
sys.stderr.write(os.linesep)
sys.exit(-1)
if sys.version_info < (2, 3, 0):
error('This script requires Python 2.3 or newer.')
@ -49,7 +50,7 @@ from supybot.questions import *
copyright = '''
###
# Copyright (c) 2004, %s
# Copyright (c) %s, %%s
# All rights reserved.
#
# 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
# 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 = '''
%s
@ -149,7 +152,7 @@ reload(plugin) # In case we\'re being reloaded.
if world.testing:
import test
Class = plugin.Class
configure = config.configure
@ -208,7 +211,7 @@ def main():
name = something('What should the name of the plugin be?')
if name.endswith('.py'):
name = name[:-3]
if os.path.exists(name):
error('A file or directory named %s already exists; remove or '
'rename it and run this program again.' % name)