check iniziale se pygount è installato nel sistema
This commit is contained in:
parent
ea1d31b82e
commit
8ff3284ce6
@ -145,6 +145,26 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Inform the user early if pygount is not available (affects comment counting)
|
||||||
|
try:
|
||||||
|
from pyucc.core import countings_impl
|
||||||
|
|
||||||
|
if not getattr(countings_impl, "_HAS_PYGOUNT", False):
|
||||||
|
print(
|
||||||
|
"ATTENZIONE: il pacchetto 'pygount' non è disponibile. I conteggi dei commenti e le metriche estese potrebbero non essere disponibili.",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
"Per risolvere: attiva la virtualenv usata per eseguire l'app e esegui 'pip install pygount'",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
"Se distribuisci con PyInstaller, ricostruisci l'eseguibile includendo 'pygount' (aggiungi un hook o hiddenimports).",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
# Non critico: continuiamo senza interrompere l'esecuzione
|
||||||
|
pass
|
||||||
# If user asked for GUI, or no positional directories were provided, launch GUI and exit
|
# If user asked for GUI, or no positional directories were provided, launch GUI and exit
|
||||||
if args.gui or len(args.baseline_dirs or []) == 0:
|
if args.gui or len(args.baseline_dirs or []) == 0:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -6,10 +6,10 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
# --- Version Data (Generated) ---
|
# --- Version Data (Generated) ---
|
||||||
__version__ = "v.0.0.0.20-0-g9538919-dirty"
|
__version__ = "v.0.0.0.22-0-gea1d31b-dirty"
|
||||||
GIT_COMMIT_HASH = "95389193747b356fc287b149371c64ad557fcb30"
|
GIT_COMMIT_HASH = "ea1d31b82e9fa64a3bb809c001f8c465fbcb0294"
|
||||||
GIT_BRANCH = "master"
|
GIT_BRANCH = "master"
|
||||||
BUILD_TIMESTAMP = "2025-12-12T09:15:00.613998+00:00"
|
BUILD_TIMESTAMP = "2025-12-15T07:30:39.921932+00:00"
|
||||||
IS_GIT_REPO = True
|
IS_GIT_REPO = True
|
||||||
|
|
||||||
# --- Default Values (for comparison or fallback) ---
|
# --- Default Values (for comparison or fallback) ---
|
||||||
|
|||||||
@ -231,6 +231,44 @@ class App(tk.Tk):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Check if pygount is available and warn the user if not.
|
||||||
|
try:
|
||||||
|
from ..core import countings_impl
|
||||||
|
|
||||||
|
if not getattr(countings_impl, "_HAS_PYGOUNT", False):
|
||||||
|
msg = (
|
||||||
|
"""
|
||||||
|
Il pacchetto 'pygount' non è disponibile.
|
||||||
|
|
||||||
|
I conteggi dei commenti e alcune metriche estese potrebbero non funzionare correttamente.
|
||||||
|
|
||||||
|
Soluzioni possibili:
|
||||||
|
1) Se usi l'ambiente di sviluppo: attiva la virtualenv e esegui 'pip install pygount'.
|
||||||
|
2) Se usi l'eseguibile PyInstaller: ricostruiscilo includendo 'pygount' (hook o hiddenimports).
|
||||||
|
3) Per controllare rapidamente: esegui
|
||||||
|
python -c 'from pyucc.core import countings_impl; print(countings_impl._HAS_PYGOUNT)'
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
messagebox.showwarning("Dipendenza mancante: pygount", msg)
|
||||||
|
except Exception:
|
||||||
|
# If messagebox fails (headless), fallback to logging
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
self.log(
|
||||||
|
"pygount non disponibile: conteggio commenti e metriche estese disabilitate",
|
||||||
|
level="WARNING",
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
self.phase_var.set("Ready (pygount missing — limited functionality)")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
except Exception:
|
||||||
|
# ignore any unexpected error when checking for pygount
|
||||||
|
pass
|
||||||
|
|
||||||
# small helper: expose a convenient log method that forwards to
|
# small helper: expose a convenient log method that forwards to
|
||||||
# the standard logging system so messages flow through the queue.
|
# the standard logging system so messages flow through the queue.
|
||||||
def log(self, msg: str, level: str = "INFO"):
|
def log(self, msg: str, level: str = "INFO"):
|
||||||
|
|||||||
6
todo.md
6
todo.md
@ -29,7 +29,7 @@
|
|||||||
- [x] salvare il file delle diff in automatico
|
- [x] salvare il file delle diff in automatico
|
||||||
- [x] mettere le hint per spiegare i vari parametri cosa sono
|
- [x] mettere le hint per spiegare i vari parametri cosa sono
|
||||||
- [x] ordinare le righe selezionando la colonna sia in ordine screscente che descrescente
|
- [x] ordinare le righe selezionando la colonna sia in ordine screscente che descrescente
|
||||||
- [ ] aggiornare profilo percorso quando premo su salva
|
- [x] aggiornare profilo percorso quando premo su salva
|
||||||
- [x] non perdere la selezione sulle estensioni quando modifico il profilo
|
- [x] non perdere la selezione sulle estensioni quando modifico il profilo
|
||||||
- [ ] verificare con dsp 10 e 11 le differenze con quelle di UCC intorno ai 70000 linee di codice 708 linee di codice modificato
|
- [x] verificare con dsp 10 e 11 le differenze con quelle di UCC intorno ai 70000 linee di codice 708 linee di codice modificato
|
||||||
- [ ] verificare se i commenti vengo conteggiati oppure no, nei file c++, c, h ecc
|
- [x] verificare se i commenti vengo conteggiati oppure no, nei file c++, c, h ecc
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user