Skip to content
Snippets Groups Projects
Select Git revision
  • 9be2119838cd5675cfa5ead44e9c65566db1d727
  • main default protected
  • develop
  • 1.0.0
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
8 results

main.py

Blame
  • main.py 920 B
    import logging
    import sys
    import os
    
    sys.path.append('../src')
    
    from PySide6.QtWidgets import QApplication
    from rich.logging import RichHandler
    
    
    import CaptDeviceControl as CaptDevice
    
    
    if __name__ == "__main__":
    
        def setup_logging():
            for log_name, log_obj in logging.Logger.manager.loggerDict.items():
                if log_name != '<module name>':
                    log_obj.disabled = True
            # Format the Rich logger
            FORMAT = "%(message)s"
            logging.basicConfig(
                level="DEBUG", format=FORMAT, datefmt="[%X]", handlers=[
                    RichHandler(rich_tracebacks=True)
                ]
            )
    
    
        setup_logging()
        app = QApplication()
    
    
        conf = CaptDevice.Config()
        conf.load("config.yaml")
    
    
        model = CaptDevice.Model(conf)
        controller = CaptDevice.Controller(model)
        window = CaptDevice.View(model, controller)
    
        window.show()
    
        sys.exit(app.exec())