diff --git a/doxygen/Doxyfile b/docs/doxygen/Doxyfile similarity index 99% rename from doxygen/Doxyfile rename to docs/doxygen/Doxyfile index 0748afe82..e2b87e07b 100644 --- a/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -82,7 +82,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ../ +INPUT = ../../ FILE_PATTERNS = *.c \ *.cc \ *.cxx \ diff --git a/evennia.vhost.apache b/docs/evennia.vhost.apache old mode 100755 new mode 100644 similarity index 100% rename from evennia.vhost.apache rename to docs/evennia.vhost.apache diff --git a/game/__init__.py b/game/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/game/settings.py b/game/settings.py new file mode 100644 index 000000000..9553af018 --- /dev/null +++ b/game/settings.py @@ -0,0 +1 @@ +from src.config_defaults import * \ No newline at end of file diff --git a/startup.bat b/game/startup.bat similarity index 84% rename from startup.bat rename to game/startup.bat index 7970cca2c..a3fee2f9f 100644 --- a/startup.bat +++ b/game/startup.bat @@ -5,12 +5,12 @@ rem NOTE: This _MUST_ be launched with the Twisted environment variables rem set. It is recommended that you launch Twisted Command Prompt to do so. rem ------------------------------------------------------------------------ -set DJANGO_SETTINGS_MODULE=settings -set PYTHONPATH=. +set DJANGO_SETTINGS_MODULE=game.settings +set PYTHONPATH=.. echo Starting Evennia... rem ------------------------------------------------------------------------ rem We're only going to run in interactive mode until we've had more time to rem make sure things work as expected on Windows. rem ------------------------------------------------------------------------ -twistd -oy --logfile=- --python=src/server.py \ No newline at end of file +twistd -oy --logfile=- --python=../src/server.py \ No newline at end of file diff --git a/startup.sh b/game/startup.sh old mode 100755 new mode 100644 similarity index 80% rename from startup.sh rename to game/startup.sh index 070b9465e..21e68f733 --- a/startup.sh +++ b/game/startup.sh @@ -14,22 +14,23 @@ init () { ## Sets environmental variables and preps the logs. - export DJANGO_SETTINGS_MODULE="settings" - BASE_PATH=`python -c "import settings; print settings.BASE_PATH"` - mv -f $BASE_PATH/logs/evennia.log $BASE_PATH/logs/evennia.logs.old + export PYTHON_PATH=".." + export DJANGO_SETTINGS_MODULE="game.settings" + GAME_DIR=`python -c "import settings; print settings.GAME_DIR"` + mv -f $GAME_DIR/logs/evennia.log $GAME_DIR/logs/evennia.logs.old } startup_interactive() { ## Starts the server in interactive mode. init echo "Starting in interactive mode..." - twistd -n --logfile=logs/evennia.log --python=src/server.py + twistd -n --logfile=logs/evennia.log --python=../src/server.py } startup_daemon() { ## Starts the server in daemon mode. init - twistd --logfile=logs/evennia.log --python=src/server.py + twistd --logfile=logs/evennia.log --python=../src/server.py } stop_server() { diff --git a/reload/__init__.py b/reload/__init__.py deleted file mode 100644 index b5fc2d28f..000000000 --- a/reload/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Reloader module for handling @reload. -""" - -from managers import ReloadManager as manager diff --git a/reload/config.py b/reload/config.py deleted file mode 100644 index 7a9b8a9a9..000000000 --- a/reload/config.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Configuration file for the reload system to add custom -modules to be reloaded at @reload. -""" - -# All of these are reloaded after the built-in system modules and default -# model modules are reloaded. - -# These are custom modules that have classes requiring state-saving. -# These modules are reloaded before those in no_cache. -cache = { - # This should be a dict of lists of tuples - # with the module name as a key, a list of tuples - # with the class name as the first element of the - # tuple, and True or False if this is a model - # for the database, like so: - # - # 'modulename' : [ ('ModelA', True), ('ClassA', False) ], - # 'anothermod' : [ ('ClassB', False), ('ClassC', False) ], - } - -# This is a list of modules that need to be reloaded at @reload. There -# is no state-saving, and these are reloaded after those cached above. -no_cache = [ - # 'modulename', - # 'anothermod', - ] diff --git a/reload/managers.py b/reload/managers.py deleted file mode 100644 index c3e5923d2..000000000 --- a/reload/managers.py +++ /dev/null @@ -1,51 +0,0 @@ -import functions_general - -class ReloadManager(object): - objects_cache = {} - failed = [] - - models = {} - - def __init__(self, server): - self.server = server - - def do_cache(self): - for module, info in self.models.iteritems(): - module_obj = __import__(module) - for ituple in info: - mclass = getattr(module_obj, info[0]) - for instance in mclass.__instances__(): - instance.cache(self, do_save=ituple[1]) - - def do_reload(self): - self.do_cache() - self.server.reload() - self.reload_objects() - - def cache_object(self, obj): - obj_dict = {} - for key, value in obj.__dict__.iteritems(): - if not callable(obj[key]): - obj_dict[key] = value - - self.objects_cache[obj] = obj_dict - - def reload_objects(self): - for obj, cache in self.objects_cache.iteritems(): - try: - obj.reload(cache) - except: - functions_general.log_errmsg("Failed to reload cache for object: %s." % (obj,)) - self.failed.append(obj) - raise - - self.objects_cache = {} - - for obj in self.failed: - try: - obj.__dict__.update(cache) - except: - functions_general.log_errmsg("Failed to update object %s, giving up." %s (obj,)) - raise - - self.failed = [] diff --git a/settings.py b/src/config_defaults.py old mode 100755 new mode 100644 similarity index 90% rename from settings.py rename to src/config_defaults.py index a4c08be49..9e610468d --- a/settings.py +++ b/src/config_defaults.py @@ -2,10 +2,8 @@ Master configuration file for Evennia. NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE! All settings changes should -be done by copy-pasting the variable and its value to a new file (if it doesn't -already exist) called local_settings.py and changed there. Anything in the -local_settings.py file will override what is seen in settings.py by the -import at the end of this file. +be done by copy-pasting the variable and its value to your game directory's +settings.py file. """ import os @@ -30,7 +28,10 @@ ADMINS = ( MANAGERS = ADMINS # The path that contains this settings.py file (no trailing slash). -BASE_PATH = os.path.abspath(os.path.split(__file__)[0]) +BASE_PATH = os.path.join(os.path.abspath(os.path.split(__file__)[0]), '..') + +# Path to the game directory (containing the database file if using sqlite). +GAME_DIR = os.path.join(BASE_PATH, 'game') # Absolute path to the directory that holds media (no trailing slash). # Example: "/home/media/media.lawrence.com" @@ -43,7 +44,7 @@ SCRIPT_ROOT = '%s/src/scripts' % (BASE_PATH) # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'. DATABASE_ENGINE = 'sqlite3' # Database name, or path to DB file if using sqlite3. -DATABASE_NAME = '%s/evennia.db3' % (BASE_PATH) +DATABASE_NAME = os.path.join(GAME_DIR, 'evennia.db3') # Unused for sqlite3 DATABASE_USER = '' # Unused for sqlite3 @@ -181,14 +182,4 @@ try: import django_extensions INSTALLED_APPS = INSTALLED_APPS + ('django_extensions',) except ImportError: - pass - -""" -Importing everything from local_settings.py overrides the settings in this -file with the settings specified in local_settings.py. Any configuration -changes should happen in local_settings.py rather than this file. -""" -try: - from local_settings import * -except ImportError: - pass \ No newline at end of file + pass \ No newline at end of file diff --git a/src/scripthandler.py b/src/scripthandler.py index 0eeeb60fd..98ebc5fba 100644 --- a/src/scripthandler.py +++ b/src/scripthandler.py @@ -7,7 +7,7 @@ interaction with actual script methods should happen via calls to Objects. import os from traceback import format_exc -import settings +from django.conf import settings from src import logger # A dictionary with keys equivalent to the script's name and values that