Changeset 461:8732f15df5f3 in documentViewer for documentViewer.py
- Timestamp:
- Jul 26, 2011, 6:09:26 PM (13 years ago)
- Branch:
- elementtree
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r460 r461 103 103 return '/'.join(path.split('/')[0:-1]) 104 104 105 def normalizeBib type(bt):105 def normalizeBibField(bt, underscore=True): 106 106 """returns normalised bib type for looking up mappings""" 107 107 bt = bt.strip().replace(' ', '-').lower() 108 if underscore: 109 bt = bt.replace('_', '-') 110 108 111 return bt 109 112 … … 115 118 # put type in @type 116 119 type = bib.get('type') 117 bibinfo['@type'] = normalizeBib type(type)120 bibinfo['@type'] = normalizeBibField(type) 118 121 # put all subelements in dict 119 122 for e in bib: 120 bibinfo[ e.tag] = getText(e)123 bibinfo[normalizeBibField(e.tag)] = getText(e) 121 124 122 125 return bibinfo 126 123 127 124 128 ##
Note: See TracChangeset
for help on using the changeset viewer.