Skip to content

Commit

Permalink
TASK: Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed Jan 13, 2019
1 parent b5334ff commit 009fbea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pastepwn/core/actionhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


class ActionHandler(object):
"""Handler to execute all the actions, if an analyzer matches a paste"""

def __init__(self, action_queue=None, exception_event=None, stop_event=None):
self.logger = logging.getLogger(__name__)
Expand All @@ -21,6 +22,11 @@ def __init__(self, action_queue=None, exception_event=None, stop_event=None):
self.__lock = Lock()

def start(self, ready=None):
"""
Starts the actionhandler to execute actions if pastes are matched
:param ready: Event to check from the outside if the actionhandler has been started
:return: None
"""
with self.__lock:
if not self.running:
self.running = True
Expand All @@ -32,6 +38,10 @@ def start(self, ready=None):
ready.set()

def stop(self):
"""
Stops the actionhandler
:return: None
"""
self.__stop_event.set()
while self.running:
sleep(0.1)
Expand Down

0 comments on commit 009fbea

Please sign in to comment.