Skip to content

Commit f7e3c3b

Browse files
committed
FIXED: To print progress & log
1 parent 985893e commit f7e3c3b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

nvdnist.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def _processFunction(self):
6969
sys.stdout.write("\rCurrent progress: %d / %d" % (self._entry - len(self._wpList), self._entry))
7070
sys.stdout.flush()
7171
time.sleep(5)
72+
73+
# To print a finish progress
74+
sys.stdout.write("\rDone!")
75+
sys.stdout.flush()
7276

7377
def start(self):
7478
self._coreThread = Thread(target=self._pobject)
@@ -265,7 +269,7 @@ def load(self, obj):
265269

266270
if os.path.exists(raw_file) is False:
267271
util.extract(filename, "./")
268-
272+
269273
if os.path.exists(raw_file):
270274
if util.vaildjson(raw_file):
271275
print("The resource file already exist, continue without the downloed")
@@ -418,8 +422,8 @@ def table_insert(self, tablename, jsonCollection):
418422
fs.write("실패: Column에 값을 넣을 수 없습니다. -> {cve} | Reason: {r}\n".format(cve=v, r=ex))
419423
break
420424
fs.close()
421-
execption_list.clear()
422-
print("\n경고: \n{count} elements could not be inserted into the table. See {f} for more reasons.".format(count=len(execption_list), f=filename))
425+
print("\n경고: {count} elements could not be inserted into the table. See {f} for more reasons.".format(count=len(execption_list), f=filename))
426+
xecption_list.clear()
423427

424428
print("\nAll data has been inserted.")
425429

0 commit comments

Comments
 (0)