Commit 3c988f9b authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

move VILLASode python code to VILLASnode repo

parent 71494a79
import json
import tempfile
import subprocess
import logging
LOGGER = logging.getLogger('villas.node')
class Node(object):
def __init__(self, cfg):
self.config = cfg
def start(self):
self.config_file = tempfile.NamedTemporaryFile(mode='w+', suffix='.json')
json.dump(self.config, self.config_file)
self.config_file.flush()
LOGGER.info("Starting VILLASnode with config: %s", self.config_file.name)
self.child = subprocess.Popen(['villas-node', self.config_file.name])
def stop(self):
self.child.kill()
self.child.wait()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment