Fixed annoying traceback bug (the 'e' bug) that masked errors in importing malformed command modules.
This commit is contained in:
parent
1c632e2c35
commit
699a6ded43
2 changed files with 3 additions and 6 deletions
|
|
@ -122,9 +122,8 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
|
||||||
if callable(cmdsetclass):
|
if callable(cmdsetclass):
|
||||||
cmdsetclass = cmdsetclass(cmdsetobj)
|
cmdsetclass = cmdsetclass(cmdsetobj)
|
||||||
return cmdsetclass
|
return cmdsetclass
|
||||||
|
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
errstring += _("Error loading cmdset: Couldn't import module '%s': %s.")
|
errstring += _("Error loading cmdset '%s': %s.")
|
||||||
errstring = errstring % (modulepath, e)
|
errstring = errstring % (modulepath, e)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
errstring += _("Error in loading cmdset: No cmdset class '%(classname)s' in %(modulepath)s.")
|
errstring += _("Error in loading cmdset: No cmdset class '%(classname)s' in %(modulepath)s.")
|
||||||
|
|
@ -133,7 +132,7 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
|
||||||
except SyntaxError, e:
|
except SyntaxError, e:
|
||||||
errstring += _("SyntaxError encountered when loading cmdset '%s': %s.")
|
errstring += _("SyntaxError encountered when loading cmdset '%s': %s.")
|
||||||
errstring = errstring % (modulepath, e)
|
errstring = errstring % (modulepath, e)
|
||||||
except Exception:
|
except Exception, e:
|
||||||
errstring += _("Compile/Run error when loading cmdset '%s': %s.")
|
errstring += _("Compile/Run error when loading cmdset '%s': %s.")
|
||||||
errstring = errstring % (python_path, e)
|
errstring = errstring % (python_path, e)
|
||||||
|
|
||||||
|
|
@ -144,7 +143,7 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
|
||||||
if emit_to_obj and not ServerConfig.objects.conf("server_starting_mode"):
|
if emit_to_obj and not ServerConfig.objects.conf("server_starting_mode"):
|
||||||
emit_to_obj.msg(errstring)
|
emit_to_obj.msg(errstring)
|
||||||
err_cmdset = _ErrorCmdSet()
|
err_cmdset = _ErrorCmdSet()
|
||||||
err_cmdset.errmessage = errstring
|
err_cmdset.errmessage = errstring + _("\n (See log for details.)")
|
||||||
return err_cmdset
|
return err_cmdset
|
||||||
|
|
||||||
# classes
|
# classes
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ class CmdHome(MuxCommand):
|
||||||
caller.move_to(home)
|
caller.move_to(home)
|
||||||
caller.msg("There's no place like home ...")
|
caller.msg("There's no place like home ...")
|
||||||
|
|
||||||
|
|
||||||
class CmdLook(MuxCommand):
|
class CmdLook(MuxCommand):
|
||||||
"""
|
"""
|
||||||
look at location or object
|
look at location or object
|
||||||
|
|
@ -62,7 +61,6 @@ class CmdLook(MuxCommand):
|
||||||
"""
|
"""
|
||||||
caller = self.caller
|
caller = self.caller
|
||||||
args = self.args
|
args = self.args
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
# Use search to handle duplicate/nonexistant results.
|
# Use search to handle duplicate/nonexistant results.
|
||||||
looking_at_obj = caller.search(args, use_nicks=True)
|
looking_at_obj = caller.search(args, use_nicks=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue