An import check in ev.py acted weirdly in some situations. Changed to something more sensible.

This commit is contained in:
Griatch 2013-05-14 15:17:05 +02:00
parent f00053710c
commit 25f1d7b627

16
ev.py
View file

@ -89,21 +89,23 @@ if __name__ == "__main__":
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from django.conf import settings as settings_full from django.conf import settings as settings_full
from game import settings
try: try:
settings_full.configure() settings_full.configure()
except RuntimeError: except RuntimeError:
pass pass
del sys, os del sys, os
from game import settings
try: try:
import src.objects # test this first import to make sure environment is set up correctly
except (ImportError, AttributeError): from src.help.models import HelpEntry
err = "\nInitializing ev.py: The correct environment variables were not set." except AttributeError, e:
err = e.message
err += "\nError initializing ev.py: Maybe the correct environment variables were not set."
err += "\nUse \"python game/manage.py shell\" to start an interpreter" err += "\nUse \"python game/manage.py shell\" to start an interpreter"
err += " with everything set up correctly." err += " with everything configured correctly."
raise ImportError(err) raise AttributeError(err)
del src.objects
###################################################################### ######################################################################
# Start Evennia API # Start Evennia API