Even more death and destruction. A lot more stuff moved to src/. A lot more bugs probably introduced.

This commit is contained in:
Greg Taylor 2008-06-15 19:38:39 +00:00
parent d3808c1ea2
commit 4bb00013ae
28 changed files with 45 additions and 38 deletions

View file

@ -1,5 +1,9 @@
import ansi """
Models for the help system.
"""
from django.db import models from django.db import models
from src import ansi
from apps.helpsys.managers.helpentry import HelpEntryManager from apps.helpsys.managers.helpentry import HelpEntryManager
class HelpEntry(models.Model): class HelpEntry(models.Model):

View file

@ -3,15 +3,16 @@ import re
from django.db import models from django.db import models
from django.contrib.auth.models import User, Group from django.contrib.auth.models import User, Group
import scripthandler
import defines_global
import ansi
import src.flags
from apps.config.models import ConfigValue from apps.config.models import ConfigValue
from apps.objects.util import object as util_object from apps.objects.util import object as util_object
from apps.objects.managers.commchannel import CommChannelManager from apps.objects.managers.commchannel import CommChannelManager
from apps.objects.managers.object import ObjectManager from apps.objects.managers.object import ObjectManager
from apps.objects.managers.attribute import AttributeManager from apps.objects.managers.attribute import AttributeManager
from src import scripthandler
import defines_global
from src import ansi
# Import as the absolute path to avoid local variable clashes.
import src.flags
class Attribute(models.Model): class Attribute(models.Model):
""" """
@ -894,4 +895,4 @@ class CommChannelMessage(models.Model):
list_display = ('channel', 'message') list_display = ('channel', 'message')
import functions_general import functions_general
import session_mgr from src import session_mgr

View file

@ -1,13 +1,14 @@
""" """
Comsys functions. Comsys functions.
""" """
import time, datetime import time
import datetime
from django.utils import simplejson from django.utils import simplejson
from apps.objects.models import CommChannel, CommChannelMessage from apps.objects.models import CommChannel, CommChannelMessage
import session_mgr from src import session_mgr
import ansi from src import ansi
def plr_get_cdict(session): def plr_get_cdict(session):
""" """

View file

@ -3,7 +3,7 @@ General functions that don't fit neatly under any given category.
""" """
import os import os
import textwrap import textwrap
import session_mgr from src import session_mgr
def wildcard_to_regexp(instring): def wildcard_to_regexp(instring):
""" """

View file

@ -28,8 +28,8 @@ BASE_PATH = '/home/evennia/evennia'
MEDIA_ROOT = '%s/media' % (BASE_PATH) MEDIA_ROOT = '%s/media' % (BASE_PATH)
# Absolute path to the directory that has the script tree in it. (no trailing slash) # Absolute path to the directory that has the script tree in it. (no trailing slash)
# Example: "/home/evennia/scripts" # Example: "/home/evennia/src/scripts"
SCRIPT_ROOT = '%s/scripts' % (BASE_PATH) SCRIPT_ROOT = '%s/src/scripts' % (BASE_PATH)
# 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'. # 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'.
DATABASE_ENGINE = 'sqlite3' DATABASE_ENGINE = 'sqlite3'

View file

@ -1,10 +1,3 @@
import commands.general
import commands.privileged
import commands.comsys
import commands.unloggedin
import commands.info
import commands.objmanip
""" """
Command Table Entries Command Table Entries
--------------------- ---------------------
@ -16,6 +9,12 @@ stuff. If the command is open to all (or you want to implement your own
privilege checking in the command function), use None in place of the privilege checking in the command function), use None in place of the
permissions tuple. permissions tuple.
""" """
import commands.general
import commands.privileged
import commands.comsys
import commands.unloggedin
import commands.info
import commands.objmanip
# -- Unlogged-in Command Table -- # -- Unlogged-in Command Table --
# Command Name Command Function Privilege Tuple # Command Name Command Function Privilege Tuple

View file

