Skip to content

Commit

Permalink
event plugin provides self
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjum committed Jan 31, 2016
1 parent 6703192 commit 98ba074
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions spockbot/plugins/core/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
logger = logging.getLogger('spockbot')


class EventCore(object):
def __init__(self):
@pl_announce('Event')
class EventPlugin(object):
def __init__(self, ploader, settings):
ploader.provides('Event', self)
self.has_run = False
self.kill_event = False
self.event_handlers = defaultdict(list)
Expand Down Expand Up @@ -61,9 +63,3 @@ def emit(self, event, data=None):

def kill(self, *args):
self.kill_event = True


@pl_announce('Event')
class EventPlugin(object):
def __init__(self, ploader, settings):
ploader.provides('Event', EventCore())

0 comments on commit 98ba074

Please sign in to comment.