From 9b419a899542a3a11127df6444e0d5945545898d Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Sat, 11 Feb 2012 16:30:12 -0500 Subject: [PATCH] Nicer looking status messages --- overviewer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/overviewer.py b/overviewer.py index 0fee62c..8f549cf 100755 --- a/overviewer.py +++ b/overviewer.py @@ -340,8 +340,14 @@ dir but you forgot to put quotes around the directory, since it contains spaces. # multiprocessing dispatcher dispatch = dispatcher.MultiprocessingDispatcher(local_procs=config['processes']) - def print_status(*args): - logging.info("Status callback: %r", args) + last_status_print = time.time() + def print_status(phase, completed, total): + # phase is ignored. it's always zero? + if (total == 0): + percent = 100 + else: + percent = int(100* completed/total) + logging.info("Rendered %d tiles out of %d. %d%% complete", completed, total, percent) dispatch.render_all(tilesets, print_status) dispatch.close()