Use the same DB for Axione and Arcep data
This commit is contained in:
parent
a39d004ec3
commit
d5616ec027
2 changed files with 5 additions and 8 deletions
|
@ -1,5 +1,4 @@
|
||||||
[DB]
|
[DB]
|
||||||
axione_ipe_path = /path/to/ipe.sqlite
|
path = /path/to/ipe.sqlite
|
||||||
axione_ipe_db_name = ipe
|
axione_ipe_db_name = ipe
|
||||||
arcep_ipe_path = /path/to/ipe.sqlite
|
|
||||||
arcep_ipe_db_name = arcep
|
arcep_ipe_db_name = arcep
|
|
@ -6,9 +6,8 @@ import sqlite3
|
||||||
import os
|
import os
|
||||||
from ipe_fetcher import Liazo,Axione,Arcep,AreaCoordinates
|
from ipe_fetcher import Liazo,Axione,Arcep,AreaCoordinates
|
||||||
class Config(TypedDict):
|
class Config(TypedDict):
|
||||||
axione_ipe_path: str
|
db_path: str
|
||||||
axione_ipe_db_name: str
|
axione_ipe_db_name: str
|
||||||
arcep_ipe_path: str
|
|
||||||
arcep_ipe_db_name: str
|
arcep_ipe_db_name: str
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,9 +17,8 @@ def parseConfig() -> Config:
|
||||||
with open(cfg_path, "r") as f:
|
with open(cfg_path, "r") as f:
|
||||||
cfg.read_file(f)
|
cfg.read_file(f)
|
||||||
return {
|
return {
|
||||||
"axione_ipe_path": cfg.get("DB", "axione_ipe_path"),
|
"db_path": cfg.get("DB", "path"),
|
||||||
"axione_ipe_db_name": cfg.get("DB", "axione_ipe_db_name"),
|
"axione_ipe_db_name": cfg.get("DB", "axione_ipe_db_name"),
|
||||||
"arcep_ipe_path": cfg.get("DB", "arcep_ipe_path"),
|
|
||||||
"arcep_ipe_db_name": cfg.get("DB", "arcep_ipe_db_name"),
|
"arcep_ipe_db_name": cfg.get("DB", "arcep_ipe_db_name"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +26,8 @@ def parseConfig() -> Config:
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
cfg: Config = parseConfig()
|
cfg: Config = parseConfig()
|
||||||
|
|
||||||
axione = Axione(cfg.get("axione_ipe_path"), cfg.get("axione_ipe_db_name"))
|
axione = Axione(cfg.get("db_path"), cfg.get("axione_ipe_db_name"))
|
||||||
arcep = Arcep(cfg.get("arcep_ipe_path"), cfg.get("arcep_ipe_db_name"))
|
arcep = Arcep(cfg.get("db_path"), cfg.get("arcep_ipe_db_name"))
|
||||||
liazo = Liazo()
|
liazo = Liazo()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue