31 lines
806 B
Python
31 lines
806 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import json
|
||
|
import pathlib
|
||
|
import threading
|
||
|
|
||
|
from . import config
|
||
|
from . import dect
|
||
|
|
||
|
class FieldPOC:
|
||
|
config = None
|
||
|
extensions = None
|
||
|
|
||
|
def __init__(self, config_file_path, extensions_file_path):
|
||
|
self.config_file_path = pathlib.Path(config_file_path)
|
||
|
self._load_config()
|
||
|
self.extensions_file_path = pathlib.Path(extensions_file_path)
|
||
|
self._load_extensions()
|
||
|
|
||
|
self._dect = dect.Dect(self)
|
||
|
|
||
|
def run(self):
|
||
|
self._dect_thread = threading.Thread(target=self._dect.run)
|
||
|
self._dect_thread.start()
|
||
|
|
||
|
def _load_config(self):
|
||
|
self.config = config.Config(json.loads(self.config_file_path.read_text()))
|
||
|
|
||
|
def _load_extensions(self):
|
||
|
self.extensions = json.loads(self.extensions_file_path.read_text())
|