def _parse_bug_dictionary_from_xml(self, page): soup = BeautifulStoneSoup(page, convertEntities=BeautifulStoneSoup.XML_ENTITIES) bug = {} bug["id"] = int(soup.find("bug_id").string) bug["title"] = self._string_contents(soup.find("short_desc")) bug["bug_status"] = self._string_contents(soup.find("bug_status")) dup_id = soup.find("dup_id") if dup_id: bug["dup_id"] = self._string_contents(dup_id) bug["reporter_email"] = self._string_contents(soup.find("reporter")) bug["assigned_to_email"] = self._string_contents(soup.find("assigned_to")) bug["cc_emails"] = [self._string_contents(element) for element in soup.findAll('cc')] bug["attachments"] = [self._parse_attachment_element(element, bug["id"]) for element in soup.findAll('attachment')] bug["comments"] = [self._parse_log_descr_element(element) for element in soup.findAll('long_desc')] return bug
def _parse_bug_dictionary_from_xml(self, page): soup = BeautifulStoneSoup(page, convertEntities=BeautifulStoneSoup.XML_ENTITIES) bug = {} bug["id"] = int(soup.find("bug_id").string) bug["title"] = self._string_contents(soup.find("short_desc")) bug["bug_status"] = self._string_contents(soup.find("bug_status")) dup_id = soup.find("dup_id") if dup_id: bug["dup_id"] = self._string_contents(dup_id) bug["reporter_email"] = self._string_contents(soup.find("reporter")) bug["assigned_to_email"] = self._string_contents(soup.find("assigned_to")) bug["cc_emails"] = [self._string_contents(element) for element in soup.findAll("cc")] bug["attachments"] = [ self._parse_attachment_element(element, bug["id"]) for element in soup.findAll("attachment") ] bug["comments"] = [self._parse_log_descr_element(element) for element in soup.findAll("long_desc")] return bug
def _parse_bug_dictionary_from_xml(self, page): soup = BeautifulStoneSoup( page, convertEntities=BeautifulStoneSoup.XML_ENTITIES) bug_element = soup.find('bug') if bug_element and bug_element.get('error', '') == 'NotPermitted': _log.warning("You don't have permission to view this bug.") return {} bug = {} bug["id"] = int(soup.find("bug_id").string) bug["title"] = self._string_contents(soup.find("short_desc")) bug["bug_status"] = self._string_contents(soup.find("bug_status")) dup_id = soup.find("dup_id") if dup_id: bug["dup_id"] = self._string_contents(dup_id) bug["reporter_email"] = self._string_contents(soup.find("reporter")) bug["assigned_to_email"] = self._string_contents( soup.find("assigned_to")) bug["cc_emails"] = [ self._string_contents(element) for element in soup.findAll('cc') ] bug["attachments"] = [ self._parse_attachment_element(element, bug["id"]) for element in soup.findAll('attachment') ] bug["comments"] = [ self._parse_log_descr_element(element) for element in soup.findAll('long_desc') ] bug['groups'] = frozenset( [self._string_contents(group) for group in soup.findAll('group')]) return bug