@ -9,7 +9,7 @@ from django.conf import settings
import functions_general import functions_general
import functions_comsys import functions_comsys
import defines_global import defines_global
import ansi from src import ansi
def cmd_addcom(cdat): def cmd_addcom(cdat):
""" """

View file

@ -11,8 +11,8 @@ from apps.helpsys.models import HelpEntry
from apps.objects.models import Object from apps.objects.models import Object
import functions_general import functions_general
import defines_global import defines_global
import session_mgr from src import session_mgr
import ansi from src import ansi
def cmd_password(cdat): def cmd_password(cdat):
""" """

View file

@ -11,8 +11,10 @@ if not functions_general.host_os_is('nt'):
# Don't import the resource module if the host OS is Windows. # Don't import the resource module if the host OS is Windows.
import resource import resource
import django
from apps.objects.models import Object from apps.objects.models import Object
import scheduler from src import scheduler
import defines_global import defines_global
def cmd_version(cdat): def cmd_version(cdat):
@ -21,7 +23,8 @@ def cmd_version(cdat):
""" """
session = cdat['session'] session = cdat['session']
retval = "-"*50 +"\n\r" retval = "-"*50 +"\n\r"
retval += "Evennia %s\n\r" % (defines_global.EVENNIA_VERSION,) retval += " Evennia %s\n\r" % (defines_global.EVENNIA_VERSION,)
retval += " Django %s\n\r" % (django.get_version())
retval += "-"*50 retval += "-"*50
session.msg(retval) session.msg(retval)

View file

@ -2,9 +2,10 @@
These commands typically are to do with building or modifying Objects. These commands typically are to do with building or modifying Objects.
""" """
from apps.objects.models import Object from apps.objects.models import Object
# We'll import this as the full path to avoid local variable clashes.
import src.flags import src.flags
import ansi from src import ansi
import session_mgr from src import session_mgr
def cmd_teleport(cdat): def cmd_teleport(cdat):
""" """

View file

@ -1,7 +1,7 @@
from apps.objects.models import Object from apps.objects.models import Object
import defines_global import defines_global
import functions_general import functions_general
import ansi from src import ansi
""" """
This file contains commands that require special permissions to use. These This file contains commands that require special permissions to use. These

View file

@ -1,6 +1,6 @@
import time import time
from twisted.internet import task from twisted.internet import task
import events from src import events
""" """
This file contains the event scheduler system. This file contains the event scheduler system.

View file

@ -2,8 +2,7 @@
This will be the base object type/interface that all scripts are derived from by This will be the base object type/interface that all scripts are derived from by
default. It will have the necessary outline for developers to sub-class and override. default. It will have the necessary outline for developers to sub-class and override.
""" """
from src import ansi
import ansi
class BasicObject: class BasicObject:
def __init__(self, source_obj): def __init__(self, source_obj):

View file

@ -10,13 +10,12 @@ from django.db import connection
from django.conf import settings from django.conf import settings
from apps.config.models import CommandAlias, ConfigValue from apps.config.models import CommandAlias, ConfigValue
from session import SessionProtocol from src.session import SessionProtocol
import settings from src import scheduler
import scheduler
import functions_general import functions_general
import session_mgr from src import session_mgr
import cmdtable from src import cmdtable
import initial_setup from src import initial_setup
class EvenniaService(service.Service): class EvenniaService(service.Service):

View file

@ -11,6 +11,6 @@ mv -f $BASE_PATH/logs/evennia.log $BASE_PATH/logs/evennia.logs.old
## mode instead of having to uncomment crap. ## mode instead of having to uncomment crap.
## Interactive mode. Good for development and debugging. ## Interactive mode. Good for development and debugging.
twistd -n --logfile=logs/evennia.log --python=server.py twistd -n --logfile=logs/evennia.log --python=src/server.py
## Stand-alone mode. Good for running games. ## Stand-alone mode. Good for running games.
#twistd --logfile=logs/evennia.log --python=server.py #twistd --logfile=logs/evennia.log --python=src/server.py