Updated the game template, renaming subdir typeclasses rather than types since the latter collides with the python library module of the same name.

This commit is contained in:
Griatch 2015-01-08 00:04:18 +01:00
parent 3fbc9acc51
commit c96c5a1fc7
112 changed files with 456 additions and 229 deletions

View file

@ -0,0 +1,42 @@
"""
Inlinefunc
Inline functions allow for direct conversion of text users mark in a
special way. Inlinefuncs are deactivated by default. To activate, add
INLINEFUNC_ENABLED = True
to your settings file. The default inlinefuncs are found in
evennia.utils.inlinefunc.
In text, usage is straightforward:
{funcname([arg1,arg2,...]) text {/funcname
Example 1 (using the "pad" inlinefunc):
"This is {pad(50,c,-) a center-padded text{/pad of width 50."
->
"This is -------------- a center-padded text--------------- of width 50."
Example 2 (using "pad" and "time" inlinefuncs):
"The time is {pad(30){time(){/time{/padright now."
->
"The time is Oct 25, 11:09 right now."
To add more inline functions, add them to this module, using
the following call signature:
def funcname(text, *args)
where the text is always the part between {funcname(args) and
{/funcname and the *args are taken from the appropriate part of the
call. It is important that the inline function properly clean the
incoming args, checking their type and replacing them with sane
defaults if needed. If impossible to resolve, the unmodified text
should be returned. The inlinefunc should never cause a traceback.
"""
#def capitalize(text, *args):
# "Silly capitalize example"
# return text.capitalize()

View file

@ -0,0 +1,92 @@
"""
Evennia settings file.
The full options are found in the default settings file found here:
{settings_default}
Note: Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
"""
# Use the defaults from Evennia unless explicitly overridden
import os
from evennia.settings_default import *
######################################################################
# Evennia base server config
######################################################################
# This is the name of your game. Make it catchy!
SERVERNAME = {servername}
# Path to the game directory (use EVENNIA_DIR to refer to the
# core evennia library)
GAME_DIR = {game_dir}
# Place to put log files
LOG_DIR = os.path.join(GAME_DIR, "server", "logs")
SERVER_LOG_FILE = os.path.join(LOG_DIR, 'server.log')
PORTAL_LOG_FILE = os.path.join(LOG_DIR, 'portal.log')
HTTP_LOG_FILE = os.path.join(LOG_DIR, 'http_requests.log')
######################################################################
# Evennia Database config
######################################################################
# Database config syntax:
# ENGINE - path to the the database backend. Possible choices are:
# 'django.db.backends.sqlite3', (default)
# 'django.db.backends.mysql',
# 'django.db.backends.'postgresql_psycopg2' (see Issue 241),
# 'django.db.backends.oracle' (untested).
# NAME - database name, or path to the db file for sqlite3
# USER - db admin (unused in sqlite3)
# PASSWORD - db admin password (unused in sqlite3)
# HOST - empty string is localhost (unused in sqlite3)
# PORT - empty string defaults to localhost (unused in sqlite3)
DATABASES = {{
'default': {{
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(GAME_DIR, "server", "evennia.db3"),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': ''
}}}}
######################################################################
# Django web features
######################################################################
# Absolute path to the directory that holds file uploads from web apps.
# Example: "/home/media/media.lawrence.com"
MEDIA_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "media")
# The master urlconf file that contains all of the sub-branches to the
# applications. Change this to add your own URLs to the website.
ROOT_URLCONF = 'web.urls'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure
# to use a trailing slash. Django1.4+ will look for admin files under
# STATIC_URL/admin.
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(GAME_DIR, "web", "static")
# Directories from which static files will be gathered from.
STATICFILES_DIRS = (
os.path.join(GAME_DIR, "web", "static_overrides"),
os.path.join(EVENNIA_DIR, "web", "static"),)
# We setup the location of the website template as well as the admin site.
TEMPLATE_DIRS = (
os.path.join(GAME_DIR, "web", "template_overrides"),
os.path.join(EVENNIA_DIR, "web", "templates", ACTIVE_TEMPLATE),
os.path.join(EVENNIA_DIR, "web", "templates"),)
# The secret key is randomly seeded upon creation. It is used to
# salt cryptographic keys. Don't change this once you have created users
# and don't share it with anyone.
SECRET_KEY = {secret_key}