add flag stop elab
This commit is contained in:
91
docs/gen_ref_pages.py
Normal file
91
docs/gen_ref_pages.py
Normal file
@@ -0,0 +1,91 @@
|
||||
"""Genera le pagine di riferimento per l'API."""
|
||||
|
||||
from pathlib import Path
|
||||
import mkdocs_gen_files
|
||||
|
||||
nav = mkdocs_gen_files.Nav()
|
||||
|
||||
# File e directory da escludere
|
||||
EXCLUDE_PATTERNS = {
|
||||
".env",
|
||||
".env.*",
|
||||
"__pycache__",
|
||||
".git",
|
||||
".pytest_cache",
|
||||
".venv",
|
||||
"venv",
|
||||
"node_modules",
|
||||
"docs", # Escludi tutta la directory docs
|
||||
"build",
|
||||
"dist",
|
||||
"*.egg-info",
|
||||
".mypy_cache",
|
||||
".coverage",
|
||||
"htmlcov"
|
||||
}
|
||||
|
||||
def should_exclude(path: Path) -> bool:
|
||||
"""Verifica se un percorso deve essere escluso."""
|
||||
# Escludi file .env
|
||||
if path.name.startswith('.env'):
|
||||
return True
|
||||
|
||||
# Escludi lo script stesso
|
||||
if path.name == "gen_ref_pages.py":
|
||||
return True
|
||||
|
||||
# Escludi tutta la directory docs
|
||||
if "old_script" in path.parts:
|
||||
return True
|
||||
|
||||
# Escludi tutta la directory docs
|
||||
if "docs" in path.parts:
|
||||
return True
|
||||
|
||||
# Escludi pattern comuni
|
||||
for pattern in EXCLUDE_PATTERNS:
|
||||
if pattern in str(path):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
# Cerca i file Python nella directory corrente
|
||||
for path in sorted(Path(".").rglob("*.py")):
|
||||
# Salta i file esclusi
|
||||
if should_exclude(path):
|
||||
continue
|
||||
|
||||
# Salta i file che iniziano con un punto
|
||||
if any(part.startswith('.') for part in path.parts):
|
||||
continue
|
||||
|
||||
# Salta i file che iniziano con prova
|
||||
if any(part.startswith('prova') for part in path.parts):
|
||||
continue
|
||||
|
||||
if any(part.startswith('matlab_elab') for part in path.parts):
|
||||
continue
|
||||
|
||||
module_path = path.with_suffix("")
|
||||
doc_path = path.with_suffix(".md")
|
||||
full_doc_path = Path("reference", doc_path)
|
||||
|
||||
parts = tuple(module_path.parts)
|
||||
|
||||
if parts[-1] == "__init__":
|
||||
parts = parts[:-1]
|
||||
doc_path = doc_path.with_name("index.md")
|
||||
full_doc_path = full_doc_path.with_name("index.md")
|
||||
elif parts[-1] == "__main__":
|
||||
continue
|
||||
|
||||
nav[parts] = doc_path.as_posix()
|
||||
|
||||
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
|
||||
ident = ".".join(parts)
|
||||
fd.write(f"::: {ident}")
|
||||
|
||||
mkdocs_gen_files.set_edit_path(full_doc_path, path)
|
||||
|
||||
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
|
||||
nav_file.writelines(nav.build_literate_nav())
|
||||
36
docs/index.md
Normal file
36
docs/index.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Benvenuto nella documentazione
|
||||
|
||||
Questa è la documentazione automatica dell'applicazione Python ASE per la gestione delle file CSV ricevuti via FTP.
|
||||
|
||||
## Funzionalità
|
||||
|
||||
- Ricezione di file csv via FTP e salvataggio in database.
|
||||
- Caricamnento dei dati in database con moduli dedicati per:
|
||||
- tipologia di centralina e sensore
|
||||
- nome di centralina e sensore
|
||||
|
||||
- Esecuzione elaborazione MatLab.
|
||||
|
||||
- Gestione utenti FTP
|
||||
- Caricamento massivo utenti FTP da database
|
||||
|
||||
## Setup
|
||||
|
||||
- personalizzazione dei file env:
|
||||
- env/db.ini
|
||||
- env/ftp.ini
|
||||
- env/load.ini
|
||||
- env/elab.ini
|
||||
|
||||
- esecuzione del server FTP -> "python ftp_csv_receiver.py"
|
||||
- esecuzione dell'orchestratore del caricamenti dei file csv -> "python load_orchestrator.py"
|
||||
- esecuzione dell'orchestratore delle elaborazioni MatLab -> "python elab_orchestrator.py"
|
||||
|
||||
E' possibile creare servizi systemd per gestire l'esecuzione automatica delle funzionalità.
|
||||
Viene usato il virtualenv quindi python deve essere eseguito con i dovuti setting
|
||||
|
||||
## Installazione
|
||||
|
||||
Installare il pacchetto ase-x.x.x-py3-none-any.whl
|
||||
|
||||
- pip install ase-x.x.x-py3-none-any.whl
|
||||
Reference in New Issue
Block a user