예제 #1
0
class Main:
    def __init__(self):
        Main.initLogging()

        self.wifiWatcher = WifiWatcher()
        self.wifiWatcher.start()

        self.btWatcher = BluetoothWatcher()
        self.btWatcher.start()

    @staticmethod
    def initDir(dir):
        if not os.path.exists(dir):
            try:
                os.makedirs(dir)
                logger.debug("Created directory: %s" % dir)
            except Exception as err:
                logger.error(err)
        else:
            logger.debug("Directory exists: %s" % dir)

    @staticmethod
    def initDirs(dirs=[]):
        for dir in dirs:
            Main.initDir(dir)

    @staticmethod
    def initLogging():
        Main.initDir("logs")
        logging.config.fileConfig("conf" + os.sep + "logging.conf")
        logger.info("Logging initialized")
예제 #2
0
class Main:
    def __init__(self):
        Main.initLogging()
        
        self.wifiWatcher = WifiWatcher()
        self.wifiWatcher.start()
        
        self.btWatcher = BluetoothWatcher()
        self.btWatcher.start()
        
    
    @staticmethod
    def initDir(dir):
        if not os.path.exists(dir):
            try:
                os.makedirs(dir)
                logger.debug("Created directory: %s" % dir)
            except Exception as err:
                logger.error(err)
        else:
            logger.debug("Directory exists: %s" % dir)
            
    @staticmethod
    def initDirs(dirs=[]):
        for dir in dirs:
            Main.initDir(dir)
    
    @staticmethod
    def initLogging():
        Main.initDir("logs")
        logging.config.fileConfig("conf" + os.sep + "logging.conf")
        logger.info("Logging initialized")
예제 #3
0
 def __init__(self):
     Main.initLogging()
     
     self.wifiWatcher = WifiWatcher()
     self.wifiWatcher.start()
     
     self.btWatcher = BluetoothWatcher()
     self.btWatcher.start()
예제 #4
0
    def __init__(self):
        Main.initLogging()

        self.wifiWatcher = WifiWatcher()
        self.wifiWatcher.start()

        self.btWatcher = BluetoothWatcher()
        self.btWatcher.start()