Annotation of MPIWGWeb/bibliography.py, revision 1.7

1.1       dwinter     1: 
                      2: def formatBibliography(self,found):
                      3:     ret=""
                      4:     if found.id_institutsbibliographie and (not found.id_institutsbibliographie==''):
                      5:         ret+=formatBiblHelp(self,found,table='institutsbiblio',id=found.id_institutsbibliographie)
                      6:     else:
                      7:         ret+=formatBiblHelp(self,found,table='bibliography',id=found.id_gen_bib)
                      8:     return ret
                      9: 
                     10: def getBib(value):
                     11:     if value:
                     12:         return value
                     13:     else:
                     14:         return ""
                     15: def formatBiblHelp(self,found,table,id):
                     16:     ret=""
                     17:     try:
                     18:         foundIB=self.ZSQLInlineSearch(_table=table,id=id)[0]
                     19: 
                     20:     except:
                     21:         return ret
                     22:     
                     23:     if foundIB.reference_type.lower()=='journal article':
                     24:         
                     25:         ret+=getBib(foundIB.author_semi_colon)+". &quot;"+getBib(foundIB.title)+". &quot; "+"<i>%s</i>"%getBib(foundIB.secondary_title)+" "+getBib(foundIB.volume)+" ("
                     26:         if not self.ZSQLisEmpty(foundIB.number):
                     27:             ret+=foundIB.number+"&nbsp;"
                     28:         ret+=foundIB.year+")"
1.5       dwinter    29:         if foundIB.pages and (not foundIB.pages)=='':
1.1       dwinter    30:             ret+=": "+foundIB.pages+"."
                     31: 
                     32:     elif foundIB.reference_type.lower()=='edited book':
                     33:         ret+=foundIB.author_semi_colon+" (Editor/s). <i>"+foundIB.title+"</i>."
1.6       dwinter    34:         if foundIB.place_published and (not foundIB.place_published==''):
1.1       dwinter    35:             ret+=foundIB.place_published+": "
1.6       dwinter    36:         if foundIB.publisher and (not foundIB.publisher==''):
1.1       dwinter    37:             ret+=foundIB.publisher+", "
                     38:         ret+=foundIB.year+"."
                     39: 
                     40:     elif foundIB.reference_type.lower()=='book section':
1.7     ! dwinter    41:         ret+=getBib(foundIB.author_semi_colon)+". &quot;"+getBib(foundIB.title)+".&quot; In <i>"+getBib(foundIB.secondary_title)+"</i>"
1.4       dwinter    42:         if (foundIB.secondary_author_semi_colon) and (not foundIB.secondary_author_semi_colon==''):
1.1       dwinter    43:             ret+=", eds.: "+foundIB.secondary_author_semi_colon
                     44:         ret+=". "
1.5       dwinter    45:    if foundIB.pages and (not foundIB.pages)=='':
1.1       dwinter    46:             ret+=foundIB.pages+". "
1.2       dwinter    47:         if foundIB.place_published and (not foundIB.place_published==''):
1.1       dwinter    48:             ret+=foundIB.place_published+": "
1.2       dwinter    49:         if foundIB.publisher and (not foundIB.publisher==''):
1.1       dwinter    50:             ret+=foundIB.publisher+", "
                     51:         ret+=foundIB.year+"."
                     52:     elif foundIB.reference_type.lower()=='book':
                     53:         ret+=foundIB.author_semi_colon+". <i>"+foundIB.title+"</i>. "
1.3       dwinter    54:         if foundIB.pages and (not foundIB.pages==''):
1.1       dwinter    55:             ret+=foundIB.pages+". "
                     56:         if not foundIB.place_published=='':
                     57:             ret+=foundIB.place_published+": "
                     58:         if not foundIB.publisher=='':
                     59:             ret+=foundIB.publisher+", "
                     60:         ret+=foundIB.year+"."
                     61: 
                     62:     elif foundIB.reference_type.lower()=='newspaper article':
                     63:         ret+=foundIB.author_semi_colon+". &quot;"+foundIB.title+".&quot; <i>"+foundIB.secondary_title+"</i>, "
                     64:         ret+=foundIB.date+"."+foundIB.year+","
                     65:         if not foundIB.pages=='':
                     66:             ret+=foundIB.pages+". "
                     67: 
                     68: 
                     69:             
                     70:             
                     71:     return ret

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>