def update(self, infile):
        """Given a config file as a list of lines - infile - it updates any values it has in object.config
        It checks for lines that are valid parameters and in object.config and overwrites that line with it's stored value.
        Other lines are left untouched. Any keys not written by the ned of the file are tagged on the end.
        It doesn't terminate lines with a '\n' by the way :-)
        Nor does it report errors in infile - if you want to check infile you can create a new ConfigObj
        This just checks for valid known parameters and overwrites - ultra lightweight *ahem*....
        Useful though if you have a ConfigObj loaded from a file - the user has modified his settings
        and you want to write the new values out as a file.
        This method returns the new version of the file as a list of lines."""
	configkeys = self.config.keys()
	outconfig = []
        for line in infile:
            origline=line.strip()
            origparam = self.findparam(line)
            if not origparam:       # this line was whitespace or comment or invalid
                outconfig.append(line)
                continue
            member = origparam.lower()
            if member not in configkeys:    # a valid parameter - but not one we're looking for in this config object. Allows larger config files with multiple configs in - keywords must be unique per file though
                outconfig.append(line)
                continue
            else:
                configkeys.remove(member)
            if member.find("'") == -1:
                outline = "'" + member + "'" + '    :    '
            elif member.find('"') == -1:
                outline = '"' + member + '"' + '    :    '
            else:
                outline = member + '    :    '
            if self.configspec[member] == '[]':
                outline += '['
                if not self.config[member]:
                    outline += ']'
                else:
                    for item in self.config[member]['value']:
                        if item.find("'") == -1:
                            outline += "'" + item + "'" + ', '
                        elif item.find('"') == -1:
                            outline += '"' + item + '"' + ', '
                        else:
                            outline += item + ', '
                    outline = outline[:-1]
                    outline += ']'
            else:
                if not self.config[member]:
                    outline += "''"
                else:
                    if self.config[member]['value'].find("'") == -1:
                        outline += "'" + self.config[member]['value'] + "'"
                    elif self.config[member]['value'].find('"') == -1:
                        outline += '"' + self.config[member]['value'] + '"'
                    else:
                        outline += self.config[member]['value']
            if self.config[member]and self.config[member]['comment'] != '':
                outline += '    ' + self.config[member]['comment']
                
            outconfig.append(outline)

        for member in configkeys: # this gets any that have been missed out
            if member.find("'") == -1:
                outline = "'" + member + "'" + '    :    '
            elif member.find('"') == -1:
                outline = '"' + member + '"' + '    :    '
            else:
                outline = member + '    :    '
            if self.configspec[member] == '[]':
                outline += '['
                if not self.config[member]:
                    outline += ']'
                else:
                    for item in self.config[member]['value']:
                        if item.find("'") == -1:
                            outline += "'" + item + "'" + ', '
                        elif item.find('"') == -1:
                            outline += '"' + item + '"' + ', '
                        else:
                            outline += item + ', '
                    outline = outline[:-1]
                    outline += ']'
            else:
                if not self.config[member]:
                    outline += "''"
                else:
                    if self.config[member]['value'].find("'") == -1:
                        outline += "'" + self.config[member]['value'] + "'"
                    elif self.config[member]['value'].find('"') == -1:
                        outline += '"' + self.config[member]['value'] + '"'
                    else:
                        outline += self.config[member]['value']
            if self.config[member]and self.config[member]['comment'] != '':
                outline += '    ' + self.config[member]['comment']
                
            outconfig.append(outline)
        return outconfig
Given a config file as a list of lines - infile - it updates any values it has in object.config
        It checks for lines that are valid parameters and in object.config and overwrites that line with it's stored value.
        Other lines are left untouched. Any keys not written by the ned of the file are tagged on the end.
        It doesn't terminate lines with a '
' by the way :-)
        Nor does it report errors in infile - if you want to check infile you can create a new ConfigObj
        This just checks for valid known parameters and overwrites - ultra lightweight *ahem*....
        Useful though if you have a ConfigObj loaded from a file - the user has modified his settings
        and you want to write the new values out as a file.
        This method returns the new version of the file as a list of lines.
recipes/Python/259175_ConfigObj__Lightweight_Config_File/recipe-259175.py