Changed all src/ and ev references to evennia
This commit is contained in:
parent
3ff937a6fd
commit
ad3f19896c
118 changed files with 565 additions and 661 deletions
|
|
@ -145,7 +145,7 @@ class DefaultCmds(_EvContainer):
|
|||
"""
|
||||
This container holds direct shortcuts to all default commands in Evennia.
|
||||
|
||||
To access in code, do 'from ev import default_cmds' then
|
||||
To access in code, do 'from evennia import default_cmds' then
|
||||
access the properties on the imported default_cmds object.
|
||||
|
||||
"""
|
||||
|
|
@ -163,7 +163,7 @@ class DefaultCmds(_EvContainer):
|
|||
cmdlist = utils.variable_from_module(module, module.__all__)
|
||||
self.__dict__.update(dict([(c.__name__, c) for c in cmdlist]))
|
||||
|
||||
from src.commands.default import (admin, batchprocess,
|
||||
from commands.default import (admin, batchprocess,
|
||||
building, comms, general,
|
||||
player, help, system, unloggedin)
|
||||
add_cmds(admin)
|
||||
|
|
@ -195,11 +195,11 @@ class SystemCmds(_EvContainer):
|
|||
first command when a player connects to
|
||||
the server.
|
||||
|
||||
To access in code, do 'from ev import syscmdkeys' then
|
||||
To access in code, do 'from evennia import syscmdkeys' then
|
||||
access the properties on the imported syscmdkeys object.
|
||||
|
||||
"""
|
||||
from src.commands import cmdhandler
|
||||
from commands import cmdhandler
|
||||
CMD_NOINPUT = cmdhandler.CMD_NOINPUT
|
||||
CMD_NOMATCH = cmdhandler.CMD_NOMATCH
|
||||
CMD_MULTIMATCH = cmdhandler.CMD_MULTIMATCH
|
||||
|
|
|
|||
|
|
@ -2,13 +2,4 @@
|
|||
Makes it easier to import by grouping all relevant things already at this
|
||||
level.
|
||||
|
||||
You can henceforth import most things directly from src.comms
|
||||
Also, the initiated object manager is available as src.comms.msgmanager and
|
||||
src.comms.channelmanager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.comms.models import *
|
||||
|
||||
#msgmanager = Msg.objects
|
||||
#channelmanager = ChannelDB.objects
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
#
|
||||
|
||||
from django.contrib import admin
|
||||
from src.comms.models import ChannelDB
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
|
||||
|
||||
class ChannelAttributeInline(AttributeInline):
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ update() on the channelhandler. Or use Channel.objects.delete() which
|
|||
does this for you.
|
||||
|
||||
"""
|
||||
from src.comms.models import ChannelDB
|
||||
from src.commands import cmdset, command
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.commands import cmdset, command
|
||||
|
||||
|
||||
class ChannelCommand(command.Command):
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ Default Typeclass for Comms.
|
|||
|
||||
See objects.objects for more information on Typeclassing.
|
||||
"""
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from src.comms.models import Msg, TempMsg, ChannelDB
|
||||
from src.comms.managers import ChannelManager
|
||||
from src.utils import logger
|
||||
from src.utils.utils import make_iter
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.comms.models import Msg, TempMsg, ChannelDB
|
||||
from evennia.comms.managers import ChannelManager
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import make_iter
|
||||
|
||||
|
||||
class Channel(ChannelDB):
|
||||
|
|
@ -110,7 +110,7 @@ class Channel(ChannelDB):
|
|||
self.attributes.clear()
|
||||
self.aliases.clear()
|
||||
super(Channel, self).delete()
|
||||
from src.comms.channelhandler import CHANNELHANDLER
|
||||
from evennia.comms.channelhandler import CHANNELHANDLER
|
||||
CHANNELHANDLER.update()
|
||||
|
||||
def channel_prefix(self, msg=None, emit=False):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ These managers handles the
|
|||
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from src.typeclasses.managers import (TypedObjectManager, TypeclassManager,
|
||||
from evennia.typeclasses.managers import (TypedObjectManager, TypeclassManager,
|
||||
returns_typeclass_list, returns_typeclass)
|
||||
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -48,11 +48,11 @@ def identify_object(inp):
|
|||
# load global stores
|
||||
global _PlayerDB, _ObjectDB, _ChannelDB
|
||||
if not _PlayerDB:
|
||||
from src.players.models import PlayerDB as _PlayerDB
|
||||
from evennia.players.models import PlayerDB as _PlayerDB
|
||||
if not _ObjectDB:
|
||||
from src.objects.models import ObjectDB as _ObjectDB
|
||||
from evennia.objects.models import ObjectDB as _ObjectDB
|
||||
if not _ChannelDB:
|
||||
from src.comms.models import ChannelDB as _ChannelDB
|
||||
from evennia.comms.models import ChannelDB as _ChannelDB
|
||||
|
||||
if not inp:
|
||||
return inp, None
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ be able to delete connections on the fly).
|
|||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.comms import managers
|
||||
from src.comms.managers import identify_object
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import crop, make_iter, lazy_property
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.comms import managers
|
||||
from evennia.comms.managers import identify_object
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import crop, make_iter, lazy_property
|
||||
|
||||
__all__ = ("Msg", "TempMsg", "ChannelDB")
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ class ChannelDB(TypedObject):
|
|||
objects = managers.ChannelDBManager()
|
||||
|
||||
_typeclass_paths = settings.CHANNEL_TYPECLASS_PATHS
|
||||
_default_typeclass_path = settings.BASE_CHANNEL_TYPECLASS or "src.comms.comms.Channel"
|
||||
_default_typeclass_path = settings.BASE_CHANNEL_TYPECLASS or "evennia.comms.comms.Channel"
|
||||
|
||||
class Meta:
|
||||
"Define Django meta options"
|
||||
|
|
|
|||
|
|
@ -1,11 +1 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this level.
|
||||
|
||||
You can henceforth import most things directly from src.help
|
||||
Also, the initiated object manager is available as src.help.manager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.help.models import *
|
||||
#
|
||||
#manager = HelpEntry.objects
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ This defines how to edit help entries in Admin.
|
|||
"""
|
||||
from django import forms
|
||||
from django.contrib import admin
|
||||
from src.help.models import HelpEntry
|
||||
from evennia.help.models import HelpEntry
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Custom manager for HelpEntry objects.
|
||||
"""
|
||||
from django.db import models
|
||||
from src.utils import logger, utils
|
||||
from evennia.utils import logger, utils
|
||||
__all__ = ("HelpEntryManager",)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ game world, policy info, rules and similar.
|
|||
|
||||
"""
|
||||
from django.db import models
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.help.manager import HelpEntryManager
|
||||
from src.typeclasses.models import Tag, TagHandler
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import lazy_property
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.help.manager import HelpEntryManager
|
||||
from evennia.typeclasses.models import Tag, TagHandler
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import lazy_property
|
||||
__all__ = ("HelpEntry",)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ DefaultLock: Exits: controls who may traverse the exit to
|
|||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
_PERMISSION_HIERARCHY = [p.lower() for p in settings.PERMISSION_HIERARCHY]
|
||||
|
||||
|
||||
def _to_player(accessing_obj):
|
||||
"Helper function. Makes sure an accessing object is a player object"
|
||||
if utils.inherits_from(accessing_obj, "src.objects.objects.Object"):
|
||||
if utils.inherits_from(accessing_obj, "evennia.objects.objects.Object"):
|
||||
# an object. Convert to player.
|
||||
accessing_obj = accessing_obj.player
|
||||
return accessing_obj
|
||||
|
|
@ -158,7 +158,7 @@ def perm(accessing_obj, accessed_obj, *args, **kwargs):
|
|||
except (AttributeError, IndexError):
|
||||
return False
|
||||
|
||||
if utils.inherits_from(accessing_obj, "src.objects.objects.Object") and accessing_obj.player:
|
||||
if utils.inherits_from(accessing_obj, "evennia.objects.objects.Object") and accessing_obj.player:
|
||||
player = accessing_obj.player
|
||||
perms_player = [p.lower() for p in player.permissions.all()]
|
||||
is_quell = player.attributes.get("_quell")
|
||||
|
|
@ -503,7 +503,7 @@ def serversetting(accessing_obj, accessed_obj, *args, **kwargs):
|
|||
|
||||
Usage:
|
||||
serversetting(IRC_ENABLED)
|
||||
serversetting(BASE_SCRIPT_PATH, [game.gamesrc.scripts])
|
||||
serversetting(BASE_SCRIPT_PATH, ['types'])
|
||||
|
||||
A given True/False or integers will be converted properly.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ to any other identifier you can use.
|
|||
import re
|
||||
import inspect
|
||||
from django.conf import settings
|
||||
from src.utils import logger, utils
|
||||
from evennia.utils import logger, utils
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
__all__ = ("LockHandler", "LockException")
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ except ImportError:
|
|||
from django.test import TestCase
|
||||
|
||||
from django.conf import settings
|
||||
from src.locks import lockfuncs
|
||||
from src.utils import create
|
||||
from evennia.locks import lockfuncs
|
||||
from evennia.utils import create
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this level.
|
||||
|
||||
You can henceforth import most things directly from src.objects
|
||||
Also, the initiated object manager is available as src.objects.manager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.objects.objects import *
|
||||
#from src.objects.models import ObjectDB
|
||||
#manager = ObjectDB.objects
|
||||
|
|
@ -6,8 +6,8 @@
|
|||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.objects.models import ObjectDB
|
||||
|
||||
|
||||
class ObjectAttributeInline(AttributeInline):
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ from itertools import chain
|
|||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
from django.db.models.fields import exceptions
|
||||
from src.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from src.typeclasses.managers import returns_typeclass, returns_typeclass_list
|
||||
from src.utils import utils
|
||||
from src.utils.utils import to_unicode, is_iter, make_iter, string_partial_matching
|
||||
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from evennia.typeclasses.managers import returns_typeclass, returns_typeclass_list
|
||||
from evennia.utils import utils
|
||||
from evennia.utils.utils import to_unicode, is_iter, make_iter, string_partial_matching
|
||||
|
||||
__all__ = ("ObjectManager",)
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -124,7 +124,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
# We have to loop for safety since the referenced lookup gives deepcopy error if attribute value is an object.
|
||||
global _ATTR
|
||||
if not _ATTR:
|
||||
from src.typeclasses.models import Attribute as _ATTR
|
||||
from evennia.typeclasses.models import Attribute as _ATTR
|
||||
cands = list(self.filter(cand_restriction & type_restriction & Q(db_attributes__db_key=attribute_name)))
|
||||
results = [attr.objectdb_set.all() for attr in _ATTR.objects.filter(objectdb__in=cands, db_value=attribute_value)]
|
||||
return chain(*results)
|
||||
|
|
@ -164,7 +164,7 @@ class ObjectDBManager(TypedObjectManager):
|
|||
except exceptions.FieldError:
|
||||
return []
|
||||
except ValueError:
|
||||
from src.utils import logger
|
||||
from evennia.utils import logger
|
||||
logger.log_errmsg("The property '%s' does not support search criteria of the type %s." % (property_name, type(property_value)))
|
||||
return []
|
||||
|
||||
|
|
@ -374,8 +374,8 @@ class ObjectDBManager(TypedObjectManager):
|
|||
new_destination = original_object.destination
|
||||
|
||||
# create new object
|
||||
from src.utils import create
|
||||
from src.scripts.models import ScriptDB
|
||||
from evennia.utils import create
|
||||
from evennia.scripts.models import ScriptDB
|
||||
new_object = create.create_object(typeclass_path,
|
||||
key=new_key,
|
||||
location=new_location,
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ from django.db import models
|
|||
from django.conf import settings
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.objects.manager import ObjectDBManager
|
||||
from src.utils import logger
|
||||
from src.utils.utils import (make_iter, dbref)
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.objects.manager import ObjectDBManager
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import (make_iter, dbref)
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@ they control by simply linking to a new object's user property.
|
|||
import traceback
|
||||
from django.conf import settings
|
||||
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from src.typeclasses.attributes import NickHandler
|
||||
from src.objects.manager import ObjectManager
|
||||
from src.objects.models import ObjectDB
|
||||
from src.scripts.scripthandler import ScriptHandler
|
||||
from src.commands import cmdset, command
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
from src.commands import cmdhandler
|
||||
from src.utils.logger import log_depmsg, log_trace, log_errmsg
|
||||
from src.utils.utils import (variable_from_module, lazy_property,
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.typeclasses.attributes import NickHandler
|
||||
from evennia.objects.manager import ObjectManager
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.scripts.scripthandler import ScriptHandler
|
||||
from evennia.commands import cmdset, command
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.commands import cmdhandler
|
||||
from evennia.utils.logger import log_depmsg, log_trace, log_errmsg
|
||||
from evennia.utils.utils import (variable_from_module, lazy_property,
|
||||
make_iter, to_str, to_unicode)
|
||||
|
||||
MULTISESSION_MODE = settings.MULTISESSION_MODE
|
||||
|
|
@ -145,7 +145,7 @@ class DefaultObject(ObjectDB):
|
|||
cmdset - cmdset-handler. Use cmdset.add() to add new cmdsets to object
|
||||
nicks - nick-handler. New nicks with nicks.add().
|
||||
|
||||
* Helper methods (see src.objects.objects.py for full headers)
|
||||
* Helper methods (see evennia.objects.objects.py for full headers)
|
||||
|
||||
search(ostring, global_search=False, use_nicks=True,
|
||||
typeclass=None,
|
||||
|
|
@ -504,7 +504,7 @@ class DefaultObject(ObjectDB):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
|
||||
text = to_str(text, force_string=True) if text else ""
|
||||
|
||||
|
|
@ -772,7 +772,7 @@ class DefaultObject(ObjectDB):
|
|||
"""
|
||||
global _ScriptDB
|
||||
if not _ScriptDB:
|
||||
from src.scripts.models import ScriptDB as _ScriptDB
|
||||
from evennia.scripts.models import ScriptDB as _ScriptDB
|
||||
|
||||
if self.delete_iter > 0:
|
||||
# make sure to only call delete once on this object
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this
|
||||
level.
|
||||
|
||||
You can henceforth import most things directly from src.player
|
||||
Also, the initiated object manager is available as src.players.manager.
|
||||
|
||||
"""
|
||||
|
||||
#from src.players.player import *
|
||||
#from src.players.models import PlayerDB
|
||||
#
|
||||
#manager = PlayerDB.objects
|
||||
|
|
@ -8,9 +8,9 @@ from django.conf import settings
|
|||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from src.players.models import PlayerDB
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from src.utils import create
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.utils import create
|
||||
|
||||
|
||||
# handle the custom User editor
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ Player that are controlled by the server.
|
|||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from src.players.player import DefaultPlayer
|
||||
from src.scripts.scripts import Script
|
||||
from src.commands.command import Command
|
||||
from src.commands.cmdset import CmdSet
|
||||
from src.utils import search
|
||||
from evennia.players.player import DefaultPlayer
|
||||
from evennia.scripts.scripts import Script
|
||||
from evennia.commands.command import Command
|
||||
from evennia.commands.cmdset import CmdSet
|
||||
from evennia.utils import search
|
||||
|
||||
_IDLE_TIMEOUT = settings.IDLE_TIMEOUT
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ class BotStarter(Script):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
for session in _SESSIONS.sessions_from_player(self.player):
|
||||
session.update_session_counters(idle=True)
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ class IRCBot(Bot):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
|
||||
# if keywords are given, store (the BotStarter script
|
||||
# will not give any keywords, so this should normally only
|
||||
|
|
@ -186,7 +186,7 @@ class IRCBot(Bot):
|
|||
"channel": self.db.irc_channel ,
|
||||
"network": self.db.irc_network,
|
||||
"port": self.db.irc_port}
|
||||
_SESSIONS.start_bot_session("src.server.portal.irc.IRCBotFactory", configdict)
|
||||
_SESSIONS.start_bot_session("evennia.server.portal.irc.IRCBotFactory", configdict)
|
||||
|
||||
def msg(self, text=None, **kwargs):
|
||||
"""
|
||||
|
|
@ -229,7 +229,7 @@ class RSSBot(Bot):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
|
||||
if ev_channel:
|
||||
# connect to Evennia channel
|
||||
|
|
@ -247,7 +247,7 @@ class RSSBot(Bot):
|
|||
configdict = {"uid": self.dbid,
|
||||
"url": self.db.rss_url,
|
||||
"rate": self.db.rss_rate}
|
||||
_SESSIONS.start_bot_session("src.server.portal.rss.RSSBotFactory", configdict)
|
||||
_SESSIONS.start_bot_session("evennia.server.portal.rss.RSSBotFactory", configdict)
|
||||
|
||||
def execute_cmd(self, text=None, sessid=None):
|
||||
"""
|
||||
|
|
@ -277,7 +277,7 @@ class IMC2Bot(Bot):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
if ev_channel:
|
||||
# connect to Evennia channel
|
||||
channel = search.channel_search(ev_channel)
|
||||
|
|
@ -308,7 +308,7 @@ class IMC2Bot(Bot):
|
|||
"client_pwd": self.db.client_pwd,
|
||||
"server_pwd": self.db.server_pwd}
|
||||
|
||||
_SESSIONS.start_bot_session("src.server.portal.imc2.IMC2BotFactory", configdict)
|
||||
_SESSIONS.start_bot_session("evennia.server.portal.imc2.IMC2BotFactory", configdict)
|
||||
|
||||
def msg(self, text=None, **kwargs):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ The managers for the custom Player object and permissions.
|
|||
import datetime
|
||||
from django.contrib.auth.models import UserManager
|
||||
#from functools import update_wrapper
|
||||
from src.typeclasses.managers import (returns_typeclass_list, returns_typeclass,
|
||||
from evennia.typeclasses.managers import (returns_typeclass_list, returns_typeclass,
|
||||
TypedObjectManager, TypeclassManager)
|
||||
#from src.utils import logger
|
||||
#from evennia.utils import logger
|
||||
__all__ = ("PlayerManager",)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ from django.db import models
|
|||
from django.contrib.auth.models import AbstractUser
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from src.players.manager import PlayerDBManager
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.utils.utils import make_iter
|
||||
from evennia.players.manager import PlayerDBManager
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.utils.utils import make_iter
|
||||
|
||||
__all__ = ("PlayerDB",)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,19 +13,19 @@ instead for most things).
|
|||
|
||||
import datetime
|
||||
from django.conf import settings
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from src.players.manager import PlayerManager
|
||||
from src.players.models import PlayerDB
|
||||
from src.comms.models import ChannelDB
|
||||
from src.commands import cmdhandler
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.utils import logger
|
||||
from src.utils.utils import (lazy_property, to_str,
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.players.manager import PlayerManager
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.commands import cmdhandler
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import (lazy_property, to_str,
|
||||
make_iter, to_unicode,
|
||||
variable_from_module)
|
||||
from src.typeclasses.attributes import NickHandler
|
||||
from src.scripts.scripthandler import ScriptHandler
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.typeclasses.attributes import NickHandler
|
||||
from evennia.scripts.scripthandler import ScriptHandler
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
@ -135,14 +135,14 @@ class DefaultPlayer(PlayerDB):
|
|||
"""
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
return _SESSIONS.session_from_player(self, sessid)
|
||||
|
||||
def get_all_sessions(self):
|
||||
"Return all sessions connected to this player"
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
return _SESSIONS.sessions_from_player(self)
|
||||
sessions = property(get_all_sessions) # alias shortcut
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this
|
||||
level.
|
||||
|
||||
You can henceforth import most things directly from src.scripts
|
||||
Also, the initiated object manager is available as src.scripts.manager.
|
||||
|
||||
"""
|
||||
|
||||
# Note - we MUST NOT import src.scripts.scripts here, or
|
||||
# proxy models will fall under Django migrations.
|
||||
#from src.scripts.scripts import *
|
||||
#from src.scripts.models import ScriptDB
|
||||
|
||||
#manager = ScriptDB.objects
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
# This sets up how models are displayed
|
||||
# in the web admin interface.
|
||||
#
|
||||
from src.typeclasses.admin import AttributeInline, TagInline
|
||||
from evennia.typeclasses.admin import AttributeInline, TagInline
|
||||
|
||||
from src.scripts.models import ScriptDB
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ The custom manager for Scripts.
|
|||
"""
|
||||
|
||||
from django.db.models import Q
|
||||
from src.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from src.typeclasses.managers import returns_typeclass_list
|
||||
from src.utils.utils import make_iter
|
||||
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
from evennia.typeclasses.managers import returns_typeclass_list
|
||||
from evennia.utils.utils import make_iter
|
||||
__all__ = ("ScriptManager",)
|
||||
_GA = object.__getattribute__
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ class ScriptDBManager(TypedObjectManager):
|
|||
new_obj = new_obj if new_obj is not None else original_script.obj
|
||||
new_locks = new_locks if new_locks is not None else original_script.db_lock_storage
|
||||
|
||||
from src.utils import create
|
||||
from evennia.utils import create
|
||||
new_script = create.create_script(typeclass, key=new_key, obj=new_obj,
|
||||
locks=new_locks, autostart=True)
|
||||
return new_script
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ Common examples of uses of Scripts:
|
|||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.scripts.manager import ScriptDBManager
|
||||
from src.utils.utils import dbref, to_str
|
||||
from evennia.typeclasses.models import TypedObject
|
||||
from evennia.scripts.manager import ScriptDBManager
|
||||
from evennia.utils.utils import dbref, to_str
|
||||
|
||||
__all__ = ("ScriptDB",)
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -132,7 +132,7 @@ class ScriptDB(TypedObject):
|
|||
except AttributeError:
|
||||
pass
|
||||
if isinstance(value, (basestring, int)):
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
value = to_str(value, force_string=True)
|
||||
if (value.isdigit() or value.startswith("#")):
|
||||
dbid = dbref(value, reqhash=False)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ An scripthandler is automatically added to all game objects. You
|
|||
access it through the property 'scripts' on the game object.
|
||||
"""
|
||||
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.utils import create
|
||||
from src.utils import logger
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.utils import create
|
||||
from evennia.utils import logger
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ It also defines a few common scripts.
|
|||
from twisted.internet.defer import Deferred, maybeDeferred
|
||||
from twisted.internet.task import LoopingCall
|
||||
from django.conf import settings
|
||||
from src.typeclasses.models import TypeclassBase
|
||||
from django.utils.translation import ugettext as _
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.scripts.manager import ScriptManager
|
||||
from src.comms import channelhandler
|
||||
from src.utils import logger
|
||||
from evennia.typeclasses.models import TypeclassBase
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.scripts.manager import ScriptManager
|
||||
from evennia.comms import channelhandler
|
||||
from evennia.utils import logger
|
||||
|
||||
__all__ = ["Script", "DoNothing", "CheckSessions",
|
||||
"ValidateScripts", "ValidateChannelHandler"]
|
||||
|
|
@ -555,7 +555,7 @@ class CheckSessions(Script):
|
|||
"called every 60 seconds"
|
||||
global _SESSIONS
|
||||
if not _SESSIONS:
|
||||
from src.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||
#print "session check!"
|
||||
#print "ValidateSessions run"
|
||||
_SESSIONS.validate_sessions()
|
||||
|
|
@ -576,7 +576,7 @@ class ValidateIdmapperCache(Script):
|
|||
"Called every ~5 mins"
|
||||
global _FLUSH_CACHE
|
||||
if not _FLUSH_CACHE:
|
||||
from src.utils.idmapper.base import conditional_flush as _FLUSH_CACHE
|
||||
from evennia.utils.idmapper.base import conditional_flush as _FLUSH_CACHE
|
||||
_FLUSH_CACHE(_IDMAPPER_CACHE_MAX_MEMORY)
|
||||
|
||||
class ValidateScripts(Script):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ server reloads and be started automaticall on boot.
|
|||
|
||||
Example:
|
||||
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
|
||||
# tick myobj every 15 seconds
|
||||
TICKER_HANDLER.add(myobj, 15)
|
||||
|
|
@ -49,10 +49,10 @@ call the handler's save() and restore() methods when the server reboots.
|
|||
|
||||
"""
|
||||
from twisted.internet.defer import inlineCallbacks
|
||||
from src.scripts.scripts import ExtendedLoopingCall
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.logger import log_trace
|
||||
from src.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
from evennia.scripts.scripts import ExtendedLoopingCall
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.logger import log_trace
|
||||
from evennia.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
|
||||
_GA = object.__getattribute__
|
||||
_SA = object.__setattr__
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
"""
|
||||
Makes it easier to import by grouping all relevant things already at this level.
|
||||
|
||||
You can henceforth import most things directly from src.server
|
||||
Also, the initiated object manager is available as src.server.manager.
|
||||
|
||||
"""
|
||||
|
||||
from src.server.models import *
|
||||
manager = ServerConfig.objects
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
|
||||
from django.contrib import admin
|
||||
from src.server.models import ServerConfig
|
||||
from evennia.server.models import ServerConfig
|
||||
|
||||
|
||||
class ServerConfigAdmin(admin.ModelAdmin):
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ except ImportError:
|
|||
from twisted.protocols import amp
|
||||
from twisted.internet import protocol
|
||||
from twisted.internet.defer import Deferred
|
||||
from src.utils.utils import to_str, variable_from_module
|
||||
from evennia.utils.utils import to_str, variable_from_module
|
||||
|
||||
# communication bits
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import os
|
|||
import threading
|
||||
from collections import defaultdict
|
||||
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.utils import uses_database, to_str, get_evennia_pids
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.utils import uses_database, to_str, get_evennia_pids
|
||||
|
||||
_GA = object.__getattribute__
|
||||
_SA = object.__setattr__
|
||||
|
|
@ -79,7 +79,7 @@ def hashid(obj, suffix=""):
|
|||
# Cache callback handlers
|
||||
#------------------------------------------------------------
|
||||
|
||||
# callback to field pre_save signal (connected in src.server.server)
|
||||
# callback to field pre_save signal (connected in evennia.server.server)
|
||||
#def field_pre_save(sender, instance=None, update_fields=None, raw=False, **kwargs):
|
||||
# """
|
||||
# Called at the beginning of the field save operation. The save method
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@ Everything starts at handle_setup()
|
|||
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.utils.translation import ugettext as _
|
||||
from src.players.models import PlayerDB
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils import create
|
||||
from src.utils.utils import class_from_module
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils import create
|
||||
|
||||
def create_config_values():
|
||||
"""
|
||||
|
|
@ -151,7 +149,7 @@ def create_system_scripts():
|
|||
Setup the system repeat scripts. They are automatically started
|
||||
by the create_script function.
|
||||
"""
|
||||
from src.scripts import scripts
|
||||
from evennia.scripts import scripts
|
||||
|
||||
print " Creating and starting global scripts ..."
|
||||
|
||||
|
|
@ -176,7 +174,7 @@ def start_game_time():
|
|||
(the uptime can also be found directly from the server though).
|
||||
"""
|
||||
print " Starting in-game time ..."
|
||||
from src.utils import gametime
|
||||
from evennia.utils import gametime
|
||||
gametime.init_gametime()
|
||||
|
||||
|
||||
|
|
@ -206,7 +204,7 @@ def reset_server():
|
|||
ones, particularly it cleans all caches for the special objects.
|
||||
It also checks so the warm-reset mechanism works as it should.
|
||||
"""
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
print " Initial setup complete. Restarting Server once."
|
||||
SESSIONS.server.shutdown(mode='reset')
|
||||
|
||||
|
|
@ -250,15 +248,15 @@ def handle_setup(last_step):
|
|||
setup_func()
|
||||
except Exception:
|
||||
if last_step + num == 2:
|
||||
from src.players.models import PlayerDB
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
|
||||
for obj in ObjectDB.objects.all():
|
||||
obj.delete()
|
||||
for profile in PlayerDB.objects.all():
|
||||
profile.delete()
|
||||
elif last_step + num == 3:
|
||||
from src.comms.models import ChannelDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
ChannelDB.objects.all().delete()
|
||||
raise
|
||||
ServerConfig.objects.conf("last_initial_setup_step", last_step + num + 1)
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ except ImportError:
|
|||
import pickle
|
||||
|
||||
from django.db import models
|
||||
from src.utils.idmapper.models import WeakSharedMemoryModel
|
||||
from src.utils import logger, utils
|
||||
from src.server.manager import ServerConfigManager
|
||||
from evennia.utils.idmapper.models import WeakSharedMemoryModel
|
||||
from evennia.utils import logger, utils
|
||||
from evennia.server.manager import ServerConfigManager
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -37,14 +37,12 @@ messages.
|
|||
from inspect import isfunction
|
||||
from twisted.internet.defer import inlineCallbacks
|
||||
from django.conf import settings
|
||||
from src.server.models import ServerConfig
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
#from src.scripts.scripts import Script
|
||||
#from src.utils.create import create_script
|
||||
from src.scripts.tickerhandler import Ticker, TickerPool, TickerHandler
|
||||
from src.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
from src.utils import logger
|
||||
from src.utils.utils import all_from_module, make_iter, to_str
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
from evennia.scripts.tickerhandler import Ticker, TickerPool, TickerHandler
|
||||
from evennia.utils.dbserialize import dbserialize, dbunserialize, pack_dbobj, unpack_dbobj
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import all_from_module, make_iter, to_str
|
||||
|
||||
_SA = object.__setattr__
|
||||
_GA = object.__getattribute__
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ from twisted.application import internet
|
|||
from twisted.internet import protocol
|
||||
from twisted.conch import telnet
|
||||
|
||||
from src.server.session import Session
|
||||
from src.utils import logger, utils
|
||||
from src.server.portal.imc2lib import imc2_ansi
|
||||
from src.server.portal.imc2lib import imc2_packets as pck
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils import logger, utils
|
||||
from evennia.server.portal.imc2lib import imc2_ansi
|
||||
from evennia.server.portal.imc2lib import imc2_packets as pck
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ class IMC2Bot(telnet.StatefulTelnetProtocol, Session):
|
|||
class IMC2BotFactory(protocol.ReconnectingClientFactory):
|
||||
"""
|
||||
Creates instances of the IMC2Protocol. Should really only ever
|
||||
need to create one connection. Tied in via src/server.py.
|
||||
need to create one connection. Tied in via evennia/server.py.
|
||||
"""
|
||||
initialDelay = 1
|
||||
factor = 1.5
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ This is a IMC2 complacent version.
|
|||
"""
|
||||
|
||||
import re
|
||||
from src.utils import ansi
|
||||
from evennia.utils import ansi
|
||||
|
||||
|
||||
class IMCANSIParser(ansi.ANSIParser):
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ more Evennia channels.
|
|||
from twisted.application import internet
|
||||
from twisted.words.protocols import irc
|
||||
from twisted.internet import protocol
|
||||
from src.server.session import Session
|
||||
from src.utils import logger
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils import logger
|
||||
|
||||
|
||||
# IRC bot
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ etc.
|
|||
|
||||
"""
|
||||
import re
|
||||
from src.utils.utils import to_str
|
||||
from evennia.utils.utils import to_str
|
||||
|
||||
# MSDP-relevant telnet cmd/opt-codes
|
||||
MSDP = chr(69)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ active players and so on.
|
|||
|
||||
"""
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
MSSP = chr(70)
|
||||
MSSP_VAR = chr(1)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ it when the size changes
|
|||
|
||||
"""
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
|
||||
NAWS = chr(31)
|
||||
IS = chr(0)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ if os.name == 'nt':
|
|||
# For Windows batchfile we need an extra path insertion here.
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
|
||||
os.path.dirname(os.path.abspath(__file__))))))
|
||||
from src.server.webserver import EvenniaReverseProxyResource
|
||||
from evennia.server.webserver import EvenniaReverseProxyResource
|
||||
from twisted.application import internet, service
|
||||
from twisted.internet import protocol, reactor
|
||||
from twisted.web import server
|
||||
|
|
@ -23,8 +23,8 @@ import django
|
|||
django.setup()
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from src.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
||||
from evennia.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from evennia.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
||||
|
||||
PORTAL_SERVICES_PLUGIN_MODULES = [mod_import(module) for module in make_iter(settings.PORTAL_SERVICES_PLUGIN_MODULES)]
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ if AMP_ENABLED:
|
|||
# the portal and the mud server. Only reason to ever deactivate
|
||||
# it would be during testing and debugging.
|
||||
|
||||
from src.server import amp
|
||||
from evennia.server import amp
|
||||
|
||||
print ' amp (to Server): %s' % AMP_PORT
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ if TELNET_ENABLED:
|
|||
|
||||
# Start telnet game connections
|
||||
|
||||
from src.server.portal import telnet
|
||||
from evennia.server.portal import telnet
|
||||
|
||||
for interface in TELNET_INTERFACES:
|
||||
ifacestr = ""
|
||||
|
|
@ -203,7 +203,7 @@ if SSL_ENABLED:
|
|||
|
||||
# Start SSL game connection (requires PyOpenSSL).
|
||||
|
||||
from src.server.portal import ssl
|
||||
from evennia.server.portal import ssl
|
||||
|
||||
for interface in SSL_INTERFACES:
|
||||
ifacestr = ""
|
||||
|
|
@ -229,7 +229,7 @@ if SSH_ENABLED:
|
|||
# Start SSH game connections. Will create a keypair in
|
||||
# evennia/game if necessary.
|
||||
|
||||
from src.server.portal import ssh
|
||||
from evennia.server.portal import ssh
|
||||
|
||||
for interface in SSH_INTERFACES:
|
||||
ifacestr = ""
|
||||
|
|
@ -262,7 +262,7 @@ if WEBSERVER_ENABLED:
|
|||
webclientstr = ""
|
||||
if WEBCLIENT_ENABLED:
|
||||
# create ajax client processes at /webclientdata
|
||||
from src.server.portal.webclient import WebClient
|
||||
from evennia.server.portal.webclient import WebClient
|
||||
|
||||
webclient = WebClient()
|
||||
webclient.sessionhandler = PORTAL_SESSIONS
|
||||
|
|
@ -272,8 +272,8 @@ if WEBSERVER_ENABLED:
|
|||
if WEBSOCKET_CLIENT_ENABLED and not websocket_started:
|
||||
# start websocket client port for the webclient
|
||||
# we only support one websocket client
|
||||
from src.server.portal import websocket_client
|
||||
from src.utils.txws import WebSocketFactory
|
||||
from evennia.server.portal import websocket_client
|
||||
from evennia.utils.txws import WebSocketFactory
|
||||
|
||||
interface = WEBSOCKET_CLIENT_INTERFACE
|
||||
port = WEBSOCKET_CLIENT_PORT
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Sessionhandler for portal sessions
|
||||
"""
|
||||
import time
|
||||
from src.server.sessionhandler import SessionHandler, PCONN, PDISCONN, PSYNC, PCONNSYNC
|
||||
from evennia.server.sessionhandler import SessionHandler, PCONN, PDISCONN, PSYNC, PCONNSYNC
|
||||
|
||||
_MOD_IMPORT = None
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
|
||||
protocol_path - full python path to the class factory
|
||||
for the protocol used, eg
|
||||
'src.server.portal.irc.IRCClientFactory'
|
||||
'evennia.server.portal.irc.IRCClientFactory'
|
||||
config - dictionary of configuration options, fed as **kwarg
|
||||
to protocol class' __init__ method.
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ class PortalSessionHandler(SessionHandler):
|
|||
"""
|
||||
global _MOD_IMPORT
|
||||
if not _MOD_IMPORT:
|
||||
from src.utils.utils import variable_from_module as _MOD_IMPORT
|
||||
from evennia.utils.utils import variable_from_module as _MOD_IMPORT
|
||||
path, clsname = protocol_path.rsplit(".", 1)
|
||||
cls = _MOD_IMPORT(path, clsname)
|
||||
if not cls:
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ to the channel whenever the feed updates.
|
|||
|
||||
from twisted.internet import task, threads
|
||||
from django.conf import settings
|
||||
from src.server.session import Session
|
||||
from src.utils import logger
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils import logger
|
||||
|
||||
RSS_ENABLED = settings.RSS_ENABLED
|
||||
#RETAG = re.compile(r'<[^>]*?>')
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ from twisted.internet import defer
|
|||
from twisted.conch import interfaces as iconch
|
||||
from twisted.python import components
|
||||
from django.conf import settings
|
||||
from src.server import session
|
||||
from src.players.models import PlayerDB
|
||||
from src.utils import ansi, utils
|
||||
from evennia.server import session
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.utils import ansi, utils
|
||||
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
||||
|
|
@ -343,4 +343,4 @@ def makeFactory(configdict):
|
|||
|
||||
factory.portal.registerChecker(PlayerDBPasswordChecker(factory))
|
||||
|
||||
return factory
|
||||
return factory
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ except ImportError:
|
|||
print " SSL_ENABLED requires PyOpenSSL."
|
||||
sys.exit(5)
|
||||
|
||||
from src.server.portal.telnet import TelnetProtocol
|
||||
from evennia.server.portal.telnet import TelnetProtocol
|
||||
|
||||
|
||||
class SSLProtocol(TelnetProtocol):
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ sessions etc.
|
|||
|
||||
import re
|
||||
from twisted.conch.telnet import Telnet, StatefulTelnetProtocol, IAC, LINEMODE, GA, WILL, WONT, ECHO
|
||||
from src.server.session import Session
|
||||
from src.server.portal import ttype, mssp, msdp, naws
|
||||
from src.server.portal.mccp import Mccp, mccp_compress, MCCP
|
||||
from src.server.portal.mxp import Mxp, mxp_parse
|
||||
from src.utils import utils, ansi, logger
|
||||
from evennia.server.session import Session
|
||||
from evennia.server.portal import ttype, mssp, msdp, naws
|
||||
from evennia.server.portal.mccp import Mccp, mccp_compress, MCCP
|
||||
from evennia.server.portal.mxp import Mxp, mxp_parse
|
||||
from evennia.utils import utils, ansi, logger
|
||||
|
||||
_RE_N = re.compile(r"\{n$")
|
||||
_RE_LEND = re.compile(r"\n$|\r$", re.MULTILINE)
|
||||
|
|
@ -58,7 +58,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
self.sessionhandler.connect(self)
|
||||
|
||||
# timeout the handshakes in case the client doesn't reply at all
|
||||
from src.utils.utils import delay
|
||||
from evennia.utils.utils import delay
|
||||
delay(2, callback=self.handshake_done, retval=True)
|
||||
|
||||
def handshake_done(self, force=False):
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ from twisted.web import server, resource
|
|||
from django.utils.functional import Promise
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.conf import settings
|
||||
from src.utils import utils, logger
|
||||
from src.utils.text2html import parse_html
|
||||
from src.server import session
|
||||
from evennia.utils import utils, logger
|
||||
from evennia.utils.text2html import parse_html
|
||||
from evennia.server import session
|
||||
|
||||
SERVERNAME = settings.SERVERNAME
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Websocket-webclient
|
|||
|
||||
This implements a webclient with WebSockets (http://en.wikipedia.org/wiki/WebSocket)
|
||||
by use of the txws implementation (https://github.com/MostAwesomeDude/txWS). It is
|
||||
used together with src/web/media/javascript/evennia_websocket_webclient.js.
|
||||
used together with evennia/web/media/javascript/evennia_websocket_webclient.js.
|
||||
|
||||
Thanks to Ricard Pillosu whose Evennia plugin inspired this module.
|
||||
|
||||
|
|
@ -29,10 +29,10 @@ Example of call from a javascript client:
|
|||
"""
|
||||
import json
|
||||
from twisted.internet.protocol import Protocol
|
||||
from src.server.session import Session
|
||||
from src.utils.logger import log_trace
|
||||
from src.utils.utils import to_str, make_iter
|
||||
from src.utils.text2html import parse_html
|
||||
from evennia.server.session import Session
|
||||
from evennia.utils.logger import log_trace
|
||||
from evennia.utils.utils import to_str, make_iter
|
||||
from evennia.utils.text2html import parse_html
|
||||
|
||||
|
||||
class WebSocketClient(Protocol, Session):
|
||||
|
|
|
|||
|
|
@ -23,23 +23,23 @@ django.setup()
|
|||
from django.db import connection
|
||||
from django.conf import settings
|
||||
|
||||
from src.players.models import PlayerDB
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.server.models import ServerConfig
|
||||
from src.server import initial_setup
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.scripts.models import ScriptDB
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.server import initial_setup
|
||||
|
||||
from src.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from src.comms import channelhandler
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
from evennia.utils.utils import get_evennia_version, mod_import, make_iter
|
||||
from evennia.comms import channelhandler
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
|
||||
# setting up server-side field cache
|
||||
|
||||
from django.db.models.signals import post_save
|
||||
from src.server.caches import field_post_save
|
||||
from evennia.server.caches import field_post_save
|
||||
#pre_save.connect(field_pre_save, dispatch_uid="fieldcache")
|
||||
post_save.connect(field_post_save, dispatch_uid="fieldcache")
|
||||
|
||||
#from src.server.caches import post_attr_update
|
||||
#from evennia.server.caches import post_attr_update
|
||||
#from django.db.models.signals import m2m_changed
|
||||
|
||||
# connect to attribute cache signal
|
||||
|
|
@ -169,9 +169,9 @@ class Evennia(object):
|
|||
if len(mismatches): # can't use any() since mismatches may be [0] which reads as False for any()
|
||||
# we have a changed default. Import relevant objects and
|
||||
# run the update
|
||||
from src.objects.models import ObjectDB
|
||||
from src.comms.models import ChannelDB
|
||||
#from src.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
#from evennia.players.models import PlayerDB
|
||||
for i, prev, curr in ((i, tup[0], tup[1]) for i, tup in enumerate(settings_compare) if i in mismatches):
|
||||
# update the database
|
||||
print " %s:\n '%s' changed to '%s'. Updating unchanged entries in database ..." % (settings_names[i], prev, curr)
|
||||
|
|
@ -225,8 +225,8 @@ class Evennia(object):
|
|||
"""
|
||||
Called every server start
|
||||
"""
|
||||
from src.objects.models import ObjectDB
|
||||
#from src.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
#from evennia.players.models import PlayerDB
|
||||
|
||||
#update eventual changed defaults
|
||||
self.update_defaults()
|
||||
|
|
@ -238,10 +238,10 @@ class Evennia(object):
|
|||
with open(SERVER_RESTART, 'r') as f:
|
||||
mode = f.read()
|
||||
if mode in ('True', 'reload'):
|
||||
from src.server.oobhandler import OOB_HANDLER
|
||||
from evennia.server.oobhandler import OOB_HANDLER
|
||||
OOB_HANDLER.restore()
|
||||
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
TICKER_HANDLER.restore()
|
||||
|
||||
# call correct server hook based on start file value
|
||||
|
|
@ -299,9 +299,9 @@ class Evennia(object):
|
|||
mode = self.set_restart_mode(mode)
|
||||
# call shutdown hooks on all cached objects
|
||||
|
||||
from src.objects.models import ObjectDB
|
||||
#from src.players.models import PlayerDB
|
||||
from src.server.models import ServerConfig
|
||||
from evennia.objects.models import ObjectDB
|
||||
#from evennia.players.models import PlayerDB
|
||||
from evennia.server.models import ServerConfig
|
||||
|
||||
if mode == 'reload':
|
||||
# call restart hooks
|
||||
|
|
@ -312,9 +312,9 @@ class Evennia(object):
|
|||
yield self.sessions.all_sessions_portal_sync()
|
||||
ServerConfig.objects.conf("server_restart_mode", "reload")
|
||||
|
||||
from src.server.oobhandler import OOB_HANDLER
|
||||
from evennia.server.oobhandler import OOB_HANDLER
|
||||
OOB_HANDLER.save()
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
TICKER_HANDLER.save()
|
||||
|
||||
self.at_server_reload_stop()
|
||||
|
|
@ -337,7 +337,7 @@ class Evennia(object):
|
|||
self.at_server_cold_stop()
|
||||
|
||||
# stopping time
|
||||
from src.utils import gametime
|
||||
from evennia.utils import gametime
|
||||
gametime.save()
|
||||
|
||||
self.at_server_stop()
|
||||
|
|
@ -439,7 +439,7 @@ if AMP_ENABLED:
|
|||
ifacestr = "-%s" % AMP_INTERFACE
|
||||
print ' amp (to Portal)%s: %s' % (ifacestr, AMP_PORT)
|
||||
|
||||
from src.server import amp
|
||||
from evennia.server import amp
|
||||
|
||||
factory = amp.AmpServerFactory(EVENNIA)
|
||||
amp_service = internet.TCPServer(AMP_PORT, factory, interface=AMP_INTERFACE)
|
||||
|
|
@ -451,7 +451,7 @@ if WEBSERVER_ENABLED:
|
|||
# Start a django-compatible webserver.
|
||||
|
||||
from twisted.python import threadpool
|
||||
from src.server.webserver import DjangoWebRoot, WSGIWebServer
|
||||
from evennia.server.webserver import DjangoWebRoot, WSGIWebServer
|
||||
|
||||
# start a thread pool and define the root url (/) as a wsgi resource
|
||||
# recognized by Django
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ are stored on the Portal side)
|
|||
import time
|
||||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
#from src.scripts.models import ScriptDB
|
||||
from src.comms.models import ChannelDB
|
||||
from src.utils import logger, utils
|
||||
from src.utils.inlinefunc import parse_inlinefunc
|
||||
from src.utils.utils import make_iter
|
||||
from src.commands.cmdhandler import cmdhandler
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
from src.server.session import Session
|
||||
#from evennia.scripts.models import ScriptDB
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.utils import logger, utils
|
||||
from evennia.utils.inlinefunc import parse_inlinefunc
|
||||
from evennia.utils.utils import make_iter
|
||||
from evennia.commands.cmdhandler import cmdhandler
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.server.session import Session
|
||||
|
||||
IDLE_COMMAND = settings.IDLE_COMMAND
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -72,7 +72,7 @@ class ServerSession(Session):
|
|||
"""
|
||||
global _ObjectDB
|
||||
if not _ObjectDB:
|
||||
from src.objects.models import ObjectDB as _ObjectDB
|
||||
from evennia.objects.models import ObjectDB as _ObjectDB
|
||||
|
||||
if not self.logged_in:
|
||||
# assign the unloggedin-command set.
|
||||
|
|
@ -222,7 +222,7 @@ class ServerSession(Session):
|
|||
# handle oob instructions
|
||||
global _OOB_HANDLER
|
||||
if not _OOB_HANDLER:
|
||||
from src.server.oobhandler import OOB_HANDLER as _OOB_HANDLER
|
||||
from evennia.server.oobhandler import OOB_HANDLER as _OOB_HANDLER
|
||||
oobstruct = self.sessionhandler.oobstruct_parser(kwargs.pop("oob", None))
|
||||
#print "session.data_in: oobstruct:",oobstruct
|
||||
for (funcname, args, kwargs) in oobstruct:
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ There are two similar but separate stores of sessions:
|
|||
|
||||
import time
|
||||
from django.conf import settings
|
||||
from src.commands.cmdhandler import CMD_LOGINSTART
|
||||
from src.utils.utils import variable_from_module, is_iter, \
|
||||
from evennia.commands.cmdhandler import CMD_LOGINSTART
|
||||
from evennia.utils.utils import variable_from_module, is_iter, \
|
||||
to_str, to_unicode, strip_control_sequences
|
||||
try:
|
||||
import cPickle as pickle
|
||||
|
|
@ -57,11 +57,11 @@ def delayed_import():
|
|||
modulename, classname = settings.SERVER_SESSION_CLASS.rsplit(".", 1)
|
||||
_ServerSession = variable_from_module(modulename, classname)
|
||||
if not _PlayerDB:
|
||||
from src.players.models import PlayerDB as _PlayerDB
|
||||
from evennia.players.models import PlayerDB as _PlayerDB
|
||||
if not _ServerConfig:
|
||||
from src.server.models import ServerConfig as _ServerConfig
|
||||
from evennia.server.models import ServerConfig as _ServerConfig
|
||||
if not _ScriptDB:
|
||||
from src.scripts.models import ScriptDB as _ScriptDB
|
||||
from evennia.scripts.models import ScriptDB as _ScriptDB
|
||||
# including once to avoid warnings in Python syntax checkers
|
||||
_ServerSession, _PlayerDB, _ServerConfig, _ScriptDB
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ class ServerSessionHandler(SessionHandler):
|
|||
This method allows the server-side to force the Portal to create
|
||||
a new bot session using the protocol specified by protocol_path,
|
||||
which should be the full python path to the class, including the
|
||||
class name, like "src.server.portal.irc.IRCClient".
|
||||
class name, like "evennia.server.portal.irc.IRCClient".
|
||||
The new session will use the supplied player-bot uid to
|
||||
initiate an already logged-in connection. The Portal will
|
||||
treat this as a normal connection and henceforth so will the
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ except ImportError:
|
|||
|
||||
from django.conf import settings
|
||||
from django.test.simple import DjangoTestSuiteRunner
|
||||
from src.utils.utils import mod_import
|
||||
from evennia.utils.utils import mod_import
|
||||
|
||||
|
||||
class EvenniaTestSuiteRunner(DjangoTestSuiteRunner):
|
||||
"""
|
||||
This test runner only runs tests on the apps specified in src/ and game/ to
|
||||
This test runner only runs tests on the apps specified in evennia/ and game/ to
|
||||
avoid running the large number of tests defined by Django
|
||||
"""
|
||||
def build_suite(self, test_labels, extra_tests=None, **kwargs):
|
||||
|
|
@ -45,7 +45,7 @@ class EvenniaTestSuiteRunner(DjangoTestSuiteRunner):
|
|||
"""
|
||||
if not test_labels:
|
||||
test_labels = [applabel.rsplit('.', 1)[1] for applabel in settings.INSTALLED_APPS
|
||||
if (applabel.startswith('src.') or applabel.startswith('game.'))]
|
||||
if (applabel.startswith('evennia.') or applabel.startswith('game.'))]
|
||||
return super(EvenniaTestSuiteRunner, self).build_suite(test_labels, extra_tests=extra_tests, **kwargs)
|
||||
|
||||
|
||||
|
|
@ -54,9 +54,9 @@ def suite():
|
|||
This function is called automatically by the django test runner.
|
||||
This also collates tests from packages that are not formally django applications.
|
||||
"""
|
||||
from src.locks import tests as locktests
|
||||
from src.utils import tests as utiltests
|
||||
from src.commands.default import tests as commandtests
|
||||
from evennia.locks import tests as locktests
|
||||
from evennia.utils import tests as utiltests
|
||||
from evennia.commands.default import tests as commandtests
|
||||
|
||||
tsuite = unittest.TestSuite()
|
||||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]))
|
||||
|
|
@ -66,11 +66,11 @@ def suite():
|
|||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(locktests))
|
||||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(utiltests))
|
||||
|
||||
for path in glob.glob("../src/tests/test_*.py"):
|
||||
for path in glob.glob("../evennia/tests/test_*.py"):
|
||||
testmod = mod_import(path)
|
||||
tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(testmod))
|
||||
|
||||
#from src.tests import test_commands_cmdhandler
|
||||
#from evennia.tests import test_commands_cmdhandler
|
||||
#tsuite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_commands_cmdhandler))
|
||||
|
||||
return tsuite
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ WEBSOCKET_INTERFACES = ['0.0.0.0']
|
|||
EVENNIA_ADMIN = True
|
||||
# The path to the root directory
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
# Path to the src directory containing the bulk of the codebase's code.
|
||||
# Path to the lib directory containing the bulk of the codebase's code.
|
||||
EVENNIA_DIR = os.path.join(ROOT_DIR, 'evennia')
|
||||
# Path to the game directory (containing the database file if using sqlite).
|
||||
GAME_DIR = os.path.join(ROOT_DIR, 'game_template')
|
||||
|
|
@ -198,7 +198,7 @@ DATABASES = {
|
|||
######################################################################
|
||||
# Plugin modules extend Evennia in various ways. In the cases with no
|
||||
# existing default, there are examples of many of these modules
|
||||
# in game/gamesrc/conf/examples.
|
||||
# in contrib/examples.
|
||||
|
||||
# The command parser module to use. See the default module for which
|
||||
# functions it must implement
|
||||
|
|
@ -238,11 +238,11 @@ PORTAL_SERVICES_PLUGIN_MODULES = ["server.conf.portal_services_plugins"]
|
|||
MSSP_META_MODULE = ""
|
||||
# Tuple of modules implementing lock functions. All callable functions
|
||||
# inside these modules will be available as lock functions.
|
||||
LOCK_FUNC_MODULES = ("src.locks.lockfuncs", "server.conf.lockfuncs",)
|
||||
LOCK_FUNC_MODULES = ("evennia.locks.lockfuncs", "server.conf.lockfuncs",)
|
||||
# Module holding OOB (Out of Band) hook objects. This allows for customization
|
||||
# and expansion of which hooks OOB protocols are allowed to call on the server
|
||||
# protocols for attaching tracker hooks for when various object field change
|
||||
OOB_PLUGIN_MODULES = ["src.server.oob_cmds", "server.conf.oob_cmds"]
|
||||
OOB_PLUGIN_MODULES = ["evennia.server.oob_cmds", "server.conf.oob_cmds"]
|
||||
|
||||
######################################################################
|
||||
# Default command sets
|
||||
|
|
@ -251,11 +251,7 @@ OOB_PLUGIN_MODULES = ["src.server.oob_cmds", "server.conf.oob_cmds"]
|
|||
# stored anywhere in the databse), changing these paths will only affect
|
||||
# NEW created characters/objects, not those already in play. So if you plan to
|
||||
# change this, it's recommended you do it before having created a lot of objects
|
||||
# (or simply reset the database after the change for simplicity). Remember
|
||||
# that you should never edit things in src/. Instead copy out the examples
|
||||
# in game/gamesrc/commands/examples up one level and re-point these settings
|
||||
# to point to these copies instead - these you can then change as you please
|
||||
# (or copy/paste from the default modules in src/ if you prefer).
|
||||
# (or simply reset the database after the change for simplicity).
|
||||
|
||||
# Command set used on session before player has logged in
|
||||
CMDSET_UNLOGGEDIN = "commands.default_cmdsets.UnloggedinCmdSet"
|
||||
|
|
@ -273,7 +269,7 @@ CMDSET_PATHS = ["commands"]
|
|||
######################################################################
|
||||
|
||||
# Server-side session class used. #TODO
|
||||
SERVER_SESSION_CLASS = "src.server.serversession.ServerSession"
|
||||
SERVER_SESSION_CLASS = "server.serversession.ServerSession"
|
||||
|
||||
# Base paths for typeclassed object classes. These paths must be
|
||||
# defined relative evennia's root directory. They will be searched in
|
||||
|
|
@ -328,7 +324,7 @@ BASE_BATCHPROCESS_PATHS = ['world', 'contrib']
|
|||
######################################################################
|
||||
|
||||
# You don't actually have to use this, but it affects the routines in
|
||||
# src.utils.gametime.py and allows for a convenient measure to
|
||||
# evennia.utils.gametime.py and allows for a convenient measure to
|
||||
# determine the current in-game time. You can of course interpret
|
||||
# "week", "month" etc as your own in-game time units as desired.
|
||||
|
||||
|
|
@ -498,7 +494,7 @@ ADMINS = () #'Your Name', 'your_email@domain.com'),)
|
|||
MANAGERS = ADMINS
|
||||
# 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")
|
||||
MEDIA_ROOT = os.path.join(GAME_DIR, "web", "media")
|
||||
# It's safe to dis-regard this, as it's a Django feature we only half use as a
|
||||
# dependency, not actually what it's primarily meant for.
|
||||
SITE_ID = 1
|
||||
|
|
@ -539,11 +535,11 @@ MEDIA_URL = '/media/'
|
|||
# STATIC_URL/admin.
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
STATIC_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "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, "gamesrc", "web", "static_overrides"),
|
||||
os.path.join(GAME_DIR, "web", "static_overrides"),
|
||||
os.path.join(EVENNIA_DIR, "web", "static"),)
|
||||
# Patterns of files in the static directories. Used here to make sure that
|
||||
# its readme file is preserved but unused.
|
||||
|
|
@ -553,7 +549,7 @@ STATICFILES_IGNORE_PATTERNS = ('README.md',)
|
|||
ACTIVE_TEMPLATE = 'prosimii'
|
||||
# We setup the location of the website template as well as the admin site.
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(GAME_DIR, "gamesrc", "web", "template_overrides"),
|
||||
os.path.join(GAME_DIR, "web", "template_overrides"),
|
||||
os.path.join(EVENNIA_DIR, "web", "templates", ACTIVE_TEMPLATE),
|
||||
os.path.join(EVENNIA_DIR, "web", "templates"),)
|
||||
# List of callables that know how to import templates from various sources.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# this is an optimized version only available in later Django versions
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
from src.scripts.models import ScriptDB, ObjectDoesNotExist
|
||||
from src.utils.create import create_script
|
||||
from src.scripts import DoNothing
|
||||
from evennia.scripts.models import ScriptDB, ObjectDoesNotExist
|
||||
from evennia.utils.create import create_script
|
||||
from evennia.scripts import DoNothing
|
||||
import unittest
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# test with game/manage.py test
|
||||
import unittest
|
||||
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
class TestIsIter(unittest.TestCase):
|
||||
def test_is_iter(self):
|
||||
|
|
@ -33,13 +33,13 @@ class TestDedent(unittest.TestCase):
|
|||
self.assertEqual("TestDedent", utils.dedent(" TestDedent"))
|
||||
# Leading whitespace, multi line
|
||||
input_string = " hello\n world"
|
||||
expected_string = "hello\nworld"
|
||||
self.assertEqual(expected_string, utils.dedent(input_string))
|
||||
expected_string = "hello\nworld"
|
||||
self.assertEqual(expected_string, utils.dedent(input_string))
|
||||
|
||||
class TestListToString(unittest.TestCase):
|
||||
"""
|
||||
Default function header from utils.py:
|
||||
list_to_string(inlist, endsep="and", addquote=False)
|
||||
Default function header from utils.py:
|
||||
list_to_string(inlist, endsep="and", addquote=False)
|
||||
|
||||
Examples:
|
||||
no endsep:
|
||||
|
|
@ -55,7 +55,7 @@ class TestListToString(unittest.TestCase):
|
|||
self.assertEqual('"1", "2", "3"', utils.list_to_string([1,2,3], endsep="", addquote=True))
|
||||
self.assertEqual('1, 2 and 3', utils.list_to_string([1,2,3]))
|
||||
self.assertEqual('"1", "2" and "3"', utils.list_to_string([1,2,3], endsep="and", addquote=True))
|
||||
|
||||
|
||||
|
||||
class TestWildcardToRegexp(unittest.TestCase):
|
||||
def test_wildcard_to_regexp(self):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from django.contrib import admin
|
||||
from django.contrib.admin import ModelAdmin
|
||||
from django.core.urlresolvers import reverse
|
||||
from src.typeclasses.models import Attribute, Tag
|
||||
from evennia.typeclasses.models import Attribute, Tag
|
||||
|
||||
|
||||
class TagAdmin(admin.ModelAdmin):
|
||||
|
|
@ -65,4 +65,4 @@ class AttributeAdmin(ModelAdmin):
|
|||
return []
|
||||
|
||||
admin.site.register(Attribute, AttributeAdmin)
|
||||
admin.site.register(Tag, TagAdmin)
|
||||
admin.site.register(Tag, TagAdmin)
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ from django.db import models
|
|||
from django.conf import settings
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.utils.dbserialize import to_pickle, from_pickle
|
||||
from src.utils.picklefield import PickledObjectField
|
||||
from src.utils.utils import lazy_property, to_str, make_iter
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.utils.dbserialize import to_pickle, from_pickle
|
||||
from evennia.utils.picklefield import PickledObjectField
|
||||
from evennia.utils.utils import lazy_property, to_str, make_iter
|
||||
|
||||
_TYPECLASS_AGGRESSIVE_CACHE = settings.TYPECLASS_AGGRESSIVE_CACHE
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ all Attributes and TypedObjects).
|
|||
"""
|
||||
from functools import update_wrapper
|
||||
from django.db.models import Q
|
||||
from src.utils import idmapper
|
||||
from src.utils.utils import make_iter, variable_from_module
|
||||
from evennia.utils import idmapper
|
||||
from evennia.utils.utils import make_iter, variable_from_module
|
||||
|
||||
__all__ = ("TypedObjectManager", )
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -160,7 +160,7 @@ class TypedObjectManager(idmapper.manager.SharedMemoryManager):
|
|||
# create a new tag
|
||||
global _Tag
|
||||
if not _Tag:
|
||||
from src.typeclasses.models import Tag as _Tag
|
||||
from evennia.typeclasses.models import Tag as _Tag
|
||||
tag = _Tag.objects.create(
|
||||
db_key=key.strip().lower() if key is not None else None,
|
||||
db_category=category.strip().lower() if category and key is not None else None,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import src.utils.picklefield
|
||||
import evennia.utils.picklefield
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
@ -16,7 +16,7 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('db_key', models.CharField(max_length=255, verbose_name=b'key', db_index=True)),
|
||||
('db_value', src.utils.picklefield.PickledObjectField(help_text=b'The data returned when the attribute is accessed. Must be written as a Python literal if editing through the admin interface. Attribute values which are not Python literals cannot be edited through the admin interface.', null=True, verbose_name=b'value')),
|
||||
('db_value', evennia.utils.picklefield.PickledObjectField(help_text=b'The data returned when the attribute is accessed. Must be written as a Python literal if editing through the admin interface. Attribute values which are not Python literals cannot be edited through the admin interface.', null=True, verbose_name=b'value')),
|
||||
('db_strvalue', models.TextField(help_text=b'String-specific storage for quick look-up', null=True, verbose_name=b'strvalue', blank=True)),
|
||||
('db_category', models.CharField(max_length=128, blank=True, help_text=b'Optional categorization of attribute.', null=True, verbose_name=b'category', db_index=True)),
|
||||
('db_lock_storage', models.TextField(help_text=b'Lockstrings for this object are stored here.', verbose_name=b'locks', blank=True)),
|
||||
|
|
|
|||
|
|
@ -33,22 +33,22 @@ from django.core.exceptions import ObjectDoesNotExist
|
|||
from django.conf import settings
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
from src.typeclasses.attributes import Attribute, AttributeHandler, NAttributeHandler
|
||||
from src.typeclasses.tags import Tag, TagHandler, AliasHandler, PermissionHandler
|
||||
from evennia.typeclasses.attributes import Attribute, AttributeHandler, NAttributeHandler
|
||||
from evennia.typeclasses.tags import Tag, TagHandler, AliasHandler, PermissionHandler
|
||||
|
||||
from src.utils.idmapper.models import SharedMemoryModel
|
||||
from src.utils.idmapper.base import SharedMemoryModelBase
|
||||
from src.server.caches import get_prop_cache, set_prop_cache
|
||||
#from src.server.caches import set_attr_cache
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.utils.idmapper.base import SharedMemoryModelBase
|
||||
from evennia.server.caches import get_prop_cache, set_prop_cache
|
||||
#from evennia.server.caches import set_attr_cache
|
||||
|
||||
#from src.server.caches import call_ndb_hooks
|
||||
#from src.server.models import ServerConfig
|
||||
from src.typeclasses import managers
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import (
|
||||
#from evennia.server.caches import call_ndb_hooks
|
||||
#from evennia.server.models import ServerConfig
|
||||
from evennia.typeclasses import managers
|
||||
from evennia.locks.lockhandler import LockHandler
|
||||
from evennia.utils.utils import (
|
||||
is_iter, inherits_from, lazy_property,
|
||||
class_from_module)
|
||||
from src.typeclasses.django_new_patch import patched_new
|
||||
from evennia.typeclasses.django_new_patch import patched_new
|
||||
|
||||
__all__ = ("Attribute", "TypeNick", "TypedObject")
|
||||
|
||||
|
|
@ -367,7 +367,7 @@ class TypedObject(SharedMemoryModel):
|
|||
# if we get to this point, the class is ok.
|
||||
|
||||
|
||||
if inherits_from(self, "src.scripts.models.ScriptDB"):
|
||||
if inherits_from(self, "evennia.scripts.models.ScriptDB"):
|
||||
if self.interval > 0:
|
||||
raise RuntimeError("Cannot use swap_typeclass on time-dependent " \
|
||||
"Script '%s'.\nStop and start a new Script of the " \
|
||||
|
|
@ -448,7 +448,7 @@ class TypedObject(SharedMemoryModel):
|
|||
"Cleaning up handlers on the typeclass level"
|
||||
global TICKER_HANDLER
|
||||
if not TICKER_HANDLER:
|
||||
from src.scripts.tickerhandler import TICKER_HANDLER
|
||||
from evennia.scripts.tickerhandler import TICKER_HANDLER
|
||||
TICKER_HANDLER.remove(self) # removes objects' all ticker subscriptions
|
||||
self.permissions.clear()
|
||||
self.attributes.clear()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ contains the respective handlers.
|
|||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from src.utils.utils import to_str, make_iter
|
||||
from evennia.utils.utils import to_str, make_iter
|
||||
|
||||
|
||||
_TYPECLASS_AGGRESSIVE_CACHE = settings.TYPECLASS_AGGRESSIVE_CACHE
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ user.
|
|||
|
||||
"""
|
||||
import re
|
||||
from src.utils import utils
|
||||
from src.utils.utils import to_str, to_unicode
|
||||
from evennia.utils import utils
|
||||
from evennia.utils.utils import to_str, to_unicode
|
||||
|
||||
# ANSI definitions
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ It seems the bottom of the box is a bit loose.
|
|||
# close the @drop command since it's the end of the file)
|
||||
-------------------------
|
||||
|
||||
An example batch file is game/gamesrc/commands/examples/batch_example.ev.
|
||||
An example batch file is contribs/examples/batch_example.ev.
|
||||
|
||||
|
||||
==========================================================================
|
||||
|
|
@ -144,8 +144,8 @@ Example batch.py file
|
|||
|
||||
import traceback
|
||||
from django.config import settings
|
||||
from src.utils import create
|
||||
from game.gamesrc.typeclasses import basetypes
|
||||
from evennia.utils import create
|
||||
from types import basetypes
|
||||
|
||||
GOLD = 10
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ import traceback
|
|||
import sys
|
||||
#from traceback import format_exc
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
#from game import settings as settings_module
|
||||
|
||||
ENCODINGS = settings.ENCODINGS
|
||||
|
|
@ -199,7 +199,7 @@ def read_batchfile(pythonpath, file_ending='.py'):
|
|||
"""
|
||||
|
||||
# open the file
|
||||
if pythonpath and not (pythonpath.startswith('src.') or pythonpath.startswith('game.')
|
||||
if pythonpath and not (pythonpath.startswith('evennia.') or pythonpath.startswith('game.')
|
||||
or pythonpath.startswith('contrib.')):
|
||||
abspaths = []
|
||||
for basepath in settings.BASE_BATCHPROCESS_PATHS:
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ Models covered:
|
|||
from django.conf import settings
|
||||
from django.db import IntegrityError
|
||||
from django.utils import timezone
|
||||
from src.utils import logger
|
||||
from src.utils.utils import make_iter, class_from_module, dbid_to_obj
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import make_iter, class_from_module, dbid_to_obj
|
||||
|
||||
# delayed imports
|
||||
_User = None
|
||||
|
|
@ -73,7 +73,7 @@ def create_object(typeclass=None, key=None, location=None,
|
|||
"""
|
||||
global _ObjectDB
|
||||
if not _ObjectDB:
|
||||
from src.objects.models import ObjectDB as _ObjectDB
|
||||
from evennia.objects.models import ObjectDB as _ObjectDB
|
||||
|
||||
|
||||
typeclass = typeclass if typeclass else settings.BASE_OBJECT_TYPECLASS
|
||||
|
|
@ -138,7 +138,7 @@ def create_script(typeclass, key=None, obj=None, player=None, locks=None,
|
|||
same key to all scripts of the same type). Set obj
|
||||
to tie this script to a particular object.
|
||||
|
||||
See src.scripts.manager for methods to manipulate existing
|
||||
See evennia.scripts.manager for methods to manipulate existing
|
||||
scripts in the database.
|
||||
|
||||
report_to is an obtional object to receive error messages.
|
||||
|
|
@ -148,7 +148,7 @@ def create_script(typeclass, key=None, obj=None, player=None, locks=None,
|
|||
"""
|
||||
global _ScriptDB
|
||||
if not _ScriptDB:
|
||||
from src.scripts.models import ScriptDB as _ScriptDB
|
||||
from evennia.scripts.models import ScriptDB as _ScriptDB
|
||||
|
||||
typeclass = typeclass if typeclass else settings.BASE_SCRIPT_TYPECLASS
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ def create_help_entry(key, entrytext, category="General", locks=None):
|
|||
"""
|
||||
global _HelpEntry
|
||||
if not _HelpEntry:
|
||||
from src.help.models import HelpEntry as _HelpEntry
|
||||
from evennia.help.models import HelpEntry as _HelpEntry
|
||||
|
||||
try:
|
||||
new_help = _HelpEntry()
|
||||
|
|
@ -250,7 +250,7 @@ def create_message(senderobj, message, channels=None,
|
|||
"""
|
||||
global _Msg
|
||||
if not _Msg:
|
||||
from src.comms.models import Msg as _Msg
|
||||
from evennia.comms.models import Msg as _Msg
|
||||
if not message:
|
||||
# we don't allow empty messages.
|
||||
return
|
||||
|
|
@ -342,7 +342,7 @@ def create_player(key, email, password,
|
|||
"""
|
||||
global _PlayerDB
|
||||
if not _PlayerDB:
|
||||
from src.players.models import PlayerDB as _PlayerDB
|
||||
from evennia.players.models import PlayerDB as _PlayerDB
|
||||
|
||||
typeclass = typeclass if typeclass else settings.BASE_PLAYER_TYPECLASS
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ except ImportError:
|
|||
from django.db import transaction
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from src.server.models import ServerConfig
|
||||
from src.utils.utils import to_str, uses_database
|
||||
from src.utils import logger
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.utils import to_str, uses_database
|
||||
from evennievenniautils import logger
|
||||
|
||||
__all__ = ("to_pickle", "from_pickle", "do_pickle", "do_unpickle")
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ os.environ["DJANGO_SETTINGS_MODULE"] = "game.settings"
|
|||
# del settings2
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
HELPTEXT = """
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ if __name__ == '__main__':
|
|||
action_modpath = settings.DUMMYRUNNER_ACTIONS_MODULE
|
||||
except AttributeError:
|
||||
# use default
|
||||
action_modpath = "src.utils.dummyrunner.dummyrunner_actions"
|
||||
action_modpath = "evennia.utils.dummyrunner.dummyrunner_actions"
|
||||
actions = utils.variable_from_module(action_modpath, "ACTIONS")
|
||||
|
||||
print "Connecting %i dummy client(s) to port %i using a %i second timestep ... " % (nclients, port, timestep)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import time
|
|||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'game.settings'
|
||||
import ev
|
||||
from src.utils.idmapper import base as _idmapper
|
||||
from evennia.utils.idmapper import base as _idmapper
|
||||
|
||||
LOGFILE = "logs/memoryusage.log"
|
||||
INTERVAL = 30 # log every 30 seconds
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ if __name__ == "__main__":
|
|||
|
||||
setup_string = \
|
||||
"""
|
||||
from src.objects.models import ObjectDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
g = ObjectDB.objects.get(db_key="Griatch")
|
||||
"""
|
||||
exec_string = \
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ form will raise an error.
|
|||
|
||||
import re
|
||||
import copy
|
||||
from src.utils.evtable import EvCell, EvTable
|
||||
from src.utils.utils import all_from_module, to_str, to_unicode
|
||||
from src.utils.ansi import ANSIString
|
||||
from evennia.utils.evtable import EvCell, EvTable
|
||||
from evennia.utils.utils import all_from_module, to_str, to_unicode
|
||||
from evennia.utils.ansi import ANSIString
|
||||
|
||||
# non-valid form-identifying characters (which can thus be
|
||||
# used as separators between forms without being detected
|
||||
|
|
@ -410,7 +410,7 @@ class EvForm(object):
|
|||
|
||||
def _test():
|
||||
"test evform"
|
||||
form = EvForm("src.utils.evform_test")
|
||||
form = EvForm("evennia.utils.evform_test")
|
||||
|
||||
# add data to each tagged form cell
|
||||
form.map(cells={1: "{gTom the Bouncer{n",
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ eventual colour outside
|
|||
#from textwrap import wrap
|
||||
from textwrap import TextWrapper
|
||||
from copy import deepcopy, copy
|
||||
from src.utils.utils import to_unicode
|
||||
from src.utils.ansi import ANSIString
|
||||
from evennia.utils.utils import to_unicode
|
||||
from evennia.utils.ansi import ANSIString
|
||||
|
||||
def make_iter(obj):
|
||||
"Makes sure that the object is always iterable."
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ total runtime of the server and the current uptime.
|
|||
|
||||
from time import time
|
||||
from django.conf import settings
|
||||
from src.scripts.scripts import Script
|
||||
from src.utils.create import create_script
|
||||
from evennia.scripts.scripts import Script
|
||||
from evennia.utils.create import create_script
|
||||
|
||||
GAMETIME_SCRIPT_NAME = "sys_game_time"
|
||||
|
||||
|
|
@ -75,12 +75,12 @@ class GameTime(Script):
|
|||
|
||||
def save():
|
||||
"Force save of time. This is called by server when shutting down/reloading."
|
||||
from src.scripts.models import ScriptDB
|
||||
from evennia.scripts.models import ScriptDB
|
||||
try:
|
||||
script = ScriptDB.objects.get(db_key=GAMETIME_SCRIPT_NAME)
|
||||
script.at_repeat()
|
||||
except Exception:
|
||||
from src.utils import logger
|
||||
from evennia.utils import logger
|
||||
logger.log_trace()
|
||||
|
||||
def _format(seconds, *divisors) :
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ from twisted.internet.reactor import callFromThread
|
|||
from django.core.exceptions import ObjectDoesNotExist, FieldError
|
||||
from django.db.models.base import Model, ModelBase
|
||||
from django.db.models.signals import post_save, pre_delete, post_syncdb
|
||||
from src.utils import logger
|
||||
from src.utils.utils import dbref, get_evennia_pids, to_str
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import dbref, get_evennia_pids, to_str
|
||||
|
||||
from manager import SharedMemoryManager
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ should be returned. The inlinefunc should never cause a traceback.
|
|||
|
||||
import re
|
||||
from django.conf import settings
|
||||
from src.utils import utils
|
||||
from evennia.utils import utils
|
||||
|
||||
|
||||
# inline functions
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ from django.forms import CharField, Textarea
|
|||
from django.forms.util import flatatt
|
||||
from django.utils.html import format_html
|
||||
|
||||
from src.utils.dbserialize import from_pickle, to_pickle
|
||||
from evennia.utils.dbserialize import from_pickle, to_pickle
|
||||
|
||||
try:
|
||||
from django.utils.encoding import force_text
|
||||
|
|
@ -276,4 +276,4 @@ try:
|
|||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
add_introspection_rules([], [r"^src\.utils\.picklefield\.PickledObjectField"])
|
||||
add_introspection_rules([], [r"^evennia\.utils\.picklefield\.PickledObjectField"])
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import textwrap
|
|||
import itertools
|
||||
import unicodedata
|
||||
|
||||
from src.utils.ansi import parse_ansi
|
||||
from evennia.utils.ansi import parse_ansi
|
||||
|
||||
py3k = sys.version_info[0] >= 3
|
||||
if py3k:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ search methods for the various database tables.
|
|||
|
||||
It is intended to be used e.g. as
|
||||
|
||||
> from src.utils import search
|
||||
> from evennia.utils import search
|
||||
> match = search.objects(...)
|
||||
|
||||
Note that this is not intended to be a complete listing of all search
|
||||
|
|
@ -17,9 +17,9 @@ Also remember that all commands in this file return lists (also if
|
|||
there is only one match) unless noted otherwise.
|
||||
|
||||
Example: To reach the search method 'get_object_with_player'
|
||||
in src/objects/managers.py:
|
||||
in evennia/objects/managers.py:
|
||||
|
||||
> from src.objects.models import ObjectDB
|
||||
> from evennia.objects.models import ObjectDB
|
||||
> match = Object.objects.get_object_with_player(...)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ The main function is spawn(*prototype), where the prototype
|
|||
is a dictionary like this:
|
||||
|
||||
GOBLIN = {
|
||||
"typeclass": "game.gamesrc.objects.objects.Monster",
|
||||
"typeclass": "types.objects.Monster",
|
||||
"key": "goblin grunt",
|
||||
"health": lambda: randint(20,30),
|
||||
"resists": ["cold", "poison"],
|
||||
|
|
@ -75,8 +75,8 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'game.settings'
|
|||
|
||||
from django.conf import settings
|
||||
from random import randint
|
||||
from src.objects.models import ObjectDB
|
||||
from src.utils.utils import make_iter, all_from_module, dbid_to_obj
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.utils.utils import make_iter, all_from_module, dbid_to_obj
|
||||
|
||||
_CREATE_OBJECT_KWARGS = ("key", "location", "home", "destination")
|
||||
|
||||
|
|
|
|||
|
|
@ -118,4 +118,4 @@ class ANSIStringTestCase(TestCase):
|
|||
"""
|
||||
target = ANSIString('{gtest{n')
|
||||
result = u'\x1b[1m\x1b[32mTest\x1b[0m'
|
||||
self.checker(target.capitalize(), result, u'Test')
|
||||
self.checker(target.capitalize(), result, u'Test')
|
||||
|
|
|
|||
|
|
@ -316,8 +316,8 @@ def get_evennia_version():
|
|||
|
||||
def pypath_to_realpath(python_path, file_ending='.py'):
|
||||
"""
|
||||
Converts a path on dot python form (e.g. 'src.objects.models') to
|
||||
a system path ($BASE_PATH/src/objects/models.py). Calculates all
|
||||
Converts a path on dot python form (e.g. 'evennia.objects.models') to
|
||||
a system path ($BASE_PATH/evennia/objects/models.py). Calculates all
|
||||
paths as absoulte paths starting from the evennia main directory.
|
||||
|
||||
Since it seems to be a common mistake to include the file ending
|
||||
|
|
@ -523,7 +523,7 @@ def server_services():
|
|||
since services are launced in memory, this function will
|
||||
only return any results if called from inside the game.
|
||||
"""
|
||||
from src.server.sessionhandler import SESSIONS
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
if hasattr(SESSIONS, "server") and hasattr(SESSIONS.server, "services"):
|
||||
server = SESSIONS.server.services.namedServices
|
||||
else:
|
||||
|
|
@ -577,9 +577,9 @@ def clean_object_caches(obj):
|
|||
"""
|
||||
global _TYPECLASSMODELS, _OBJECTMODELS
|
||||
if not _TYPECLASSMODELS:
|
||||
from src.typeclasses import models as _TYPECLASSMODELS
|
||||
from evennia.typeclasses import models as _TYPECLASSMODELS
|
||||
#if not _OBJECTMODELS:
|
||||
# from src.objects import models as _OBJECTMODELS
|
||||
# from evennia.objects import models as _OBJECTMODELS
|
||||
|
||||
#print "recaching:", obj
|
||||
if not obj:
|
||||
|
|
@ -751,8 +751,8 @@ def mod_import(module):
|
|||
|
||||
Args:
|
||||
module - this can be either a Python path (dot-notation like
|
||||
src.objects.models), an absolute path
|
||||
(e.g. /home/eve/evennia/src/objects.models.py)
|
||||
evennia.objects.models), an absolute path
|
||||
(e.g. /home/eve/evennia/evennia/objects.models.py)
|
||||
or an already import module object (e.g. models)
|
||||
Returns:
|
||||
an imported module. If the input argument was already a model,
|
||||
|
|
@ -1067,7 +1067,7 @@ def string_partial_matching(alternatives, inp, ret_index=True):
|
|||
|
||||
def format_table(table, extra_space=1):
|
||||
"""
|
||||
Note: src.utils.prettytable is more powerful than this, but this
|
||||
Note: evennia.utils.prettytable is more powerful than this, but this
|
||||
function can be useful when the number of columns and rows are
|
||||
unknown and must be calculated on the fly.
|
||||
|
||||
|
|
@ -1202,5 +1202,5 @@ def strip_control_sequences(string):
|
|||
"""
|
||||
global _STRIP_ANSI
|
||||
if not _STRIP_ANSI:
|
||||
from src.utils.ansi import strip_raw_ansi as _STRIP_ANSI
|
||||
from evennia.utils.ansi import strip_raw_ansi as _STRIP_ANSI
|
||||
return _RE_CONTROL_CHAR.sub('', _STRIP_ANSI(string))
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ urlpatterns = [
|
|||
url(r'^accounts/logout', 'django.contrib.auth.views.logout', name="logout"),
|
||||
|
||||
# Page place-holder for things that aren't implemented yet.
|
||||
url(r'^tbi/', 'src.web.views.to_be_implemented', name='to_be_implemented'),
|
||||
url(r'^tbi/', 'evennia.web.views.to_be_implemented', name='to_be_implemented'),
|
||||
|
||||
# Admin interface
|
||||
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
|
|
@ -39,19 +39,19 @@ urlpatterns = [
|
|||
url(r'^favicon\.ico$', RedirectView.as_view(url='/media/images/favicon.ico')),
|
||||
|
||||
# ajax stuff
|
||||
url(r'^webclient/', include('src.web.webclient.urls', namespace='webclient', app_name='webclient')),
|
||||
url(r'^webclient/', include('evennia.web.webclient.urls', namespace='webclient', app_name='webclient')),
|
||||
|
||||
# Front page
|
||||
url(r'^$', 'src.web.views.page_index', name="index"),
|
||||
url(r'^$', 'evennia.web.views.page_index', name="index"),
|
||||
|
||||
# Django original admin page. Make this URL is always available, whether
|
||||
# we've chosen to use Evennia's custom admin or not.
|
||||
url(r'django_admin/', 'src.web.views.admin_wrapper', name="django_admin")]
|
||||
url(r'django_admin/', 'evennia.web.views.admin_wrapper', name="django_admin")]
|
||||
|
||||
if settings.EVENNIA_ADMIN:
|
||||
urlpatterns += [
|
||||
# Our override for the admin.
|
||||
url('^admin/$', 'src.web.views.evennia_admin', name="evennia_admin"),
|
||||
url('^admin/$', 'evennia.web.views.evennia_admin', name="evennia_admin"),
|
||||
|
||||
# Makes sure that other admin pages get loaded.
|
||||
url(r'^admin/', include(admin.site.urls))]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
|
||||
from django.conf import settings
|
||||
from src.utils.utils import get_evennia_version
|
||||
from evennia.utils.utils import get_evennia_version
|
||||
|
||||
# Determine the site name and server version
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ from django.conf import settings
|
|||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.shortcuts import render
|
||||
|
||||
from src.objects.models import ObjectDB
|
||||
from src.players.models import PlayerDB
|
||||
from evennia.objects.models import ObjectDB
|
||||
from evennia.players.models import PlayerDB
|
||||
|
||||
_BASE_CHAR_TYPECLASS = settings.BASE_CHARACTER_TYPECLASS
|
||||
|
||||
|
|
@ -81,4 +81,4 @@ def admin_wrapper(request):
|
|||
"""
|
||||
Wrapper that allows us to properly use the base Django admin site, if needed.
|
||||
"""
|
||||
return staff_member_required(site.index)(request)
|
||||
return staff_member_required(site.index)(request)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Evennia ajax webclient (javascript component)
|
|||
The client is composed of several parts:
|
||||
templates/webclient.html - the main page
|
||||
webclient/views.py - the django view serving the template (based on urls.py pattern)
|
||||
src/server/webclient.py - the server component receiving requests from the client
|
||||
evennia/server/webclient.py - the server component receiving requests from the client
|
||||
this file - the javascript component handling dynamic ajax content
|
||||
|
||||
This implements an ajax mud client for use with Evennia, using jQuery
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Evennia websocket webclient (javascript component)
|
||||
|
||||
The client is composed of two parts:
|
||||
src/server/portal/websocket_client.py - the portal-side component
|
||||
/server/portal/websocket_client.py - the portal-side component
|
||||
this file - the javascript component handling dynamic content
|
||||
|
||||
messages sent to the client is one of two modes:
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@ webpage 'application'.
|
|||
from django.conf.urls import *
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', 'src.web.webclient.views.webclient', name="index")]
|
||||
url(r'^$', 'evennia.web.webclient.views.webclient', name="index")]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ page and serve it eventual static content.
|
|||
"""
|
||||
from django.shortcuts import render
|
||||
|
||||
from src.players.models import PlayerDB
|
||||
from evennia.players.models import PlayerDB
|
||||
|
||||
|
||||
def webclient(request):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue