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:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,5 @@
 | 
			
		||||
.idea/
 | 
			
		||||
 | 
			
		||||
__pycache__
 | 
			
		||||
 | 
			
		||||
.venv
 | 
			
		||||
 
 | 
			
		||||
@@ -133,19 +133,19 @@ export default function Election2024({typeResultats = "france"}) {
 | 
			
		||||
  const [dataSieges, setDataSieges] = useState([])
 | 
			
		||||
 | 
			
		||||
  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))
 | 
			
		||||
    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))
 | 
			
		||||
    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))
 | 
			
		||||
 | 
			
		||||
    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))
 | 
			
		||||
    }
 | 
			
		||||
    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))
 | 
			
		||||
    }
 | 
			
		||||
  }, [])
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ from pathlib import Path
 | 
			
		||||
import requests
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
CACHE_DIR = Path(__file__).parent / 'cache'
 | 
			
		||||
CACHE_DIR = Path(__file__).parent.parent / 'cache'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
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, \
 | 
			
		||||
    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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user