diff options
author | <floe@butterbrot.org> | 2013-04-29 01:07:08 +0200 |
---|---|---|
committer | <floe@butterbrot.org> | 2013-04-29 01:07:08 +0200 |
commit | c75936e5dd254b72188de7473098a51f522428f8 (patch) | |
tree | 0f28dd1808a260ad0c248c21889b102f6119cb34 | |
parent | 6c3dda4d8ab2fb46fc5fe152c848fb986d021bc5 (diff) |
switch xml parser to one that actually works
-rwxr-xr-x | issues.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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, ])) |