diff options
author | Petr Šmerkl <46304018+SveterCZE@users.noreply.github.com> | 2021-05-02 00:25:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 00:25:16 +0200 |
commit | 46dcd99a9b4e391ab331e6d414ccba551e78b0c6 (patch) | |
tree | 9d9b94322fd271cf3fc3aacbe6ca11d66239c8d8 | |
parent | f570429c77cffbc9893acf0d3d5802cec8559a6b (diff) | |
parent | 8b182c2af7cbcfd672ce28ea42e95e9c1c624711 (diff) | |
download | justice-46dcd99a9b4e391ab331e6d414ccba551e78b0c6.tar.gz |
Merge pull request #5 from SveterCZE/new-features-branch
rename a function
-rw-r--r-- | update_db.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/update_db.py b/update_db.py index 2d68617..b85eb52 100644 --- a/update_db.py +++ b/update_db.py @@ -127,7 +127,7 @@ def find_registered_office(c, ICO, elem2, conn, primary_sql_key, element): try: zapis_datum = str(get_prop(elem2, ".//zapisDatum")) vymaz_datum = str(get_prop(elem2, ".//vymazDatum")) - sidlo_id = sidlo3(c, elem2, primary_sql_key) + sidlo_id = find_sidlo(c, elem2, primary_sql_key) insert_instructions = [None,"adresy", "adresa_text", "sidlo_relation"] insert_relation_information_v2(c, insert_instructions, primary_sql_key, sidlo_id, zapis_datum, vymaz_datum) except Exception as f: @@ -211,7 +211,7 @@ def find_spolecnik(c, ICO, elem2, conn, primary_sql_key, element): # I probably do not need the primary sql key spolecnik_fo_id = find_fyzicka_osoba(c, ICO, elem, conn, primary_sql_key, element) # adresa_id = find_and_store_address(c, elem) - adresa_id = sidlo3(c, elem, primary_sql_key) + adresa_id = find_sidlo(c, elem, primary_sql_key) c.execute("INSERT INTO spolecnici (company_id, spolecnik_fo_id, zapis_datum, vymaz_datum, adresa_id, text_spolecnik) VALUES (?, ?, ?, ?, ?, ?)", (primary_sql_key, spolecnik_fo_id, zapis_datum, vymaz_datum, adresa_id, text_spolecnik,)) c.execute ("SELECT last_insert_rowid()") spolecnik_id = c.fetchone()[0] @@ -221,7 +221,7 @@ def find_spolecnik(c, ICO, elem2, conn, primary_sql_key, element): regCislo = str(get_prop(elem, "osoba/regCislo")) spolecnik_po_id = find_pravnicka_osoba(c, elem, spol_ico, regCislo) # adresa_id = find_and_store_address(c, elem) - adresa_id = sidlo3(c, elem, primary_sql_key) + adresa_id = find_sidlo(c, elem, primary_sql_key) c.execute("INSERT INTO spolecnici (company_id, spolecnik_po_id, zapis_datum, vymaz_datum, adresa_id, text_spolecnik) VALUES (?, ?, ?, ?, ?, ?)", (primary_sql_key, spolecnik_po_id, zapis_datum, vymaz_datum, adresa_id, text_spolecnik,)) c.execute ("SELECT last_insert_rowid()") spolecnik_id = c.fetchone()[0] @@ -351,7 +351,7 @@ def find_prokura(c, ICO, elem2, conn, primary_sql_key, element): vymaz_datum = str(get_prop(elem, "vymazDatum")) text_prokurista = str(get_prop(elem, "hodnotaUdaje/textZaOsobu/value")) prokurista_fo_id = find_fyzicka_osoba(c, ICO, elem, conn, primary_sql_key, element) - adresa_id = sidlo3(c, elem, primary_sql_key) + adresa_id = find_sidlo(c, elem, primary_sql_key) c.execute("INSERT INTO prokuriste (company_id, zapis_datum, vymaz_datum, prokurista_fo_id, adresa_id, text_prokurista) VALUES (?, ?, ?, ?, ?, ?)", (primary_sql_key, zapis_datum, vymaz_datum, prokurista_fo_id, adresa_id, text_prokurista,)) else: zapis_datum = str(get_prop(elem, "zapisDatum")) @@ -373,11 +373,11 @@ def find_sole_shareholder(c, ICO, elem2, conn, primary_sql_key, element): spol_ico = str(get_prop(elem, "osoba/ico")) regCislo = str(get_prop(elem, "osoba/regCislo")) akcionar_po_id = find_pravnicka_osoba(c, elem, spol_ico, regCislo) - adresa_id = sidlo3(c, elem, primary_sql_key) + adresa_id = find_sidlo(c, elem, primary_sql_key) c.execute("INSERT into jediny_akcionar (company_id, zapis_datum, vymaz_datum, text_akcionar, akcionar_po_id, adresa_id) VALUES (?, ?, ?, ?, ?, ?)", (primary_sql_key, zapis_datum, vymaz_datum, text_akcionar, akcionar_po_id, adresa_id,)) elif typ_akcionar == "F": akcionar_fo_id = find_fyzicka_osoba(c, ICO, elem, conn, primary_sql_key, element) - adresa_id = sidlo3(c, elem, primary_sql_key) + adresa_id = find_sidlo(c, elem, primary_sql_key) c.execute("INSERT into jediny_akcionar (company_id, zapis_datum, vymaz_datum, text_akcionar, akcionar_fo_id, adresa_id) VALUES (?, ?, ?, ?, ?, ?)", (primary_sql_key, zapis_datum, vymaz_datum, text_akcionar, akcionar_fo_id, adresa_id,)) except Exception as f: print(f) @@ -416,7 +416,7 @@ def find_konkurz(c, ICO, konkurz_elem, conn, primary_sql_key): except: pass -def sidlo3(c, elem, primary_sql_key): +def find_sidlo(c, elem, primary_sql_key): try: statNazev = get_prop(elem, ".//statNazev") obec = get_prop(elem, ".//obec") @@ -499,13 +499,13 @@ def find_clen_statut_org(c, ICO, elem, conn, relationship_table_key, element): clenstviDo = str(get_prop(elem, "clenstviDo")) if typ_osoby == "AngazmaFyzicke": osoba_id = find_fyzicka_osoba(c, ICO, elem, conn, relationship_table_key, element) - adresa_id = sidlo3(c, elem, relationship_table_key) + adresa_id = find_sidlo(c, elem, relationship_table_key) c.execute("INSERT into statutarni_organ_clen_relation (statutarni_organ_id, osoba_id, adresa_id, zapis_datum, vymaz_datum, funkce_od, funkce_do, clenstvi_od, clenstvi_do, funkce) VALUES (?,?,?,?,?,?,?,?,?,?)", (relationship_table_key, osoba_id, adresa_id, zapis_datum, vymaz_datum, funkceOd, funkceDo, clenstviOd, clenstviDo, funkce_statutar_organu,)) if typ_osoby == "AngazmaPravnicke": spol_ico = str(get_prop(elem, "osoba/ico")) regCislo = str(get_prop(elem, "osoba/regCislo")) prav_osoba_id = find_pravnicka_osoba(c, elem, spol_ico, regCislo) - adresa_id = sidlo3(c, elem, relationship_table_key) + adresa_id = find_sidlo(c, elem, relationship_table_key) c.execute("INSERT into statutarni_organ_clen_relation (statutarni_organ_id, prav_osoba_id, adresa_id, zapis_datum, vymaz_datum, funkce_od, funkce_do, clenstvi_od, clenstvi_do, funkce) VALUES (?,?,?,?,?,?,?,?,?,?)", (relationship_table_key, prav_osoba_id, adresa_id, zapis_datum, vymaz_datum, funkceOd, funkceDo, clenstviOd, clenstviDo, funkce_statutar_organu,)) except Exception as f: print(f) @@ -572,13 +572,13 @@ def find_clen_dr(c, ICO, elem, conn, relationship_table_key, element): if typ_osoby == "AngazmaFyzicke": osoba_id = find_fyzicka_osoba(c, ICO, elem, conn, relationship_table_key, element) # adresa_id = find_and_store_address(c, elem) - adresa_id = sidlo3(c, elem, relationship_table_key) + adresa_id = find_sidlo(c, elem, relationship_table_key) c.execute("INSERT into dr_organ_clen_relation (dozorci_rada_id, osoba_id, adresa_id, zapis_datum, vymaz_datum, funkce_od, funkce_do, clenstvi_od, clenstvi_do, funkce) VALUES (?,?,?,?,?,?,?,?,?,?)", (relationship_table_key, osoba_id, adresa_id, zapis_datum, vymaz_datum, funkceOd, funkceDo, clenstviOd, clenstviDo, funkce_statutar_organu,)) elif typ_osoby == "AngazmaPravnicke": spol_ico = str(get_prop(elem, "osoba/ico")) regCislo = str(get_prop(elem, "osoba/regCislo")) pravnicka_osoba_id = find_pravnicka_osoba(c, elem, spol_ico, regCislo) - adresa_id = sidlo3(c, elem, relationship_table_key) + adresa_id = find_sidlo(c, elem, relationship_table_key) c.execute("INSERT into dr_organ_clen_relation (dozorci_rada_id, pravnicka_osoba_id, adresa_id, zapis_datum, vymaz_datum, funkce_od, funkce_do, clenstvi_od, clenstvi_do, funkce) VALUES (?,?,?,?,?,?,?,?,?,?)", (relationship_table_key, pravnicka_osoba_id, adresa_id, zapis_datum, vymaz_datum, funkceOd, funkceDo, clenstviOd, clenstviDo, funkce_statutar_organu,)) except Exception as f: print(f) |