# Path: kano_settings/system/boot_config/boot_config_filter.py
# class Filter(object):
#     ALL = 'all'
#     EDID_TEMPLATE = 'EDID={edid}'
# 
#     @classmethod
#     def get_edid_filter(cls, edid):
#         if not edid:
#             return cls.ALL
# 
#         return cls.EDID_TEMPLATE.format(edid=edid)


import re
from kano_settings.system.boot_config.boot_config_filter import Filter
    EMPTY = ''
    COMMENT_SYMBOL = '#'
    CONFIG_LINE_PATTERN = r'^\s*(#)?\s*([\w=]+)\s*=\s*(.*)\s*$'
    CONFIG_LINE_RE = re.compile(CONFIG_LINE_PATTERN)
    MANUAL_COMMENT_PATTERN = r'^\s*###\s*[\w=:][\w=:\s]+\s*$'
    MANUAL_COMMENT_RE = re.compile(MANUAL_COMMENT_PATTERN)

    # This object represents four classes of item:
    
    #  NAME            EXAMPLES             is_comment is_commented_out is_manual_comment
    
    #  Valid setting   "foo=bar","foo=1"    False      False            False
    #  Commented out   "# foo=bar"          True       True             False
    #  Manual Comment  "### foo: bar        True       False            True
    #  Comment         "# NB pi explodes"   True       False            False

    # Valid settings are looked at by the firmware.
    # "Manual Comment" items are data stored in the config.txt not used by the firmware
    # "Commented out" items are example settings which have been commented out.
    # "Comment" items are any other comment


    def __init__(self, line, config_filter=Filter.ALL, debug=False):
        self.line = line
        self.debug = debug

        self.setting, self._value, \
                self.filter, self.is_comment, \
                self.is_manual_comment, self.is_commented_out = self.parse_line(line)


# Path: kano_settings/system/boot_config/boot_config_filter.py
# class Filter(object):
#     ALL = 'all'
#     EDID_TEMPLATE = 'EDID={edid}'
# 
#     @classmethod
#     def get_edid_filter(cls, edid):
#         if not edid:
#             return cls.ALL
# 
#         return cls.EDID_TEMPLATE.format(edid=edid)


# Path: kano_settings/system/boot_config/boot_config_line.py
import re
from kano_settings.system.boot_config.boot_config_filter import Filter

    EMPTY = ''
    COMMENT_SYMBOL = '#'
    CONFIG_LINE_PATTERN = r'^\s*(#)?\s*([\w=]+)\s*=\s*(.*)\s*$'
    CONFIG_LINE_RE = re.compile(CONFIG_LINE_PATTERN)
    MANUAL_COMMENT_PATTERN = r'^\s*###\s*[\w=:][\w=:\s]+\s*$'
    MANUAL_COMMENT_RE = re.compile(MANUAL_COMMENT_PATTERN)

    # This object represents four classes of item:
    
    #  NAME            EXAMPLES             is_comment is_commented_out is_manual_comment
    
    #  Valid setting   "foo=bar","foo=1"    False      False            False
    #  Commented out   "# foo=bar"          True       True             False
    #  Manual Comment  "### foo: bar        True       False            True
    #  Comment         "# NB pi explodes"   True       False            False

    # Valid settings are looked at by the firmware.
    # "Manual Comment" items are data stored in the config.txt not used by the firmware
    # "Commented out" items are example settings which have been commented out.
    # "Comment" items are any other comment


    def __init__(self, line, config_filter=Filter.ALL, debug=False):
        self.line = line
        self.debug = debug

        self.setting, self._value, \
                self.filter, self.is_comment, \
                self.is_manual_comment, self.is_commented_out = self.parse_line(line)


        if config_filter != Filter.ALL: