Add new NetworkEvents method
This lets us attach all attributes of the base event to the new event. Often Events trigger other Events. When that happens we often want to keep all attr from the previous Event, and just continue under a new Event. Until now all attr had to be pulled out of `self.base_event` again.
This commit is contained in:
parent
89367a83ec
commit
aefb571168
|
@ -154,8 +154,13 @@ class NetworkEvent(object):
|
|||
|
||||
def _set_kwargs_as_attributes(self, **kwargs):
|
||||
for k, v in kwargs.items():
|
||||
setattr(self, k, v)
|
||||
if k not in ('name', 'base_network_events'):
|
||||
setattr(self, k, v)
|
||||
|
||||
def _set_base_event_vars_as_attributes(self, event):
|
||||
for k, v in vars(event).items():
|
||||
if k not in ('name', 'base_network_events'):
|
||||
setattr(self, k, v)
|
||||
|
||||
class NetworkIncomingEvent(NetworkEvent):
|
||||
base_network_events = []
|
||||
|
|
Loading…
Reference in New Issue