mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 23:06:31 +01:00
Move the interrupting exception of events
This commit is contained in:
parent
96b90dde1e
commit
bc9bfb3fa7
4 changed files with 14 additions and 18 deletions
|
|
@ -6,7 +6,7 @@ Eventfuncs are just Python functions that can be used inside of calllbacks.
|
|||
"""
|
||||
|
||||
from evennia import ObjectDB, ScriptDB
|
||||
from evennia.contrib.events.exceptions import InterruptEvent
|
||||
from evennia.contrib.events.utils import InterruptEvent
|
||||
|
||||
def deny():
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
"""
|
||||
Module containing the exceptions of the event system.
|
||||
"""
|
||||
|
||||
class InterruptEvent(RuntimeError):
|
||||
|
||||
"""
|
||||
Interrupt the current event.
|
||||
|
||||
You shouldn't have to use this exception directly, probably use the
|
||||
`deny()` function that handles it instead.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
|
@ -14,9 +14,8 @@ from evennia import logger
|
|||
from evennia.utils.create import create_channel
|
||||
from evennia.utils.dbserialize import dbserialize
|
||||
from evennia.utils.utils import all_from_module, delay
|
||||
from evennia.contrib.events.exceptions import InterruptEvent
|
||||
from evennia.contrib.events.handler import CallbackHandler
|
||||
from evennia.contrib.events.utils import get_next_wait, EVENTS
|
||||
from evennia.contrib.events.utils import get_next_wait, EVENTS, InterruptEvent
|
||||
|
||||
# Constants
|
||||
RE_LINE_ERROR = re.compile(r'^ File "\<string\>", line (\d+)')
|
||||
|
|
|
|||
|
|
@ -233,3 +233,15 @@ def phrase_event(callbacks, parameters):
|
|||
to_call.append(callback)
|
||||
|
||||
return to_call
|
||||
|
||||
class InterruptEvent(RuntimeError):
|
||||
|
||||
"""
|
||||
Interrupt the current event.
|
||||
|
||||
You shouldn't have to use this exception directly, probably use the
|
||||
`deny()` function that handles it instead.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue