'Transforms a tuple into a text line suitable for the config file
:type keyval: tuple
:param keyval: a tuple containing key and value
:return: a text line suitable for the config file'

def keyval_to_line(self, keyval):

    (key, val) = keyval
    if (val is None):
        return ('%s\n' % key)
    else:
        return ('%s=%s\n' % (key, val))
