mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 07:27:17 +02:00
Changed how lazy-loading of handlers work, using a werkzeug recipe. Much more efficient now.
This commit is contained in:
parent
680e603c4d
commit
e6950aadf2
10 changed files with 125 additions and 144 deletions
|
|
@ -7,7 +7,7 @@ All commands in Evennia inherit from the 'Command' class in this module.
|
|||
|
||||
import re
|
||||
from src.locks.lockhandler import LockHandler
|
||||
from src.utils.utils import is_iter, fill, LazyLoadHandler
|
||||
from src.utils.utils import is_iter, fill, lazy_property
|
||||
|
||||
|
||||
def _init_command(mcs, **kwargs):
|
||||
|
|
@ -155,7 +155,10 @@ class Command(object):
|
|||
overloading evential same-named class properties."""
|
||||
if kwargs:
|
||||
_init_command(self, **kwargs)
|
||||
self.lockhandler = LazyLoadHandler(self, "lockhandler", LockHandler)
|
||||
|
||||
@lazy_property
|
||||
def lockhandler(self):
|
||||
return LockHandler(self)
|
||||
|
||||
def __str__(self):
|
||||
"Print the command"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue