From c75936e5dd254b72188de7473098a51f522428f8 Mon Sep 17 00:00:00 2001 From: Date: Mon, 29 Apr 2013 01:07:08 +0200 Subject: switch xml parser to one that actually works --- issues.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'issues.py') diff --git a/issues.py b/issues.py index bc93864..ed9882b 100755 --- a/issues.py +++ b/issues.py @@ -21,12 +21,13 @@ except (ValueError, IndexError): if opts.github_user: github_user = opts.github_user -from BeautifulSoup import BeautifulStoneSoup +from bs4 import BeautifulSoup print 'Parsing XML export...' -soup = BeautifulStoneSoup(open(xml_file_name, 'r'), convertEntities=BeautifulStoneSoup.ALL_ENTITIES) +soup = BeautifulSoup(open(xml_file_name, 'r'), ['lxml']) +#convertEntities=BeautifulStoneSoup.ALL_ENTITIES) -trackers = soup.project_export.find('artifacts', recursive=False).findAll('artifact', recursive=False) +trackers = soup.find_all('artifact') from time import sleep from getpass import getpass @@ -121,7 +122,7 @@ def handle_tracker_item(item, issue_title_prefix): # workaround BeautifulSoup parsing error (?) if len(followup.findAll('field')) == 0: continue - comments.append('\n\n'.join([ + comments.insert(0,'\n\n'.join([ 'Submitted by %s' % followup.find('field',attrs={'name':'user_name'}).string, followup.find('field',attrs={'name':'body'}).string, ])) -- cgit v1.2.3