12345678910111213141516171819202122232425262728293031323334353637383940 |
- from init_var import *
- import os, sys, locale
- from logger import create_logger
- from PySide6.QtWidgets import QApplication
- from PySide6.QtCore import QLocale, QTranslator, QCoreApplication
- # from appdirs import user_data_dir
- def main():
- app = QApplication(sys.argv)
- create_logger()
- load_variables()
-
- from module.WorkWithDB import init_db
- from module.CleanerImage import CleanerImage
- from window.MainWindow import MainWindow
-
- init_db()
-
- CleanerImage(os.environ.get('PHOTO_DIR')) \
- .clear()
-
- translator = QTranslator(app)
- path_lang = os.path.join(os.environ.get("ABSOLUTE_PATH"), "window", "lang")
- if translator.load(QLocale(), 'propusk', '.', path_lang):
- app.installTranslator(translator)
- else:
- #
- print(1)
-
- window = MainWindow()
- window.show()
- sys.exit(app.exec())
- if __name__ == "__main__":
- main()
|