'Function to extract strings from config.py / 000_config.py'

def parseConfig(self, spmod, strings, entry, modlist):

    if isinstance(entry, list):
        id = entry[0]
        value = entry[1]
        if isinstance(value, list):
            parseConfig = self.parseConfig
            for element in entry:
                parseConfig(spmod, strings, element, modlist)
        elif ((self.fflag == 1) and (token.tok_name[id] == 'NAME')):
            self.func_name = value
            self.fflag = 0
        elif ((token.tok_name[id] == 'NAME') and ((value == 'deployment_settings') or (value == 'settings'))):
            self.fflag = 1
        elif ((self.tflag == 0) and (self.func_name == 'modules') and (token.tok_name[id] == 'STRING')):
            if (value[1:(-1)] in modlist):
                self.mod_name = value[1:(-1)]
        elif ((token.tok_name[id] == 'NAME') and (value == 'T')):
            self.sflag = 1
        elif (self.sflag == 1):
            if (token.tok_name[id] == 'LPAR'):
                self.tflag = 1
                self.bracket = 1
            self.sflag = 0
        elif (self.tflag == 1):
            if (token.tok_name[id] == 'LPAR'):
                self.bracket += 1
                if (self.bracket > 1):
                    self.outstr += '('
            elif (token.tok_name[id] == 'RPAR'):
                self.bracket -= 1
                if (self.bracket > 0):
                    self.outstr += ')'
                else:
                    if (spmod == 'core'):
                        if ((self.func_name != 'modules') and (self.func_name not in modlist)):
                            strings.append((entry[2], self.outstr))
                    elif (((self.func_name == 'modules') and (self.mod_name == spmod)) or (self.func_name == spmod)):
                        strings.append((entry[2], self.outstr))
                    self.outstr = ''
                    self.tflag = 0
            elif (self.bracket > 0):
                self.outstr += value
