|
|
| version 1.7.2.1, 2005/10/10 08:42:49 | version 1.7.2.7, 2006/09/07 11:06:41 |
|---|---|
| Line 1 | Line 1 |
| #TO DO author_semi_kolon etc. ersetzen durch Funktionen | |
| def formatBibliography(self,found): | def formatBibliography(self,found): |
| ret="" | ret="" |
| if found.id_institutsbibliographie and (not found.id_institutsbibliographie==''): | if found.id_institutsbibliographie and (not found.id_institutsbibliographie==''): |
| Line 7 def formatBibliography(self,found): | Line 7 def formatBibliography(self,found): |
| ret+=formatBiblHelp(self,found,table='bibliography',id=found.id_gen_bib) | ret+=formatBiblHelp(self,found,table='bibliography',id=found.id_gen_bib) |
| return ret | return ret |
| def CRListToSemicolon(self,listStr,showall=False): | |
| if listStr: | |
| listStr.replace(";","\n") | |
| list=listStr.split("\n") | |
| if not showall: #filter eigentuemer der hoempage | |
| for x in list: | |
| if x==self.title: # loesche den Eigentuemer der Hoempage aus der Liste | |
| del(list[list.index(x)]) | |
| if len(list)==0: # kein anderer Autor | |
| return None | |
| elif showall: | |
| return "; ".join(list) | |
| else: | |
| return "(joint with %s)"%"; ".join(list) | |
| else: | |
| return None | |
| def getBib(value): | def getBib(value): |
| if value: | if value: |
| return value | return value |
| else: | else: |
| return "" | return "" |
| return ret | |
| def cleanPunctuation(teststr): | |
| """clean up punktuation""" | |
| ret="" | |
| signs="!:;.,?" | |
| for x in teststr: | |
| if x in signs: | |
| if (len(ret)>0) and (ret[-1]==' '): | |
| ret=ret[0:-1] | |
| ret+=x | |
| return ret | |
| def formatBiblHelp(self,found,table,id,foundIB=None): | def formatBiblHelp(self,found,table,id,foundIB=None): |
| ret="" | ret="" |
| if not foundIB: | if not foundIB: |
| Line 22 def formatBiblHelp(self,found,table,id,f | Line 54 def formatBiblHelp(self,found,table,id,f |
| return ret | return ret |
| if foundIB.reference_type.lower()=='journal article': | if foundIB.reference_type.lower()=='journal article': |
| if CRListToSemicolon(foundIB.author): | |
| ret+=getBib(foundIB.author_semi_colon)+". ""+getBib(foundIB.title)+". " "+"<i>%s</i>"%getBib(foundIB.secondary_title)+" "+getBib(foundIB.volume)+" (" | ret+=getBib(CRListToSemicolon(foundIB.author))+". "" |
| ret+=getBib(foundIB.title)+". " "+"<i>%s</i>"%getBib(foundIB.secondary_title)+" "+getBib(foundIB.volume)+" (" | |
| if not self.ZSQLisEmpty(foundIB.number): | if not self.ZSQLisEmpty(foundIB.number): |
| ret+=foundIB.number+" " | ret+=foundIB.number+" " |
| ret+=foundIB.year+")" | |
| if foundIB.year: | |
| ret+=getattr(foundIB,'year','') | |
| ret+=")" | |
| if foundIB.pages and (not foundIB.pages)=='': | if foundIB.pages and (not foundIB.pages)=='': |
| ret+=": "+foundIB.pages+"." | ret+=": "+foundIB.pages+"." |
| elif foundIB.reference_type.lower()=='edited book': | elif foundIB.reference_type.lower()=='edited book': |
| ret+=foundIB.author_semi_colon+" (Editor/s). <i>"+foundIB.title+"</i>." | if CRListToSemicolon(self,foundIB.author): |
| ret+=CRListToSemicolon(self,foundIB.author)+" (Editor/s). "" | |
| if foundIB.title and (not foundIB.title==""): | |
| ret+="<i>"+foundIB.title+"</i>." | |
| if foundIB.place_published and (not foundIB.place_published==''): | if foundIB.place_published and (not foundIB.place_published==''): |
| ret+=foundIB.place_published+": " | ret+=foundIB.place_published+": " |
| if foundIB.publisher and (not foundIB.publisher==''): | if foundIB.publisher and (not foundIB.publisher==''): |
| ret+=foundIB.publisher+", " | ret+=foundIB.publisher+", " |
| ret+=foundIB.year+"." | ret+=getBib(foundIB.year)+"." |
| elif foundIB.reference_type.lower()=='book section': | elif foundIB.reference_type.lower()=='book section' or foundIB.reference_type.lower()=='in book': |
| ret+=getBib(foundIB.author_semi_colon)+". ""+getBib(foundIB.title)+"." In <i>"+getBib(foundIB.secondary_title)+"</i>" | if CRListToSemicolon(self,foundIB.author): |
| if (foundIB.secondary_author_semi_colon) and (not foundIB.secondary_author_semi_colon==''): | ret+=getBib(CRListToSemicolon(self,foundIB.author))+". "" |
| ret+=", eds.: "+foundIB.secondary_author_semi_colon | ret+=getBib(foundIB.title)+"." In: <i>"+getBib(foundIB.secondary_title)+"</i>" |
| if (CRListToSemicolon(self,foundIB.secondary_author,showall=True)) and (not CRListToSemicolon(self,foundIB.secondary_author,showall=True)==''): | |
| ret+=", eds.: "+CRListToSemicolon(self,foundIB.secondary_author,showall=True) | |
| ret+=". " | ret+=". " |
| if foundIB.pages and (not foundIB.pages)=='': | if foundIB.pages and (not foundIB.pages)=='': |
| ret+=foundIB.pages+". " | ret+=foundIB.pages+". " |
| Line 49 def formatBiblHelp(self,found,table,id,f | Line 90 def formatBiblHelp(self,found,table,id,f |
| ret+=foundIB.place_published+": " | ret+=foundIB.place_published+": " |
| if foundIB.publisher and (not foundIB.publisher==''): | if foundIB.publisher and (not foundIB.publisher==''): |
| ret+=foundIB.publisher+", " | ret+=foundIB.publisher+", " |
| ret+=foundIB.year+"." | ret+=getBib(foundIB.year)+"." |
| elif foundIB.reference_type.lower()=='book': | elif foundIB.reference_type.lower()=='book': |
| ret+=foundIB.author_semi_colon+". <i>"+foundIB.title+"</i>. " | if CRListToSemicolon(self,foundIB.author): |
| ret+=getBib(CRListToSemicolon(self,foundIB.author))+". " | |
| ret+="<i>"+getBib(foundIB.title)+"</i>. " | |
| if foundIB.pages and (not foundIB.pages==''): | if foundIB.pages and (not foundIB.pages==''): |
| ret+=foundIB.pages+". " | ret+=foundIB.pages+". " |
| if foundIB.place_published and (not foundIB.place_published==''): | if foundIB.place_published and (not foundIB.place_published==''): |
| ret+=foundIB.place_published+": " | ret+=foundIB.place_published+": " |
| if foundIB.publisher and (not foundIB.publisher==''): | if foundIB.publisher and (not foundIB.publisher==''): |
| ret+=foundIB.publisher+", " | ret+=foundIB.publisher+", " |
| ret+=foundIB.year+"." | ret+=getBib(foundIB.year)+"." |
| elif foundIB.reference_type.lower()=='newspaper article': | elif foundIB.reference_type.lower()=='newspaper article': |
| ret+=foundIB.author_semi_colon+". ""+foundIB.title+"." <i>"+foundIB.secondary_title+"</i>, " | if CRListToSemicolon(self,foundIB.author): |
| ret+=CRListToSemicolon(self,foundIB.author)+". "" | |
| ret+=foundIB.title+"." <i>"+foundIB.secondary_title+"</i>, " | |
| ret+=foundIB.date+"."+foundIB.year+"," | ret+=foundIB.date+"."+foundIB.year+"," |
| if foundIB.pages and (not foundIB.pages==''): | if foundIB.pages and (not foundIB.pages==''): |
| ret+=foundIB.pages+". " | ret+=foundIB.pages+". " |
| Line 69 def formatBiblHelp(self,found,table,id,f | Line 116 def formatBiblHelp(self,found,table,id,f |
| return ret | return cleanPunctuation(ret) |