From 1b1e8252f58c28b1cb791f4225c684071b6376d3 Mon Sep 17 00:00:00 2001 From: Petr Šmerkl <46304018+SveterCZE@users.noreply.github.com> Date: Mon, 10 May 2021 23:17:49 +0200 Subject: use official API to find the valid files --- update_db.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'update_db.py') diff --git a/update_db.py b/update_db.py index b85eb52..aa4a877 100644 --- a/update_db.py +++ b/update_db.py @@ -3,17 +3,8 @@ import os from lxml import etree import sqlite3 -def update_DB(typy_po, soudy, DB_name): - rok = str(datetime.now().year) - for osoba in typy_po: - for soud in soudy: - try: - parse_to_DB(os.path.join(str(os.getcwd()), "data", osoba) + "-full-" + soud + "-" + rok + ".xml", DB_name) - except: - pass - # The function opens a file and parses the extracted data into the database -def parse_to_DB(file, DB_name): +def update_DB(file, DB_name): print("Processing ", str(file)) conn = sqlite3.connect(DB_name) c = conn.cursor() -- cgit