'Parse the Fuzzbunch.xml file to setup the Fuzzbunch initial environment'

def readconfig(self, file):

    try:
        import xml.dom.minidom
        xmlDoc = xml.dom.minidom.parse(file)
        config = edfmeta.get_elements(xmlDoc, 'config')[0]
        redir = edfmeta.get_elements(config, 'redirection')[0]
        runmode = edfmeta.get_elements(config, 'runmode')[0]
        banner = edfmeta.get_elements(config, 'banner')[0]
        scripts = edfmeta.get_elements(config, 'autorun')[0]
        automode = str(scripts.getAttribute('value'))
        if (automode.lower() == 'on'):
            automode = True
        else:
            automode = False
        autorun = {}
        for cat in edfmeta.get_elements(scripts, 'category'):
            autorun[str(cat.getAttribute('name'))] = []
            for command in edfmeta.get_elements(cat, 'command'):
                autorun[str(cat.getAttribute('name'))].append((command.getAttribute('value'), command.getAttribute('msg')))
        params = {'name': str(config.getAttribute('name')), 'version': str(config.getAttribute('version')), 'banner': str(banner.getAttribute('value')), 'globals': {}, 'redirection': {'value': str(redir.getAttribute('value'))}, 'runmode': str(runmode.getAttribute('value')), 'automode': automode, 'autorun': autorun}
        for param in edfmeta.get_elements(config, 'parameter'):
            key = str(param.getAttribute('name'))
            params['globals'][key] = str(param.getAttribute('default'))
    except:
        self.configfile = None
        params = {}
    self.configfile = file
    self.configvars = params
