Skip to content

Commit

Permalink
added daemon glag
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Preston committed May 26, 2015
1 parent 19f7166 commit 546b0b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

v4.2.0
------
- Added daemon flag for PortEventListener.

v4.1.2
------
- Fixed bug with new Device Tree (Pi2) by changing GPIO_INTERRUPT_DEVICE
Expand Down
4 changes: 3 additions & 1 deletion pifacecommon/interrupts.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class PortEventListener(object):

TERMINATE_SIGNAL = "astalavista"

def __init__(self, port, chip, return_after_kbdint=True):
def __init__(self, port, chip, return_after_kbdint=True, daemon=False):
self.port = port
self.chip = chip
self.pin_function_maps = list()
Expand All @@ -161,13 +161,15 @@ def __init__(self, port, chip, return_after_kbdint=True):
self.pin_function_maps,
self.event_queue,
return_after_kbdint))
self.detector.daemon = daemon
self.dispatcher = threading.Thread(
target=handle_events,
args=(
self.pin_function_maps,
self.event_queue,
_event_matches_pin_function_map,
PortEventListener.TERMINATE_SIGNAL))
self.dispatcher.daemon = daemon

def register(self, pin_num, direction, callback,
settle_time=DEFAULT_SETTLE_TIME):
Expand Down
2 changes: 1 addition & 1 deletion pifacecommon/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.1.2'
__version__ = '4.2.0'

0 comments on commit 546b0b1

Please sign in to comment.