'Create a new TriblerConfig instance.
:param config: a ConfigObj instance
:raises an InvalidConfigException if ConfigObj is invalid'

def __init__(self, config=None):

    self._logger = logging.getLogger(self.__class__.__name__)
    if (config is None):
        file_name = os.path.join(self.get_default_state_dir(), FILENAME)
        if os.path.exists(file_name):
            config = ConfigObj(file_name, configspec=CONFIG_SPEC_PATH)
        else:
            config = ConfigObj(configspec=CONFIG_SPEC_PATH)
    self.config = config
    self.validate()
    self.selected_ports = {}
    self._set_video_analyser_path()
