Annotation of MPIWGWeb/bibliography.py, revision 1.7.2.1

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

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