Merge pull request #928 from joulez/scripts

supybot-plugin-create add --desc option
This commit is contained in:
Valentin Lorentz 2014-12-03 08:14:58 +01:00
commit 1e8d51ac6d

View File

@ -151,8 +151,7 @@ __init__Template = '''
%s
"""
Add a description of the plugin (to be presented to the user inside the wizard)
here. This should describe *what* the plugin does.
%s: %s
"""
import supybot
@ -204,7 +203,9 @@ class %sTestCase(PluginTestCase):
'''.lstrip()
readmeTemplate = '''
Insert a description of your plugin here, with any notes, etc. about
%s
Insert a more detailed description of your plugin here, with any notes, etc. about
using it.
'''.lstrip()
@ -220,6 +221,8 @@ def main():
parser.add_option('', '--real-name', action='store', dest='realName',
help='Determines what real name the copyright is '
'assigned to.')
parser.add_option('', '--desc', action='store', dest='desc',
help='Short description of plugin.')
(options, args) = parser.parse_args()
if options.name:
name = options.name
@ -259,6 +262,11 @@ def main():
if not yn('Do you wish to use Supybot\'s license for your plugin?'):
license = '#'
if not options.desc:
options.desc = something(textwrap.dedent("""
Please provide a short description of the plugin.
""").strip())
if threaded:
threaded = 'threaded = True'
else:
@ -287,9 +295,9 @@ def main():
name, threaded, name))
writeFile('config.py', configTemplate % (copyright, name, name, name, name,
name))
writeFile('__init__.py', __init__Template % copyright)
writeFile('__init__.py', __init__Template % (copyright, name, options.desc))
writeFile('test.py', testTemplate % (copyright, name, name))
writeFile('README.md', readmeTemplate)
writeFile('README.md', readmeTemplate % (options.desc,))
pathname = os.path.join(pathname, 'local')
os.mkdir(pathname)