# Path: syncano_cli/custom_sockets/exceptions.py
# class BadConfigFormatException(CLIBaseException):
#     default_message = u'Bad config format.'


import click
import six
from syncano_cli.custom_sockets.exceptions import BadConfigFormatException
# -*- coding: utf-8 -*-


class SocketConfigParser(object):

    PROMPT_FIELD = 'prompt'
    VALUE_FIELD = 'value'

    def __init__(self, socket_yml):
        self.config = socket_yml.get('config', {})

    def is_valid(self):
        valid = True
        for field_name in [self.PROMPT_FIELD, self.VALUE_FIELD]:
            valid &= self._is_valid(field_name)
        if not valid:

# Path: syncano_cli/custom_sockets/exceptions.py
# class BadConfigFormatException(CLIBaseException):
#     default_message = u'Bad config format.'


# Path: syncano_cli/custom_sockets/parsers.py
import click
import six
from syncano_cli.custom_sockets.exceptions import BadConfigFormatException

# -*- coding: utf-8 -*-


class SocketConfigParser(object):

    PROMPT_FIELD = 'prompt'
    VALUE_FIELD = 'value'

    def __init__(self, socket_yml):
        self.config = socket_yml.get('config', {})

    def is_valid(self):
        valid = True
        for field_name in [self.PROMPT_FIELD, self.VALUE_FIELD]:
            valid &= self._is_valid(field_name)
        if not valid:

            raise BadConfigFormatException()