Trunk: Merged the Devel-branch (branches/griatch) into /trunk. This constitutes a major refactoring of Evennia. Development will now continue in trunk. See the wiki and the past posts to the mailing list for info. /Griatch
This commit is contained in:
parent
df29defbcd
commit
f83c2bddf8
222 changed files with 22304 additions and 14371 deletions
133
game/manage.py
133
game/manage.py
|
|
@ -1,28 +1,129 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
Set up the evennia system. A first startup consists of giving
|
||||
the command './manage syncdb' to setup the system and create
|
||||
the database.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Tack on the root evennia directory to the python path.
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
"""
|
||||
If settings.py doesn't already exist, create it and populate it with some
|
||||
basic stuff.
|
||||
"""
|
||||
try:
|
||||
VERSION = open("%s%s%s" % (os.pardir, os.sep, 'VERSION')).readline().strip()
|
||||
except IOError:
|
||||
VERSION = "Unknown version"
|
||||
|
||||
_CREATED_SETTINGS = False
|
||||
if not os.path.exists('settings.py'):
|
||||
print "Can't find a settings.py file, creating one for you."
|
||||
f = open('settings.py', 'w')
|
||||
f.write('"""\nMaster server configuration file. You may override any of the values in the\nsrc/config_defaults.py here. Copy-paste the variables here, and make changes to\nthis file rather than editing config_defaults.py directly.\n"""\n')
|
||||
f.write('from src.config_defaults import *')
|
||||
f.close()
|
||||
# If settings.py doesn't already exist, create it and populate it with some
|
||||
# basic stuff.
|
||||
|
||||
settings_file = open('settings.py', 'w')
|
||||
_CREATED_SETTINGS = True
|
||||
|
||||
string = \
|
||||
"""#
|
||||
# Evennia MU* server configuration file
|
||||
#
|
||||
# You may customize your setup by copy&pasting the variables you want
|
||||
# to change from the master config file src/settings_default.py to
|
||||
# this file. Try to *only* copy over things you really need to customize
|
||||
# and do *not* make any changes to src/settings_default.py directly.
|
||||
# This way you'll always have a sane default to fall back on
|
||||
# (also, the master file may change with server updates).
|
||||
#
|
||||
|
||||
from src.settings_default import *
|
||||
|
||||
###################################################
|
||||
# Evennia base server config
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Evennia Database config
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Evennia in-game parsers
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Default command sets
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Default Object typeclasses
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Batch processor
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Game Time setup
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Game Permissions
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# In-game Channels created from server start
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# IMC2 Configuration
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# IRC config
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Config for Django web features
|
||||
###################################################
|
||||
|
||||
###################################################
|
||||
# Evennia components (django apps)
|
||||
###################################################"""
|
||||
|
||||
settings_file.write(string)
|
||||
settings_file.close()
|
||||
|
||||
print """
|
||||
Welcome to Evennia (version %s)!
|
||||
Created a fresh settings.py file for you.""" % VERSION
|
||||
|
||||
|
||||
|
||||
try:
|
||||
from game import settings
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
||||
sys.exit(1)
|
||||
|
||||
except Exception:
|
||||
import traceback
|
||||
string = "\n" + traceback.format_exc()
|
||||
string += """\n
|
||||
Error: Couldn't import the file 'settings.py' in the directory
|
||||
containing %r. There can be two reasons for this:
|
||||
1) You moved your settings.py elsewhere. In that case you need to run
|
||||
django-admin.py, passing it the true location of your settings module.
|
||||
2) The settings module is where it's supposed to be, but an exception
|
||||
was raised when trying to load it. Review the traceback above to
|
||||
resolve the problem, then try again.
|
||||
""" % __file__
|
||||
print string
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
from django.core.management import execute_manager
|
||||
execute_manager(settings)
|
||||
from django.core.management import execute_manager
|
||||
if _CREATED_SETTINGS:
|
||||
print """
|
||||
Edit your new settings.py file as needed, then run
|
||||
'python manage syncdb' and follow the prompts to
|
||||
create the database and your superuser account.
|
||||
"""
|
||||
sys.exit()
|
||||
# run the django setups
|
||||
execute_manager(settings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue