Déplacement des fichiers cache et données dans le répertoire parent
Signed-off-by: Emmy D'Anello <ynerant@emy.lu>
This commit is contained in:
parent
dec9f414ac
commit
b3a7955a9d
|
@ -1,3 +1,5 @@
|
||||||
|
.idea/
|
||||||
|
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
||||||
.venv
|
.venv
|
||||||
|
|
|
@ -133,19 +133,19 @@ export default function Election2024({typeResultats = "france"}) {
|
||||||
const [dataSieges, setDataSieges] = useState([])
|
const [dataSieges, setDataSieges] = useState([])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch("/nupes/data/resultats/europeennes2024/blocs.json").then(response => response.json())
|
fetch("/data/resultats/europeennes2024/blocs.json").then(response => response.json())
|
||||||
.then(data => setBlocs(data))
|
.then(data => setBlocs(data))
|
||||||
fetch("/nupes/data/resultats/europeennes2024/nuances.json").then(response => response.json())
|
fetch("/data/resultats/europeennes2024/nuances.json").then(response => response.json())
|
||||||
.then(data => setNuances(data))
|
.then(data => setNuances(data))
|
||||||
fetch("/nupes/data/resultats/europeennes2024/listes.json").then(response => response.json())
|
fetch("/data/resultats/europeennes2024/listes.json").then(response => response.json())
|
||||||
.then(data => setListes(data))
|
.then(data => setListes(data))
|
||||||
|
|
||||||
if (typeResultats === "france") {
|
if (typeResultats === "france") {
|
||||||
fetch("/nupes/data/resultats/europeennes2024/france.json").then(response => response.json())
|
fetch("/data/resultats/europeennes2024/france.json").then(response => response.json())
|
||||||
.then(data => setResultats(data))
|
.then(data => setResultats(data))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fetch(`/nupes/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json())
|
fetch(`/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json())
|
||||||
.then(data => setResultats(data))
|
.then(data => setResultats(data))
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
|
@ -3,7 +3,7 @@ from pathlib import Path
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
CACHE_DIR = Path(__file__).parent / 'cache'
|
CACHE_DIR = Path(__file__).parent.parent / 'cache'
|
||||||
|
|
||||||
|
|
||||||
def get_file(url, filename, force_etag: str = ""):
|
def get_file(url, filename, force_etag: str = ""):
|
||||||
|
|
|
@ -9,7 +9,7 @@ from nupes.models.geographie import Region, Departement, Commune
|
||||||
from nupes.models.europeennes2024 import Bloc, Nuance, Liste, \
|
from nupes.models.europeennes2024 import Bloc, Nuance, Liste, \
|
||||||
ResultatsFrance, ResultatsRegion, ResultatsDepartement, ResultatsCommune
|
ResultatsFrance, ResultatsRegion, ResultatsDepartement, ResultatsCommune
|
||||||
|
|
||||||
DATA_DIR = Path(__file__).parent.parent / 'data'
|
DATA_DIR = Path(__file__).parent.parent.parent / 'data'
|
||||||
|
|
||||||
|
|
||||||
def exporter_listes(engine: Engine, debug: bool = False) -> None:
|
def exporter_listes(engine: Engine, debug: bool = False) -> None:
|
||||||
|
|
Loading…
Reference in New Issue