diff options
Diffstat (limited to 'gui/muxconfig.py')
-rw-r--r-- | gui/muxconfig.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gui/muxconfig.py b/gui/muxconfig.py index efa4b93..64321a2 100644 --- a/gui/muxconfig.py +++ b/gui/muxconfig.py @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/env python +# -*- coding: utf-8 -*- # # Copyright (C) 2015 # Matthias P. Braendli, matthias.braendli@mpb.li @@ -22,6 +23,22 @@ import socket import json +class General(object): + """Container object for general options""" + def __init__(self, pt): + ptree = pt['general'] + for fieldname in ["nbframes", + "statsserverport", + "writescca", + "tist", + "dabmode", + "syslog"]: + if fieldname in ptree: + setattr(self, fieldname.replace("-", "_"), ptree[fieldname]) + else: + setattr(self, fieldname.replace("-", "_"), "") + self.telnetport = pt['remotecontrol']['telnetport'] + class Service(object): """Container object for a service""" def __init__(self, name, ptree): @@ -110,3 +127,6 @@ class ConfigurationHandler(object): def get_components(self): comp_pt = self._config['components'] return [Component(name, comp_pt[name]) for name in comp_pt] + + def get_general_options(self): + return General(self._config) |