From 02b3bce1a0a407e283b370e31f7b9767e789a443 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 13 Nov 2017 22:36:01 +0100 Subject: [PATCH] Better output for log uploading. --- upload_logs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/upload_logs.py b/upload_logs.py index 710437c..96dc4fb 100644 --- a/upload_logs.py +++ b/upload_logs.py @@ -15,8 +15,10 @@ LOGS_GLOB = os.path.normpath("logs/*.xml") headers = { "Content-Type": "text/xml" } -for fn in glob.glob(LOGS_GLOB): - print("Uploading {}…".format(fn), end="") +file_list = glob.glob(LOGS_GLOB) +print("Found {} logs to upload.".format(len(file_list))) +for fn in file_list: + print("Uploading {}…".format(fn), end="", flush=True) with open(fn, "rb") as f: r = requests.post(UPLOAD_URL, data=f, headers=headers) if r.status_code == 200: