# Path: core/interfaces/base.py
# class BaseInterface(ABC, Module):
# 
#     def  __init__(self, hplayer, name="INTERFACE", color="blue"):
#         super().__init__(hplayer, name, color)
#         self.hplayer = hplayer
# 
#         # stopping flag
#         self.stopped = threading.Event()
#         self.stopped.set()
# 
#         # Listen thread
#         self.recvThread = threading.Thread(target=self.listen)
# 
# 
#     # Receiver THREAD (ABSTRACT)
#     @abstractmethod
#     def listen(self):
#         self.stopped.wait()
# 
#     # Start
#     def start(self):
#         self.stopped.clear()
#         self.recvThread.start()
#         return self
# 
#     # Stop
#     def quit(self):
#         self.log("stopping...")
#         self.stopped.set()
#         self.recvThread.join()
#         self.log("stopped")
# 
# 	# is Running
#     def isRunning(self, state=None):
#         if state is not None:
#             self.stopped.clear() if state else self.stopped.set()
#         return not self.stopped.is_set()
# 
# Path: core/engine/network.py
# def get_allip():
#     ip = []
#     ifaces = ni.interfaces()
#     for iface in ifaces:
#         if iface.startswith("e"):
#             try:
#                 ip.append(ni.ifaddresses(iface)[AF_INET][0]['addr'])
#             except:
#                 pass
#     else:
#         for iface in ifaces:
#             if iface.startswith("w"):
#                 try:
#                     ip.append(ni.ifaddresses(iface)[AF_INET][0]['addr'])
#                 except:
#                     pass
#     return ip
# 
# def get_hostname():
#     import socket
#     return socket.gethostname()


from .base import BaseInterface
from ..engine.network import get_allip, get_hostname
from http.server import BaseHTTPRequestHandler, HTTPServer
    from zeroconf import ServiceInfo, Zeroconf 
import threading
import socket
import pprint

try:
    zero_enable = True
except:
    print("import error: zeroconf is missing")
    zero_enable = False


# Path: core/interfaces/base.py
# class BaseInterface(ABC, Module):
# 
#     def  __init__(self, hplayer, name="INTERFACE", color="blue"):
#         super().__init__(hplayer, name, color)
#         self.hplayer = hplayer
# 
#         # stopping flag
#         self.stopped = threading.Event()
#         self.stopped.set()
# 
#         # Listen thread
#         self.recvThread = threading.Thread(target=self.listen)
# 
# 
#     # Receiver THREAD (ABSTRACT)
#     @abstractmethod
#     def listen(self):
#         self.stopped.wait()
# 
#     # Start
#     def start(self):
#         self.stopped.clear()
#         self.recvThread.start()
#         return self
# 
#     # Stop
#     def quit(self):
#         self.log("stopping...")
#         self.stopped.set()
#         self.recvThread.join()
#         self.log("stopped")
# 
# 	# is Running
#     def isRunning(self, state=None):
#         if state is not None:
#             self.stopped.clear() if state else self.stopped.set()
#         return not self.stopped.is_set()
# 
# Path: core/engine/network.py
# def get_allip():
#     ip = []
#     ifaces = ni.interfaces()
#     for iface in ifaces:
#         if iface.startswith("e"):
#             try:
#                 ip.append(ni.ifaddresses(iface)[AF_INET][0]['addr'])
#             except:
#                 pass
#     else:
#         for iface in ifaces:
#             if iface.startswith("w"):
#                 try:
#                     ip.append(ni.ifaddresses(iface)[AF_INET][0]['addr'])
#                 except:
#                     pass
#     return ip
# 
# def get_hostname():
#     import socket
#     return socket.gethostname()


# Path: core/interfaces/http.py
from .base import BaseInterface
from ..engine.network import get_allip, get_hostname
from http.server import BaseHTTPRequestHandler, HTTPServer
    from zeroconf import ServiceInfo, Zeroconf 
import threading
import socket
import pprint


try:
    zero_enable = True
except:
    print("import error: zeroconf is missing")
    zero_enable = False


class HttpInterface (BaseInterface):