diff --git a/CHANGELOG b/CHANGELOG index c8f0702..6bca46f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/pifacecommon/interrupts.py b/pifacecommon/interrupts.py index 50f6e7e..59322d1 100644 --- a/pifacecommon/interrupts.py +++ b/pifacecommon/interrupts.py @@ -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() @@ -161,6 +161,7 @@ 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=( @@ -168,6 +169,7 @@ def __init__(self, port, chip, return_after_kbdint=True): 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): diff --git a/pifacecommon/version.py b/pifacecommon/version.py index 96e5585..ea5d65f 100644 --- a/pifacecommon/version.py +++ b/pifacecommon/version.py @@ -1 +1 @@ -__version__ = '4.1.2' +__version__ = '4.2.0'