diff --git a/eoaconvert.py b/eoaconvert.py index aed62db..f303492 100755 --- a/eoaconvert.py +++ b/eoaconvert.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2018-01-22 16:45:16 (kthoden)> +# Time-stamp: <2018-01-22 16:59:11 (kthoden)> # license? __version__= "1.0" @@ -969,7 +969,10 @@ def cleanup(): for x in jsonObj: print(x["title"]) -# the old solution + +#################### +# the old solution # +#################### # Copy interim .bbl-File to interim bib.tex file interim_bibtex_file = (options.filename) + "bib.tex" try: @@ -1040,6 +1043,10 @@ def cleanup(): xmlBibTree = etree.parse((options.filename + "bib.xml"), xmlParser2) xmlEntries = xmlBibTree.findall(".//entry") +########################### +# end of the old solution # +########################### + make_bibchecker(bib_database, set_citations) # If Bibliography-Type is monograph search for EOAbibliography and make it all @@ -1057,30 +1064,24 @@ def cleanup(): # Don't check for previous author if first entry of the Bibliography bibEntry = Bibitem(xmlEntry) strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=False) + "

" - xmlNew = etree.fromstring(strNewentry) - xmlBibliography.append(xmlNew) else: bibEntry = Bibitem(xmlEntry) # Check if author of previous Entry is the same bibEntryPrevious = Bibitem(xmlEntries[intNumberOfEntry - 1]) if bibEntry.fullauthorlastfirst()[0] == bibEntryPrevious.fullauthorlastfirst()[0]: strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=True) + "

" - xmlNew = etree.fromstring(strNewentry) - xmlBibliography.append(xmlNew) elif bibEntryPrevious.fullauthorlastfirst()[0] == bibEntry.fullauthorlastfirst()[0]: strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=True) + "

" - xmlNew = etree.fromstring(strNewentry) - xmlBibliography.append(xmlNew) elif bibEntry.fullauthorlastfirst()[0] == bibEntryPrevious.fullauthorlastfirst()[0]: strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=True) + "

" - xmlNew = etree.fromstring(strNewentry) - xmlBibliography.append(xmlNew) else: print("dieser fall") strNewentry = "

" + createBibEntryAuthorYear(bibEntry, boolSameAuthor=False) + "

" print("a new entry", strNewentry) - xmlNew = etree.fromstring(strNewentry) - xmlBibliography.append(xmlNew) + + xmlNew = etree.fromstring(strNewentry) + xmlBibliography.append(xmlNew) + intNumberOfEntry += 1 # If Bibliography-Type is anthology search for EOAbibliography and make one per chapter