Permalink
Browse files

Bug-fixes as needed by old content...

  • Loading branch information...
1 parent 297e84b commit 5f15f963ed757b580a07622909f0018d85ac43b6 @SavinaRoja committed Dec 9, 2011
Showing with 13 additions and 8 deletions.
  1. +1 −0 article.py
  2. +5 −5 content.py
  3. +6 −2 contributor.py
  4. +1 −1 opf.py
View
@@ -153,6 +153,7 @@ class Back(object):
'''The back element for an article, contains footnotes, funding, competing
and interests'''
def __init__(self, node):
+ self.node = node
self.footnotes = node.getElementsByTagName('fn')
self.funding = u''
self.competing_interests = u''
View
@@ -1001,9 +1001,9 @@ def supplementaryMaterialNodeHandler(self, topnode, doc):
'pmed': 'http://www.plosmedicine.org/',
'pntd': 'http://www.plosntds.org/'}
try:
- jrn = attrs['id'].split('.')[0].split('-')[0]
+ jrn = attrs['xlink:href'].split('journal.')[1].split('.')[0]
except KeyError:
- print('supplementary-tag tag found without attribute \"id\"')
+ print('supplementary-tag tag found without attribute \"xlink:href\"')
else:
fetch = 'article/fetchSingleRepresentation.action?uri='
try:
@@ -1488,9 +1488,9 @@ def divTitleFormat(self, fromnode, depth = 0):
item.removeChild(divtitle)
else:
divtitle.tagName = taglist[depth]
- depth += 1
- self.divTitleFormat(item, depth)
- depth -= 1
+ depth += 1
+ self.divTitleFormat(item, depth)
+ depth -= 1
def initiateDocument(self, titlestring):
'''A method for conveniently initiating a new xml.DOM Document'''
View
@@ -67,8 +67,12 @@ def get_fileas_name(self):
names = self.givenname.split(' ')
initials = ''
for name in names:
- initials += name[0]
- return(u'{0}, {1}'.format(self.surname, initials))
+ try:
+ initials += name[0]
+ except IndexError:
+ return(self.surname)
+ else:
+ return(u'{0}, {1}'.format(self.surname, initials))
else:
return(serializeText(self.collab, stringlist = []))
View
2 opf.py
@@ -60,7 +60,7 @@ def takeArticle(self, article):
tables = article.body.getElementsByTagName('table')
#If there are refs, make biblio xml file
if article.back:
- refs = article.back.getElementsByTagName('ref')
+ refs = article.back.node.getElementsByTagName('ref')
else:
refs = None
self.addToSpine(aid_dashed, tables, refs)

0 comments on commit 5f15f96

Please sign in to comment.