1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

match darwin as well as linux for triggers, which fixes a really irritating bug in MacOS that kept applications from quitting correctly and they would have to be killed

This commit is contained in:
Joel Bender 2016-01-23 21:22:21 -05:00
parent b065f5fb24
commit 36a2aa754a
3 changed files with 12 additions and 6 deletions

View File

@ -21,7 +21,7 @@ _task_manager = None
_unscheduled_tasks = []
# only defined for linux platforms
if 'linux' in sys.platform:
if sys.platform.startswith(('linux', 'darwin')):
from .event import WaitableEvent
#
# _Trigger
@ -39,6 +39,8 @@ if 'linux' in sys.platform:
# read in the character, highlander
data = self.recv(1)
if _debug: _Trigger._debug(" - data: %r", data)
else:
_Trigger = None
#
# _Task
@ -257,7 +259,7 @@ class TaskManager(SingletonLogging):
# initialize
self.tasks = []
if 'linux' in sys.platform:
if _Trigger:
self.trigger = _Trigger()
else:
self.trigger = None

View File

@ -21,7 +21,7 @@ _task_manager = None
_unscheduled_tasks = []
# only defined for linux platforms
if 'linux' in sys.platform:
if sys.platform.startswith(('linux', 'darwin')):
from .event import WaitableEvent
#
# _Trigger
@ -39,6 +39,8 @@ if 'linux' in sys.platform:
# read in the character, highlander
data = self.recv(1)
if _debug: _Trigger._debug(" - data: %r", data)
else:
_Trigger = None
#
# _Task
@ -253,7 +255,7 @@ class TaskManager(SingletonLogging):
# initialize
self.tasks = []
if 'linux' in sys.platform:
if _Trigger:
self.trigger = _Trigger()
else:
self.trigger = None

View File

@ -21,7 +21,7 @@ _task_manager = None
_unscheduled_tasks = []
# only defined for linux platforms
if 'linux' in sys.platform:
if sys.platform.startswith(('linux', 'darwin')):
from .event import WaitableEvent
#
# _Trigger
@ -39,6 +39,8 @@ if 'linux' in sys.platform:
# read in the character, highlander
data = self.recv(1)
if _debug: _Trigger._debug(" - data: %r", data)
else:
_Trigger = None
#
# _Task
@ -253,7 +255,7 @@ class TaskManager(SingletonLogging):
# initialize
self.tasks = []
if 'linux' in sys.platform:
if _Trigger:
self.trigger = _Trigger()
else:
self.trigger = None