mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 16:56:32 +01:00
Prevent an error in @ps being used before the events have triggered the first time.
This commit is contained in:
parent
5a465746c5
commit
eb2608ffd2
2 changed files with 8 additions and 7 deletions
|
|
@ -24,6 +24,14 @@ class IntervalEvent(object):
|
|||
# A reference to the task.LoopingCall object.
|
||||
looped_task = None
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Executed when the class is instantiated.
|
||||
"""
|
||||
# This is set to prevent a Nonetype exception on @ps before the
|
||||
# event is fired for the first time.
|
||||
self.time_last_executed = time.time()
|
||||
|
||||
def __unicode__(self):
|
||||
"""
|
||||
String representation of the event.
|
||||
|
|
|
|||
|
|
@ -9,13 +9,6 @@ ADDING AN EVENT:
|
|||
|
||||
# List of IntervalEvent sub-classed objects.
|
||||
schedule = []
|
||||
|
||||
def start_events():
|
||||
"""
|
||||
Start the event system, which is built on Twisted's framework.
|
||||
"""
|
||||
for event in schedule:
|
||||
event.start_event_loop()
|
||||
|
||||
def add_event(event):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue