Projekt

Obecné

Profil

Stáhnout (741 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 bba28c53 silhavyj
import logging
2 f7fb8759 silhavyj
from threading import Thread
3 bba28c53 silhavyj
4
from tendo import singleton
5
6
from config_manager import logger_format, logger_level
7 f7fb8759 silhavyj
from usb_detector.detector import register_listener, usb_detector_run
8
from usb_detector.event_listener import usb_connected_callback, usb_disconnected_callback
9
10 bba28c53 silhavyj
11
if __name__ == "__main__":
12
    app_instance = singleton.SingleInstance()
13
14
    logging.basicConfig(format=logger_format, level=logger_level)
15
16 f7fb8759 silhavyj
    register_listener(callback=usb_connected_callback, connected=True)
17
    register_listener(callback=usb_disconnected_callback, connected=False)
18
19
    usb_detector_thread = Thread(target=usb_detector_run)
20
    usb_detector_thread.setDaemon(True)
21
    usb_detector_thread.start()
22 bba28c53 silhavyj
23 f7fb8759 silhavyj
    usb_detector_thread.join()