Fix references to contrib and ev. Allows Ampoule tests to run. They're severely broken, however.

This commit is contained in:
Jonathan Piacenti 2015-02-22 18:24:54 -06:00 committed by Griatch
parent c03bac5efd
commit 65adb0982b
18 changed files with 80 additions and 51 deletions

View file

@ -136,7 +136,7 @@ class CmdPy(MuxCommand):
inherits_from(obj, parent) : check object inheritance inherits_from(obj, parent) : check object inheritance
You can explore The evennia API from inside the game by calling You can explore The evennia API from inside the game by calling
ev.help(), ev.managers.help() etc. evennia.help(), evennia.managers.help() etc.
{rNote: In the wrong hands this command is a severe security risk. {rNote: In the wrong hands this command is a severe security risk.
It should only be accessible by trusted server admins/superusers.{n It should only be accessible by trusted server admins/superusers.{n

View file

@ -121,7 +121,7 @@ class MsgManager(models.Manager):
get_messages_by_receiver get_messages_by_receiver
get_messages_by_channel get_messages_by_channel
text_search text_search
message_search (equivalent to ev.search_messages) message_search (equivalent to evennia.search_messages)
""" """
def identify_object(self, obj): def identify_object(self, obj):
@ -256,7 +256,7 @@ class ChannelDBManager(TypedObjectManager):
get_all_channels get_all_channels
get_channel(channel) get_channel(channel)
get_subscriptions(player) get_subscriptions(player)
channel_search (equivalent to ev.search_channel) channel_search (equivalent to evennia.search_channel)
""" """
@returns_typeclass_list @returns_typeclass_list

View file

@ -33,7 +33,7 @@ from evennia import Command, CmdSet
from evennia import syscmdkeys from evennia import syscmdkeys
from evennia.server.models import ServerConfig from evennia.server.models import ServerConfig
from contrib.menusystem import MenuNode, MenuTree from evennia.contrib.menusystem import MenuNode, MenuTree
CMD_LOGINSTART = syscmdkeys.CMD_LOGINSTART CMD_LOGINSTART = syscmdkeys.CMD_LOGINSTART
CMD_NOINPUT = syscmdkeys.CMD_NOINPUT CMD_NOINPUT = syscmdkeys.CMD_NOINPUT

View file

@ -281,7 +281,7 @@ class MenuNode(object):
code - functional code. Deprecated. This will be executed just before this code - functional code. Deprecated. This will be executed just before this
node is loaded (i.e. as soon after it's been selected from node is loaded (i.e. as soon after it's been selected from
another node). self.caller is available to call from this another node). self.caller is available to call from this
code block, as well as ev. code block, as well as the evennia flat API.
callback - function callback. This will be called as callback(currentnode) just callback - function callback. This will be called as callback(currentnode) just
before this node is loaded (i.e. as soon as possible as it's before this node is loaded (i.e. as soon as possible as it's
been selected from another node). currentnode.caller is available. been selected from another node). currentnode.caller is available.

View file

@ -5,10 +5,10 @@ Inherit from this to define a new type of subprocess.
""" """
from twisted.python import log
from twisted.internet import error from twisted.internet import error
from twisted.protocols import amp from twisted.protocols import amp
from contrib.procpools.ampoule.commands import Echo, Shutdown, Ping from evennia.contrib.procpools.ampoule.commands import Echo, Shutdown, Ping
class AMPChild(amp.AMP): class AMPChild(amp.AMP):
def __init__(self): def __init__(self):

View file

@ -11,7 +11,7 @@ from twisted.protocols import amp
from twisted.python import runtime from twisted.python import runtime
from twisted.python.compat import set from twisted.python.compat import set
from contrib.procpools.ampoule import iampoule from evennia.contrib.procpools.ampoule import iampoule
gen = itertools.count() gen = itertools.count()
@ -193,7 +193,7 @@ class ProcessStarter(object):
self.uid = uid self.uid = uid
self.gid = gid self.gid = gid
self.usePTY = usePTY self.usePTY = usePTY
self.packages = ("ampoule",) + packages self.packages = ("evennia.contrib.procpools.ampoule",) + packages
self.packages = packages self.packages = packages
self.childReactor = childReactor self.childReactor = childReactor

View file

@ -11,7 +11,7 @@ pop = heapq.heappop
from twisted.internet import defer, task, error from twisted.internet import defer, task, error
from twisted.python import log, failure from twisted.python import log, failure
from contrib.procpools.ampoule import commands, main from evennia.contrib.procpools.ampoule import commands, main
try: try:
DIE = signal.SIGKILL DIE = signal.SIGKILL
@ -19,6 +19,7 @@ except AttributeError:
# Windows doesn't have SIGKILL, let's just use SIGTERM then # Windows doesn't have SIGKILL, let's just use SIGTERM then
DIE = signal.SIGTERM DIE = signal.SIGTERM
class ProcessPool(object): class ProcessPool(object):
""" """
This class generalizes the functionality of a pool of This class generalizes the functionality of a pool of
@ -62,11 +63,11 @@ class ProcessPool(object):
self.starter = starter self.starter = starter
self.ampChildArgs = tuple(ampChildArgs) self.ampChildArgs = tuple(ampChildArgs)
if starter is None: if starter is None:
self.starter = main.ProcessStarter(packages=("twisted", "ampoule")) self.starter = main.ProcessStarter(packages=("twisted",))
self.ampParent = ampParent self.ampParent = ampParent
self.ampChild = ampChild self.ampChild = ampChild
if ampChild is None: if ampChild is None:
from contrib.procpools.ampoule.child import AMPChild from evennia.contrib.procpools.ampoule.child import AMPChild
self.ampChild = AMPChild self.ampChild = AMPChild
self.min = min self.min = min
self.max = max self.max = max
@ -396,6 +397,7 @@ class ProcessPool(object):
pp = None pp = None
def deferToAMPProcess(command, **kwargs): def deferToAMPProcess(command, **kwargs):
""" """
Helper function that sends a command to the default process pool Helper function that sends a command to the default process pool

View file

@ -9,8 +9,8 @@ def makeService(options):
""" """
ms = service.MultiService() ms = service.MultiService()
from contrib.procpools.ampoule.pool import ProcessPool from evennia.contrib.procpools.ampoule.pool import ProcessPool
from contrib.procpools.ampoule.main import ProcessStarter from evennia.contrib.procpools.ampoule.main import ProcessStarter
name = options['name'] name = options['name']
ampport = options['ampport'] ampport = options['ampport']
ampinterface = options['ampinterface'] ampinterface = options['ampinterface']
@ -23,7 +23,7 @@ def makeService(options):
childReactor = options['reactor'] childReactor = options['reactor']
timeout = options['timeout'] timeout = options['timeout']
starter = ProcessStarter(packages=("twisted", "ampoule"), childReactor=childReactor) starter = ProcessStarter(packages=("twisted",), childReactor=childReactor)
pp = ProcessPool(child, parent, min, max, name, maxIdle, recycle, starter, timeout) pp = ProcessPool(child, parent, min, max, name, maxIdle, recycle, starter, timeout)
svc = AMPouleService(pp, child, ampport, ampinterface) svc = AMPouleService(pp, child, ampport, ampinterface)
svc.setServiceParent(ms) svc.setServiceParent(ms)
@ -43,7 +43,7 @@ class AMPouleService(service.Service):
Before reactor.run() is called we setup the system. Before reactor.run() is called we setup the system.
""" """
service.Service.startService(self) service.Service.startService(self)
from contrib.procpools.ampoule import rpool from evennia.contrib.procpools.ampoule import rpool
from twisted.internet import reactor from twisted.internet import reactor
try: try:

View file

@ -1,23 +1,25 @@
from signal import SIGHUP from signal import SIGHUP
import math
import os import os
import os.path import os.path
from cStringIO import StringIO as sio from cStringIO import StringIO as sio
import tempfile import tempfile
from twisted.internet import error, defer, reactor from twisted.internet import error, defer, reactor
from twisted.python import failure, reflect from twisted.python import failure
from twisted.trial import unittest from twisted.trial import unittest
from twisted.protocols import amp from twisted.protocols import amp
from contrib.procpools.ampoule import main, child, commands, pool from evennia.contrib.procpools.ampoule import main, child, commands, pool
class ShouldntHaveBeenCalled(Exception): class ShouldntHaveBeenCalled(Exception):
pass pass
def _raise(_): def _raise(_):
raise ShouldntHaveBeenCalled(_) raise ShouldntHaveBeenCalled(_)
class _FakeT(object): class _FakeT(object):
closeStdinCalled = False closeStdinCalled = False
def __init__(self, s): def __init__(self, s):
@ -29,6 +31,7 @@ class _FakeT(object):
def write(self, data): def write(self, data):
self.s.write(data) self.s.write(data)
class FakeAMP(object): class FakeAMP(object):
connector = None connector = None
reason = None reason = None
@ -48,38 +51,47 @@ class FakeAMP(object):
def dataReceived(self, data): def dataReceived(self, data):
self.s.write(data) self.s.write(data)
class Ping(amp.Command): class Ping(amp.Command):
arguments = [('data', amp.String())] arguments = [('data', amp.String())]
response = [('response', amp.String())] response = [('response', amp.String())]
class Pong(amp.Command): class Pong(amp.Command):
arguments = [('data', amp.String())] arguments = [('data', amp.String())]
response = [('response', amp.String())] response = [('response', amp.String())]
class Pid(amp.Command): class Pid(amp.Command):
response = [('pid', amp.Integer())] response = [('pid', amp.Integer())]
class Reactor(amp.Command): class Reactor(amp.Command):
response = [('classname', amp.String())] response = [('classname', amp.String())]
class NoResponse(amp.Command): class NoResponse(amp.Command):
arguments = [('arg', amp.String())] arguments = [('arg', amp.String())]
requiresAnswer = False requiresAnswer = False
class GetResponse(amp.Command): class GetResponse(amp.Command):
response = [("response", amp.String())] response = [("response", amp.String())]
class Child(child.AMPChild): class Child(child.AMPChild):
def ping(self, data): def ping(self, data):
return self.callRemote(Pong, data=data) return self.callRemote(Pong, data=data)
Ping.responder(ping) Ping.responder(ping)
class PidChild(child.AMPChild): class PidChild(child.AMPChild):
def pid(self): def pid(self):
import os import os
return {'pid': os.getpid()} return {'pid': os.getpid()}
Pid.responder(pid) Pid.responder(pid)
class NoResponseChild(child.AMPChild): class NoResponseChild(child.AMPChild):
_set = False _set = False
def noresponse(self, arg): def noresponse(self, arg):
@ -91,33 +103,41 @@ class NoResponseChild(child.AMPChild):
return {"response": self._set} return {"response": self._set}
GetResponse.responder(getresponse) GetResponse.responder(getresponse)
class ReactorChild(child.AMPChild): class ReactorChild(child.AMPChild):
def reactor(self): def reactor(self):
from twisted.internet import reactor from twisted.internet import reactor
return {'classname': reactor.__class__.__name__} return {'classname': reactor.__class__.__name__}
Reactor.responder(reactor) Reactor.responder(reactor)
class First(amp.Command): class First(amp.Command):
arguments = [('data', amp.String())] arguments = [('data', amp.String())]
response = [('response', amp.String())] response = [('response', amp.String())]
class Second(amp.Command): class Second(amp.Command):
pass pass
class WaitingChild(child.AMPChild): class WaitingChild(child.AMPChild):
deferred = None deferred = None
def first(self, data): def first(self, data):
self.deferred = defer.Deferred() self.deferred = defer.Deferred()
return self.deferred.addCallback(lambda _: {'response': data}) return self.deferred.addCallback(lambda _: {'response': data})
First.responder(first) First.responder(first)
def second(self): def second(self):
self.deferred.callback('') self.deferred.callback('')
return {} return {}
Second.responder(second) Second.responder(second)
class Die(amp.Command): class Die(amp.Command):
pass pass
class BadChild(child.AMPChild): class BadChild(child.AMPChild):
def die(self): def die(self):
self.shutdown = False self.shutdown = False
@ -235,7 +255,7 @@ main(sys.argv[1])
""" """
starter = main.ProcessStarter(bootstrap=BOOT, starter = main.ProcessStarter(bootstrap=BOOT,
args=(STRING,), args=(STRING,),
packages=("twisted", "ampoule")) packages=("twisted",))
amp, finished = starter.startPythonProcess(main.AMPConnector(a)) amp, finished = starter.startPythonProcess(main.AMPConnector(a))
def _eb(reason): def _eb(reason):
@ -257,7 +277,7 @@ def main(arg):
raise Exception(arg) raise Exception(arg)
main(sys.argv[1]) main(sys.argv[1])
""" """
starter = main.ProcessStarter(bootstrap=BOOT, args=(STRING,), packages=("twisted", "ampoule")) starter = main.ProcessStarter(bootstrap=BOOT, args=(STRING,), packages=("twisted",))
ready, finished = starter.startPythonProcess(main.AMPConnector(a), "I'll be ignored") ready, finished = starter.startPythonProcess(main.AMPConnector(a), "I'll be ignored")
self.assertFailure(finished, error.ProcessTerminated) self.assertFailure(finished, error.ProcessTerminated)
@ -279,9 +299,10 @@ def main():
main() main()
""" """
starter = main.ProcessStarter(bootstrap=BOOT, starter = main.ProcessStarter(bootstrap=BOOT,
packages=("twisted", "ampoule"), packages=("twisted",),
env={"FOOBAR": STRING}) env={"FOOBAR": STRING})
amp, finished = starter.startPythonProcess(main.AMPConnector(a), "I'll be ignored") amp, finished = starter.startPythonProcess(main.AMPConnector(a), "I'll be ignored")
def _eb(reason): def _eb(reason):
print reason print reason
finished.addErrback(_eb) finished.addErrback(_eb)
@ -294,7 +315,7 @@ main()
""" """
STRING = "ciao" STRING = "ciao"
starter = main.ProcessStarter(packages=("twisted", "ampoule")) starter = main.ProcessStarter(packages=("twisted",))
c, finished = starter.startAMPProcess(child.AMPChild) c, finished = starter.startAMPProcess(child.AMPChild)
c.callRemote(commands.Echo, data=STRING c.callRemote(commands.Echo, data=STRING
).addCallback(lambda response: ).addCallback(lambda response:
@ -303,9 +324,10 @@ main()
return finished return finished
def test_BootstrapContext(self): def test_BootstrapContext(self):
starter = main.ProcessStarter(packages=('twisted', 'ampoule')) starter = main.ProcessStarter(packages=('twisted',))
c, finished = starter.startAMPProcess(TempDirChild) c, finished = starter.startAMPProcess(TempDirChild)
cwd = [] cwd = []
def checkBootstrap(response): def checkBootstrap(response):
cwd.append(response['cwd']) cwd.append(response['cwd'])
self.assertNotEquals(cwd, os.getcwd()) self.assertNotEquals(cwd, os.getcwd())
@ -316,10 +338,11 @@ main()
return finished return finished
def test_BootstrapContextInstance(self): def test_BootstrapContextInstance(self):
starter = main.ProcessStarter(packages=('twisted', 'ampoule')) starter = main.ProcessStarter(packages=('twisted',))
c, finished = starter.startAMPProcess(TempDirChild, c, finished = starter.startAMPProcess(TempDirChild,
ampChildArgs=('foo',)) ampChildArgs=('foo',))
cwd = [] cwd = []
def checkBootstrap(response): def checkBootstrap(response):
cwd.append(response['cwd']) cwd.append(response['cwd'])
self.assertTrue(cwd[0].endswith('/foo')) self.assertTrue(cwd[0].endswith('/foo'))
@ -342,7 +365,7 @@ main()
return {'response': DATA+APPEND} return {'response': DATA+APPEND}
Pong.responder(pong) Pong.responder(pong)
starter = main.ProcessStarter(packages=("twisted", "ampoule")) starter = main.ProcessStarter(packages=("twisted",))
subp, finished = starter.startAMPProcess(ampChild=Child, ampParent=Parent) subp, finished = starter.startAMPProcess(ampChild=Child, ampParent=Parent)
subp.callRemote(Ping, data=DATA subp.callRemote(Ping, data=DATA
@ -359,10 +382,11 @@ main()
class Child(child.AMPChild): class Child(child.AMPChild):
pass pass
starter = main.ProcessStarter(packages=("twisted", "ampoule")) starter = main.ProcessStarter(packages=("twisted",))
self.assertRaises(RuntimeError, starter.startAMPProcess, ampChild=Child) self.assertRaises(RuntimeError, starter.startAMPProcess, ampChild=Child)
class TestProcessPool(unittest.TestCase): class TestProcessPool(unittest.TestCase):
def test_startStopWorker(self): def test_startStopWorker(self):
@ -485,6 +509,7 @@ class TestProcessPool(unittest.TestCase):
Pong.responder(pong) Pong.responder(pong)
pp = pool.ProcessPool(ampChild=Child, ampParent=Parent) pp = pool.ProcessPool(ampChild=Child, ampParent=Parent)
def _checks(_): def _checks(_):
return pp.doWork(Ping, data=DATA return pp.doWork(Ping, data=DATA
).addCallback(lambda response: ).addCallback(lambda response:
@ -493,7 +518,6 @@ class TestProcessPool(unittest.TestCase):
return pp.start().addCallback(_checks).addCallback(lambda _: pp.stop()) return pp.start().addCallback(_checks).addCallback(lambda _: pp.stop())
def test_deferToAMPProcess(self): def test_deferToAMPProcess(self):
""" """
Test that deferToAMPProcess works as expected. Test that deferToAMPProcess works as expected.
@ -593,6 +617,7 @@ class TestProcessPool(unittest.TestCase):
def _realChecks(_): def _realChecks(_):
from twisted.internet import reactor from twisted.internet import reactor
d = defer.Deferred() d = defer.Deferred()
def _cb(): def _cb():
def __(_): def __(_):
try: try:
@ -677,7 +702,6 @@ class TestProcessPool(unittest.TestCase):
d.addCallback(_work) d.addCallback(_work)
return d return d
def test_disableProcessRecycling(self): def test_disableProcessRecycling(self):
""" """
Test that by setting 0 to recycleAfter we actually disable process recycling. Test that by setting 0 to recycleAfter we actually disable process recycling.
@ -724,7 +748,7 @@ class TestProcessPool(unittest.TestCase):
pp = pool.ProcessPool( pp = pool.ProcessPool(
starter=main.ProcessStarter( starter=main.ProcessStarter(
childReactor=FIRST, childReactor=FIRST,
packages=("twisted", "ampoule")), packages=("twisted",)),
ampChild=ReactorChild, min=MIN, max=MAX) ampChild=ReactorChild, min=MIN, max=MAX)
pp.start() pp.start()
return pp.doWork(Reactor return pp.doWork(Reactor
@ -735,7 +759,7 @@ class TestProcessPool(unittest.TestCase):
pp = pool.ProcessPool( pp = pool.ProcessPool(
starter=main.ProcessStarter( starter=main.ProcessStarter(
childReactor=SECOND, childReactor=SECOND,
packages=("twisted", "ampoule")), packages=("twisted",)),
ampChild=ReactorChild, min=MIN, max=MAX) ampChild=ReactorChild, min=MIN, max=MAX)
pp.start() pp.start()
return pp.doWork(Reactor return pp.doWork(Reactor
@ -772,6 +796,7 @@ class TestProcessPool(unittest.TestCase):
def test_SupplyChildArgs(self): def test_SupplyChildArgs(self):
"""Ensure that arguments for the child constructor are passed in.""" """Ensure that arguments for the child constructor are passed in."""
pp = pool.ProcessPool(Writer, ampChildArgs=['body'], min=0) pp = pool.ProcessPool(Writer, ampChildArgs=['body'], min=0)
def _check(result): def _check(result):
return pp.doWork(Write).addCallback( return pp.doWork(Write).addCallback(
self.assertEquals, {'response': 'body'}) self.assertEquals, {'response': 'body'})

View file

@ -3,17 +3,20 @@ from twisted.internet.protocol import ClientFactory
from twisted.trial import unittest from twisted.trial import unittest
from twisted.protocols import amp from twisted.protocols import amp
from contrib.procpools.ampoule import service, child, pool, main from evennia.contrib.procpools.ampoule import service, child, pool, main
from contrib.procpools.ampoule.commands import Echo from evennia.contrib.procpools.ampoule.commands import Echo
class ClientAMP(amp.AMP): class ClientAMP(amp.AMP):
factory = None factory = None
def connectionMade(self): def connectionMade(self):
if self.factory is not None: if self.factory is not None:
self.factory.theProto = self self.factory.theProto = self
if hasattr(self.factory, 'onMade'): if hasattr(self.factory, 'onMade'):
self.factory.onMade.callback(None) self.factory.onMade.callback(None)
class TestAMPProxy(unittest.TestCase): class TestAMPProxy(unittest.TestCase):
def setUp(self): def setUp(self):
""" """

View file

@ -21,7 +21,7 @@ the header carefully.
To test it works, make sure to activate the process pool, then try the To test it works, make sure to activate the process pool, then try the
following as superuser: following as superuser:
@py from contrib.procpools.python_procpool import run_async;run_async("_return('Wohoo!')", at_return=self.msg, at_err=self.msg) @py from evennia.contrib.procpools.python_procpool import run_async;run_async("_return('Wohoo!')", at_return=self.msg, at_err=self.msg)
You can also try to import time and do time.sleep(5) before the You can also try to import time and do time.sleep(5) before the
_return statement, to test it really is asynchronous. _return statement, to test it really is asynchronous.
@ -30,7 +30,7 @@ _return statement, to test it really is asynchronous.
from twisted.protocols import amp from twisted.protocols import amp
from twisted.internet import threads from twisted.internet import threads
from contrib.procpools.ampoule.child import AMPChild from evennia.contrib.procpools.ampoule.child import AMPChild
from evennia.utils.dbserialize import to_pickle, from_pickle, do_pickle, do_unpickle from evennia.utils.dbserialize import to_pickle, from_pickle, do_pickle, do_unpickle
from evennia.utils.idmapper.base import PROC_MODIFIED_OBJS from evennia.utils.idmapper.base import PROC_MODIFIED_OBJS
from evennia.utils.utils import clean_object_caches, to_str from evennia.utils.utils import clean_object_caches, to_str

View file

@ -72,16 +72,15 @@ def start_plugin_services(server):
# terminal output # terminal output
print ' amp (Process Pool): %s' % PROCPOOL_PORT print ' amp (Process Pool): %s' % PROCPOOL_PORT
from contrib.procpools.ampoule import main as ampoule_main from evennia.contrib.procpools.ampoule import main as ampoule_main
from contrib.procpools.ampoule import service as ampoule_service from evennia.contrib.procpools.ampoule import service as ampoule_service
from contrib.procpools.ampoule import pool as ampoule_pool from evennia.contrib.procpools.ampoule import pool as ampoule_pool
from contrib.procpools.ampoule.main import BOOTSTRAP as _BOOTSTRAP from evennia.contrib.procpools.ampoule.main import BOOTSTRAP as _BOOTSTRAP
from contrib.procpools.python_procpool import PythonProcPoolChild from evennia.contrib.procpools.python_procpool import PythonProcPoolChild
# for some reason absolute paths don't work here, only relative ones. # for some reason absolute paths don't work here, only relative ones.
apackages = ("twisted", apackages = ("twisted",
os.path.join(os.pardir, "contrib", "procpools", "ampoule"), "evennia",
os.path.join(os.pardir, "ev"),
"settings") "settings")
aenv = {"DJANGO_SETTINGS_MODULE": "settings", aenv = {"DJANGO_SETTINGS_MODULE": "settings",
"DATABASE_NAME": settings.DATABASES.get("default", {}).get("NAME") or settings.DATABASE_NAME} "DATABASE_NAME": settings.DATABASES.get("default", {}).get("NAME") or settings.DATABASE_NAME}

View file

@ -23,8 +23,8 @@ mob implementation.
""" """
from evennia import Object, CmdSet, default_cmds from evennia import DefaultObject, CmdSet, default_cmds
from contrib import menusystem from evennia.contrib import menusystem
# #
@ -110,7 +110,7 @@ CONV = {"START": {"text": "Hello there, how can I help you?",
} }
class TalkingNPC(Object): class TalkingNPC(DefaultObject):
""" """
This implements a simple Object using the talk command and using the This implements a simple Object using the talk command and using the
conversation defined above. . conversation defined above. .

View file

@ -20,7 +20,7 @@ class HelpEntryManager(models.Manager):
find_topicsuggestions find_topicsuggestions
find_topics_with_category find_topics_with_category
all_to_category all_to_category
search_help (equivalent to ev.search_helpentry) search_help (equivalent to evennia.search_helpentry)
""" """
def find_topicmatch(self, topicstr, exact=False): def find_topicmatch(self, topicstr, exact=False):

View file

@ -45,7 +45,7 @@ class ObjectDBManager(TypedObjectManager):
get_objs_with_key_or_alias get_objs_with_key_or_alias
get_contents get_contents
object_search (interface to many of the above methods, object_search (interface to many of the above methods,
equivalent to ev.search_object) equivalent to evennia.search_object)
copy_object copy_object
""" """

View file

@ -102,7 +102,7 @@ class DefaultObject(ObjectDB):
Characters, Exits and Rooms (see the bottom of this module). Characters, Exits and Rooms (see the bottom of this module).
Note that all new Objects and their subclasses *must* always be Note that all new Objects and their subclasses *must* always be
created using the ev.create_object() function. This is so the created using the evennia.create_object() function. This is so the
typeclass system can be correctly initiated behind the scenes. typeclass system can be correctly initiated behind the scenes.
@ -326,7 +326,7 @@ class DefaultObject(ObjectDB):
Perform a standard object search in the database, handling Perform a standard object search in the database, handling
multiple results and lack thereof gracefully. By default, only multiple results and lack thereof gracefully. By default, only
objects in self's current location or inventory is searched. objects in self's current location or inventory is searched.
Note: to find Players, use eg. ev.player_search. Note: to find Players, use eg. evennia.player_search.
Args: Args:
searchdata (str or obj): Primary search criterion. Will be matched searchdata (str or obj): Primary search criterion. Will be matched

View file

@ -36,7 +36,7 @@ class PlayerDBManager(TypedObjectManager, UserManager):
get_player_from_email get_player_from_email
get_player_from_uid get_player_from_uid
get_player_from_name get_player_from_name
player_search (equivalent to ev.search_player) player_search (equivalent to evennia.search_player)
#swap_character #swap_character
""" """

View file

@ -31,7 +31,7 @@ class ScriptDBManager(TypedObjectManager):
delete_script delete_script
remove_non_persistent remove_non_persistent
validate validate
script_search (equivalent to ev.search_script) script_search (equivalent to evennia.search_script)
copy_script copy_script
""" """