'Write localhost entries :attr:`hosts` into the hosts file.
:param hosts: Hosts entries from a part in the data file.
:type hosts: list'

def write_localhost_mod(self, hosts):

    self.hosts_file.write(('%s#    Section    Start:    Localhost%s' % (self.eol, self.eol)))
    for host in hosts:
        if ('#Replace' in host[1]):
            host = (host[0], self.hostname)
        ip = host[0]
        if (len(ip) < 16):
            ip = ip.ljust(16)
        self.hosts_file.write(('%s    %s%s' % (ip, host[1], self.eol)))
        self.count += 1
    self.hosts_file.write(('#    Section    End:    Localhost%s' % self.eol))
