From 564a9ba977d7ee37797e707d19f65c1fd9870e74 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sun, 8 Nov 2020 16:41:30 +0100 Subject: [PATCH] temporarily removed the progressbar due to problems with logging --- src/studip.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/studip.py b/src/studip.py index 3fcde54..f382c62 100755 --- a/src/studip.py +++ b/src/studip.py @@ -1,7 +1,7 @@ import time import logging as log -from tqdm import tqdm +#from tqdm import tqdm import requests as req from requests.auth import HTTPBasicAuth @@ -80,7 +80,6 @@ class Studip: rsp = self.auth_req('/api.php/user/' + user_id + '/courses') ord_sems = self.get_ordered_semesters() courses = rsp.json()['collection'] - i = 0 course_list = {} for course_uri in courses: course = courses[course_uri] @@ -147,12 +146,12 @@ class Studip: last_dl = self.db.get_last_file_dl(doc) if last_dl == None or last_dl < doc_chdate: rsp2 = self.auth_req('/api.php/file/' + doc + '/download') - total_size = int(rsp2.headers.get('content-length', 0)) - print('downloading ' + doc_name) - progbar = tqdm(total=total_size, unit='iB', unit_scale=True) + #total_size = int(rsp2.headers.get('content-length', 0)) + log.info('downloading ' + doc_name) + #progbar = tqdm(total=total_size, unit='iB', unit_scale=True) with open(doc_name, 'wb') as doc_file: for chunk in rsp2.iter_content(self.CHUNK_SIZE): - progbar.update(len(chunk)) + #progbar.update(len(chunk)) doc_file.write(chunk) self.db.set_last_file_dl(str(doc), str(int(time.time())))