Renamed commands/commands.py back to commands/command.py, it is confusing Python to import from inside a package with a module named the same as the package - since Python always searches the current directory first, it will try to import from the internal module and not from the external package, leading to not finding the contents of the package. This appears to be more a limitation of the package structure than with Evennia, so solving it the simplest way.

This commit is contained in:
Griatch 2015-02-15 22:00:49 +01:00
parent f3dbf1dad9
commit 60ff4b8515
3 changed files with 5 additions and 5 deletions

View file

@ -125,16 +125,16 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
except ImportError, e:
logger.log_trace()
errstring += _("Error loading cmdset '%s': %s.")
errstring = errstring % (modulepath, e)
errstring = errstring % (python_path, e)
except KeyError:
logger.log_trace()
errstring += _("Error in loading cmdset: No cmdset class '%(classname)s' in %(modulepath)s.")
errstring = errstring % {"classname": classname,
"modulepath": modulepath}
"modulepath": python_path}
except SyntaxError, e:
logger.log_trace()
errstring += _("SyntaxError encountered when loading cmdset '%s': %s.")
errstring = errstring % (modulepath, e)
errstring = errstring % (python_path, e)
except Exception, e:
logger.log_trace()
errstring += _("Compile/Run error when loading cmdset '%s': %s.")

View file

@ -59,7 +59,7 @@ TWISTED_MIN = '12.0'
DJANGO_MIN = '1.7'
DJANGO_REC = '1.7'
sys.path[0] = EVENNIA_ROOT
sys.path[1] = EVENNIA_ROOT
#------------------------------------------------------------
#
@ -643,7 +643,7 @@ def init_game_directory(path, check_db=True):
set_gamedir(path)
# Add gamedir to python path
sys.path.insert(1, GAMEDIR)
sys.path.insert(0, GAMEDIR)
if sys.argv[1] == 'test':
os.environ['DJANGO_SETTINGS_MODULE'] = 'evennia.settings_default'