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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue