'configure interface and dhcpd for mount Access Point'

def CoreSettings(self):

    self.DHCP = self.PumpSettingsTAB.getPumpkinSettings()
    self.SettingsEnable['PortRedirect'] = self.FSettings.Settings.get_setting('settings', 'redirect_port')
    self.SettingsAP = {'interface': [('ifconfig    %s    up' % self.SettingsEnable['AP_iface']), ('ifconfig    %s    %s    netmask    %s' % (self.SettingsEnable['AP_iface'], self.DHCP['router'], self.DHCP['netmask'])), ('ifconfig    %s    mtu    1400' % self.SettingsEnable['AP_iface']), ('route    add    -net    %s    netmask    %s    gw    %s' % (self.DHCP['subnet'], self.DHCP['netmask'], self.DHCP['router']))], 'kill': ['iptables    --flush', 'iptables    --table    nat    --flush', 'iptables    --delete-chain', 'iptables    --table    nat    --delete-chain', ('ifconfig    %s    0' % self.SettingsEnable['AP_iface']), 'killall    dhpcd'], 'hostapd': ['interface={}\n'.format(str(self.selectCard.currentText())), 'ssid={}\n'.format(str(self.EditApName.text())), 'channel={}\n'.format(str(self.EditChannel.value()))], 'dhcp-server': ['authoritative;\n', 'default-lease-time    {};\n'.format(self.DHCP['leasetimeDef']), 'max-lease-time    {};\n'.format(self.DHCP['leasetimeMax']), ('subnet    %s    netmask    %s    {\n' % (self.DHCP['subnet'], self.DHCP['netmask'])), 'option    routers    {};\n'.format(self.DHCP['router']), 'option    subnet-mask    {};\n'.format(self.DHCP['netmask']), 'option    broadcast-address    {};\n'.format(self.DHCP['broadcast']), ('option    domain-name    "%s";\n' % str(self.EditApName.text())), 'option    domain-name-servers    {};\n'.format('8.8.8.8'), 'range    {};\n'.format(self.DHCP['range'].replace('/', '    ')), '}'], 'dnsmasq': [('interface=%s\n' % self.SettingsEnable['AP_iface']), 'dhcp-range=10.0.0.1,10.0.0.50,12h\n', 'dhcp-option=3,    10.0.0.1\n', 'dhcp-option=6,    10.0.0.1\n']}
    print '[*]    Enable    forwarding    in    iptables...'
    Refactor.set_ip_forward(1)
    for line in self.SettingsAP['kill']:
        Popen(split(line), stdout=PIPE, shell=False, stderr=PIPE)
    for line in self.SettingsAP['interface']:
        Popen(split(line), stdout=PIPE, shell=False, stderr=PIPE)
    if self.FSettings.Settings.get_setting('accesspoint', 'dhcp_server', format=bool):
        with open('core/config/dhcpd_wp.conf', 'w') as dhcp:
            for line in self.SettingsAP['dhcp-server']:
                dhcp.write(line)
            dhcp.close()
            if (not path.isdir('/etc/dhcp/')):
                mkdir('/etc/dhcp')
            move('core/config/dhcpd_wp.conf', '/etc/dhcp/')
