'Retrieve configuration from the main dialog to make a new hosts file.
:param parent: An instance of :class:`~tui.curses_d.CursesDaemon`
class to retrieve configuration with.
:type parent: :class:`~tui.curses_d.CursesDaemon`
.. warning:: :attr:`parent` MUST NOT be set as `None`.'

def __init__(self, parent):

    self.count = 0
    self.make_cfg = parent.make_cfg
    self.hostname = parent.hostname
    self.custom = parent.custom
    make_path = parent.make_path
    self.make_mode = parent.make_mode
    if (self.make_mode == 'system'):
        self.eol = parent.sys_eol
        self.hosts_file = open('hosts', 'wb')
    elif (self.make_mode == 'ansi'):
        self.eol = '\r\n'
        self.hosts_file = open(unicode(make_path), 'wb')
    elif (self.make_mode == 'utf-8'):
        self.eol = '\n'
        self.hosts_file = open(unicode(make_path), 'wb')
