01234567890123456789012345678901234567890123456789012345678901234567890123456789
55065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546 |
<----SKIPPED LINES---->
file_extension = '.py'
live_name = python_prefix + '.py'
live_path = os.path.join(CODE_REPOSITORY, live_name)
epoch = os.path.getmtime(live_path)
last_modified_suffix = EpochDisplayTime(epoch, format_string='-%Y-%m-%d-%H%M')
version_name = python_prefix + last_modified_suffix + file_extension
version_path = os.path.join(VERSION_REPOSITORY, version_name)
shutil.copyfile(live_path, version_path)
return version_name
VERSION_MESSAGEBOARD = MakeCopy('messageboard')
VERSION_ARDUINO = MakeCopy('arduino')
def LogInitTimes(init_times):
msg = ''
for n, t in enumerate(init_times[:-1]):
msg += '%.2fs to get from reading %d to reading %s' % (t[n + 1] - t[n], n, n + 1)
Log(msg)
def main():
"""Traffic cop between incoming radio flight messages, configuration, and messageboard.
This is the main logic, checking for new flights, augmenting the radio signal with
additional web-scraped data, and generating messages in a form presentable to the
messageboard.
"""
RemoveFile(LOGFILE_LOCK)
VersionControl()
# Since this clears log files, it should occur first before we start logging
if '-s' in sys.argv:
global SIMULATION_COUNTER
SimulationSetup()
last_heartbeat_time = HeartbeatRestart()
init_timing = [time.time()] # time 0
<----SKIPPED LINES---->
|
01234567890123456789012345678901234567890123456789012345678901234567890123456789
55065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546 |
<----SKIPPED LINES---->
file_extension = '.py'
live_name = python_prefix + '.py'
live_path = os.path.join(CODE_REPOSITORY, live_name)
epoch = os.path.getmtime(live_path)
last_modified_suffix = EpochDisplayTime(epoch, format_string='-%Y-%m-%d-%H%M')
version_name = python_prefix + last_modified_suffix + file_extension
version_path = os.path.join(VERSION_REPOSITORY, version_name)
shutil.copyfile(live_path, version_path)
return version_name
VERSION_MESSAGEBOARD = MakeCopy('messageboard')
VERSION_ARDUINO = MakeCopy('arduino')
def LogInitTimes(init_times):
msg = ''
for n, t in enumerate(init_times[:-1]):
msg += '%.2fs to get from reading %d to reading %s' % (init_times[n + 1] - init_times[n], n, n + 1)
Log(msg)
def main():
"""Traffic cop between incoming radio flight messages, configuration, and messageboard.
This is the main logic, checking for new flights, augmenting the radio signal with
additional web-scraped data, and generating messages in a form presentable to the
messageboard.
"""
RemoveFile(LOGFILE_LOCK)
VersionControl()
# Since this clears log files, it should occur first before we start logging
if '-s' in sys.argv:
global SIMULATION_COUNTER
SimulationSetup()
last_heartbeat_time = HeartbeatRestart()
init_timing = [time.time()] # time 0
<----SKIPPED LINES---->
|