01234567890123456789012345678901234567890123456789012345678901234567890123456789
53555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395 |
<----SKIPPED LINES---->
args: A tuple of function parameters to pass unmodified to start_function.
Returns:
The running process - either the same one that was passed in, or a new one if a
restart was needed.
"""
if not SHUTDOWN_SIGNAL:
if not enabled:
if p is not None: # must have just requested a disabling of single instance
args[2].value = 1 # trigger a shutdown on the single instance
return None
if p is None or not p.is_alive():
if p is None:
Log('Process for %s starting for first time' % str(start_function))
elif VERBOSE:
Log('Process (%s) for %s died; restarting' % (str(p), str(start_function)))
args[2].value = 0 # (re)set shutdown flag to allow function to run
p = multiprocessing.Process(target=start_function, args=args)
p.daemon = True # TODO: perhaps value of false will address correlated BT failures?
p.start()
return p
def LastFlightAvailable(flights, screen_history):
"""Returns True if last message sent to splitflap is not the last flight; else False."""
if not screen_history:
return False
last_message_tuple = screen_history[-1]
last_message_type = last_message_tuple[0]
if last_message_type == FLAG_MSG_FLIGHT:
last_message_flight = last_message_tuple[2]
if SameFlight(last_message_flight, flights[-1]):
return False # already displaying the last flight!
return True
def EnqueueArduinos(
<----SKIPPED LINES---->
|
01234567890123456789012345678901234567890123456789012345678901234567890123456789
53555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395 |
<----SKIPPED LINES---->
args: A tuple of function parameters to pass unmodified to start_function.
Returns:
The running process - either the same one that was passed in, or a new one if a
restart was needed.
"""
if not SHUTDOWN_SIGNAL:
if not enabled:
if p is not None: # must have just requested a disabling of single instance
args[2].value = 1 # trigger a shutdown on the single instance
return None
if p is None or not p.is_alive():
if p is None:
Log('Process for %s starting for first time' % str(start_function))
elif VERBOSE:
Log('Process (%s) for %s died; restarting' % (str(p), str(start_function)))
args[2].value = 0 # (re)set shutdown flag to allow function to run
p = multiprocessing.Process(target=start_function, args=args)
p.daemon = False # TODO: perhaps value of false will address correlated BT failures?
p.start()
return p
def LastFlightAvailable(flights, screen_history):
"""Returns True if last message sent to splitflap is not the last flight; else False."""
if not screen_history:
return False
last_message_tuple = screen_history[-1]
last_message_type = last_message_tuple[0]
if last_message_type == FLAG_MSG_FLIGHT:
last_message_flight = last_message_tuple[2]
if SameFlight(last_message_flight, flights[-1]):
return False # already displaying the last flight!
return True
def EnqueueArduinos(
<----SKIPPED LINES---->
|