diff options
author | Petr Šmerkl <46304018+SveterCZE@users.noreply.github.com> | 2021-05-10 23:17:49 +0200 |
---|---|---|
committer | Petr Šmerkl <46304018+SveterCZE@users.noreply.github.com> | 2021-05-10 23:17:49 +0200 |
commit | 1b1e8252f58c28b1cb791f4225c684071b6376d3 (patch) | |
tree | afa26c198231c929b8dcd1c9d4957cae366b441d /update_db.py | |
parent | ac8cbdd4510d63b81d2acb3e7fc11a15d7e9b165 (diff) | |
download | justice-1b1e8252f58c28b1cb791f4225c684071b6376d3.tar.gz |
use official API to find the valid files
Diffstat (limited to 'update_db.py')
-rw-r--r-- | update_db.py | 11 |
1 files changed, 1 insertions, 10 deletions
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() |