mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Structure handlers to allow .get() to return lists
See #1154. In the end I didn't modify the Attributehandler and TagHandler like this, instead I added the `return_list` argument for cases when one wants a guaranteed return.
This commit is contained in:
parent
05a3d0435d
commit
92df3ce5ae
13 changed files with 86 additions and 1608 deletions
|
|
@ -6,7 +6,7 @@ from datetime import datetime, timedelta
|
|||
|
||||
from twisted.internet import reactor, task
|
||||
from evennia.server.models import ServerConfig
|
||||
from evennia.utils.logger import log_trace, log_err
|
||||
from evennia.utils.logger import log_err
|
||||
from evennia.utils.dbserialize import dbserialize, dbunserialize
|
||||
|
||||
TASK_HANDLER = None
|
||||
|
|
@ -113,9 +113,9 @@ class TaskHandler(object):
|
|||
try:
|
||||
dbserialize(arg)
|
||||
except (TypeError, AttributeError):
|
||||
logger.log_err("The positional argument {} cannot be "
|
||||
"pickled and will not be present in the arguments "
|
||||
"fed to the callback {}".format(arg, callback))
|
||||
log_err("The positional argument {} cannot be "
|
||||
"pickled and will not be present in the arguments "
|
||||
"fed to the callback {}".format(arg, callback))
|
||||
else:
|
||||
safe_args.append(arg)
|
||||
|
||||
|
|
@ -123,9 +123,9 @@ class TaskHandler(object):
|
|||
try:
|
||||
dbserialize(value)
|
||||
except (TypeError, AttributeError):
|
||||
logger.log_err("The {} keyword argument {} cannot be "
|
||||
"pickled and will not be present in the arguments "
|
||||
"fed to the callback {}".format(key, value, callback))
|
||||
log_err("The {} keyword argument {} cannot be "
|
||||
"pickled and will not be present in the arguments "
|
||||
"fed to the callback {}".format(key, value, callback))
|
||||
else:
|
||||
safe_kwargs[key] = value
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue