First implementation of questions management

This commit is contained in:
2020-08-14 08:16:33 +02:00
parent e84b394da2
commit 351c16f946
47 changed files with 1582 additions and 400 deletions
+3 -1
View File
@@ -49,9 +49,11 @@ class SheerkaAdmin(BaseService):
try:
start = time.time_ns()
nb_lines = 0
self.sheerka.during_restore = True
with open(concept_file, "r") as f:
for line in f.readlines():
nb_lines += 1
line = line.strip()
if line == "" or line.startswith("#"):
continue
@@ -65,7 +67,7 @@ class SheerkaAdmin(BaseService):
nano_sec = stop - start
dt = nano_sec / 1e6
elapsed = f"{dt} ms" if dt < 1000 else f"{dt / 1000} s"
print(f"Execution time: {elapsed}")
print(f"Imported {nb_lines} line(s) in {elapsed}.")
except IOError:
pass