mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-03 18:37:31 +02:00
scripts/supybot-plugin-create: Prompt the user to see if the wish to use Supybot's license.
This commit is contained in:
parent
408887e0a0
commit
296980e20e
@ -53,6 +53,13 @@ copyright = '''
|
|||||||
# Copyright (c) %s, %%s
|
# Copyright (c) %s, %%s
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
%%s
|
||||||
|
###
|
||||||
|
''' % time.strftime('%Y')
|
||||||
|
# Here we use strip() instead of lstrip() on purpose.
|
||||||
|
copyright = copyright.strip()
|
||||||
|
|
||||||
|
license = '''
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions are met:
|
# modification, are permitted provided that the following conditions are met:
|
||||||
#
|
#
|
||||||
@ -76,10 +83,8 @@ copyright = '''
|
|||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
# 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.
|
||||||
###
|
'''
|
||||||
''' % time.strftime('%Y')
|
license = license.lstrip()
|
||||||
# Here we use strip() instead of lstrip() on purpose.
|
|
||||||
copyright = copyright.strip()
|
|
||||||
|
|
||||||
pluginTemplate = '''
|
pluginTemplate = '''
|
||||||
%s
|
%s
|
||||||
@ -187,6 +192,7 @@ Insert a description of your plugin here, with any notes, etc. about using it.
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
global copyright
|
global copyright
|
||||||
|
global license
|
||||||
parser = optparse.OptionParser(usage='Usage: %prog [options]',
|
parser = optparse.OptionParser(usage='Usage: %prog [options]',
|
||||||
version='Supybot %s' % conf.version)
|
version='Supybot %s' % conf.version)
|
||||||
parser.add_option('-n', '--name', action='store', dest='name',
|
parser.add_option('-n', '--name', action='store', dest='name',
|
||||||
@ -232,6 +238,9 @@ def main():
|
|||||||
appropriately?
|
appropriately?
|
||||||
""").strip())
|
""").strip())
|
||||||
|
|
||||||
|
if not yn('Do you wish to use Supybot\'s license for your plugin?'):
|
||||||
|
license = '#'
|
||||||
|
|
||||||
if threaded:
|
if threaded:
|
||||||
threaded = 'threaded = True'
|
threaded = 'threaded = True'
|
||||||
else:
|
else:
|
||||||
@ -243,7 +252,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]
|
||||||
copyright %= realName
|
copyright %= (realName, license)
|
||||||
|
|
||||||
# Make the directory.
|
# Make the directory.
|
||||||
os.mkdir(name)
|
os.mkdir(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user