# Path: chi/logger.py
# def set_loglevel(level: str):
#   def __init__(self, file, terminal):
#   def write(self, message):
#   def flush(self):
# def capture_std(fn, append=False):
#   def write(m):
#   def flush():
# class StdLogger:


import os
import socket
from time import sleep
from watchdog.events import FileSystemEventHandler
from watchdog.observers.inotify import InotifyObserver
from chi.logger import logger
        self.on_found(f.is_dir, f.path)

  def unschedule_all(self):
    for w in self.watches:
      Repo.observer.unschedule(w)

  def on_found(self, is_dir, path):
    pass

  def on_created(self, event):
    super().on_created(event)

  def on_moved(self, event):
    super().on_moved(event)

  def on_modified(self, event):
    super().on_modified(event)

  def on_deleted(self, event):
    super().on_deleted(event)


def get_free(pool):
  for i in range(20):
    av = [p for p in pool if check_free(p)]
    logger.debug('Free ports' + str(av))
    if av:
      break
    sleep(.1)
  if not av:

# Path: chi/logger.py
# def set_loglevel(level: str):
#   def __init__(self, file, terminal):
#   def write(self, message):
#   def flush(self):
# def capture_std(fn, append=False):
#   def write(m):
#   def flush():
# class StdLogger:


# Path: chi/board/util.py
import os
import socket
from time import sleep
from watchdog.events import FileSystemEventHandler
from watchdog.observers.inotify import InotifyObserver
from chi.logger import logger

        self.on_found(f.is_dir, f.path)

  def unschedule_all(self):
    for w in self.watches:
      Repo.observer.unschedule(w)

  def on_found(self, is_dir, path):
    pass

  def on_created(self, event):
    super().on_created(event)

  def on_moved(self, event):
    super().on_moved(event)

  def on_modified(self, event):
    super().on_modified(event)

  def on_deleted(self, event):
    super().on_deleted(event)


def get_free(pool):
  for i in range(20):
    av = [p for p in pool if check_free(p)]
    logger.debug('Free ports' + str(av))
    if av:
      break
    sleep(.1)
  if not av:

    logger.error('No ports available')