"""Runs captured sites framework recording and tests."""
import signal
import sys
import time
import captured_sites_commands
def _handle_signal(sig, _):
"""Handles received signals to make sure spawned test process are killed.
sig (int): An integer representing the received signal, for example SIGTERM.
"""
print('Signal to quit received, waiting for potential WPR write to complete')
time.sleep(1)
sys.exit(128 + sig)
def main():
for sig in (signal.SIGTERM, signal.SIGINT):
signal.signal(sig, _handle_signal)
command = captured_sites_commands.initiate_and_build_command()
command.launch()
if __name__ == '__main__':
sys.exit(main())