constants.py 694 B

12345678910111213141516171819202122232425
  1. '''
  2. Configuration standard de pardit.
  3. @author: olivier.massot,sept. 2017
  4. '''
  5. from tempfile import mkdtemp
  6. from path import Path
  7. # Répertoire de l'application
  8. APP_DIR = Path(__file__).parent.parent
  9. # Chemin d'accès au modèle PDF
  10. TEMPLATE_PATH = APP_DIR / r"templates\template.pdf"
  11. # Chemin d'accès au fichier de config
  12. CONFIG_FILE_PATH = APP_DIR / "pardit.yaml"
  13. # Chemin d'accès au fichier de config utilisateur (et création s'il n'existe pas)
  14. USER_DATA_DIR = Path("%appdata%").expandvars() / "pardit"
  15. USER_DATA_PATH = USER_DATA_DIR / "userdata.yml"
  16. # Repertoire temporaire: est nettoyé à la fermeture de pardit, sauf en cas d'erreur.
  17. TMPDIR = Path(mkdtemp(prefix='pardit_'))