Commit 8d7eb4a2 by serpucga

Beeps substituted by synth voice, which is c00ler and more explicit about what happened

parent d3ed1927
......@@ -35,8 +35,6 @@ else:
logger = logging.getLogger(__name__)
# Initialize some variables
duration = 1
freq = 440
script_dir = os.path.dirname(__file__)
output_dir = os.path.join(script_dir, "pymongodump", args.database)
header_file = os.path.join(script_dir, "config", "header.txt")
......@@ -100,7 +98,7 @@ try:
writer_worker.start()
except Exception:
logger.error("There was a failure in the filesystem writer", exc_info=True)
os.system("play -nq -t alsa synth {} sine {}".format(duration, freq))
os.system("spd-say 'Something really bad happened!'")
sys.exit(1)
# Launch pool of workers to perform the format conversion
......@@ -110,12 +108,12 @@ try:
except utils.ExceptionAtPage as exc:
logger.error("Error detected at page {}".format(exc.error_page))
task_queue.put((exc.error_page, "ERROR"))
os.system("play -nq -t alsa synth {} sine {}".format(duration, freq))
os.system("spd-say 'Something really bad happened!'")
sys.exit(1)
except (Exception, KeyboardInterrupt):
logger.error("Error detected", exc_info=True)
task_queue.put((-2, "ERROR"))
os.system("play -nq -t alsa synth {} sine {}".format(duration, freq))
os.system("spd-say 'Something really bad happened!'")
sys.exit(1)
task_queue.put((-1, "END"))
......@@ -129,7 +127,7 @@ try:
except (Exception, KeyboardInterrupt):
logger.error("The collection was converted correctly to CSV, but something"
+ " failed when generating the metadata file", exc_info=True)
os.system("play -nq -t alsa synth {} sine {}".format(duration, freq))
os.system("spd-say 'Something really bad happened!'")
sys.exit(1)
if globals.timing:
logger.critical(
......@@ -139,5 +137,5 @@ if globals.timing:
"Total execution time: {}s"
.format(time.time() - time0))
os.system("play -nq -t alsa synth {} sine {}".format(duration, freq))
os.system('spd-say "Conversion completed successfully!"')
logger.info("Conversion completed successfully!!")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment