comparison MoinMoin/script/__init__.py @ 5927:7c6029d23a18

warn if someone gave ... to the moin script, avoids a strange and unhelpful 'empty module name' error message
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 21 Jan 2013 13:41:04 +0100
parents bbb286a9c138
children
comparison
equal deleted inserted replaced
5926:ca07ae758965 5927:7c6029d23a18
241 241
242 To obtain additonal help on a command use 'moin module subcommand --help' 242 To obtain additonal help on a command use 'moin module subcommand --help'
243 """) 243 """)
244 244
245 cmd_module, cmd_name = args[:2] 245 cmd_module, cmd_name = args[:2]
246 if cmd_module == '...':
247 # our docs usually tell to use moin ... cmd_module cmd_name
248 # if somebody enters the ... verbatim, tell him how to do it right:
249 fatal("Wrong invokation. Please do not enter ... verbatim, but give --config-dir and --wiki-url options (see help for more details).")
250
246 from MoinMoin import wikiutil 251 from MoinMoin import wikiutil
247 try: 252 try:
248 plugin_class = wikiutil.importBuiltinPlugin('script.%s' % cmd_module, cmd_name, 'PluginScript') 253 plugin_class = wikiutil.importBuiltinPlugin('script.%s' % cmd_module, cmd_name, 'PluginScript')
249 except wikiutil.PluginMissingError: 254 except wikiutil.PluginMissingError:
250 fatal("Command plugin %r, command %r was not found." % (cmd_module, cmd_name)) 255 fatal("Command plugin %r, command %r was not found." % (cmd_module, cmd_name))