__init__.py 418 B

123456789101112131415161718
  1. from datetime import datetime
  2. import os
  3. # from PySide6.QtWidgets import QMessageBox
  4. def create_filename(prefix: str = "propusk") -> str:
  5. file_name = os.path.join(os.environ.get('PHOTO_DIR'), F"{prefix}_{datetime.now().timestamp()}")
  6. match prefix:
  7. case 'pdf':
  8. file_name = F"{file_name}.pdf"
  9. case _ :
  10. file_name = F"{file_name}.jpg"
  11. return file_name