summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <floe@butterbrot.org>2013-04-29 01:07:08 +0200
committer <floe@butterbrot.org>2013-04-29 01:07:08 +0200
commitc75936e5dd254b72188de7473098a51f522428f8 (patch)
tree0f28dd1808a260ad0c248c21889b102f6119cb34
parent6c3dda4d8ab2fb46fc5fe152c848fb986d021bc5 (diff)
switch xml parser to one that actually works
-rwxr-xr-xissues.py9
1 files changed, 5 insertions, 4 deletions
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,
]))