File:  [Repository] / MPIWGWeb / bibliography.py
Revision 1.7.2.1: download - view: text, annotated - select for diffs - revision graph
Mon Oct 10 08:42:49 2005 UTC (18 years, 8 months ago) by dwinter
Branches: r2
*** empty log message ***

    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,foundIB=None):
   16:     ret=""
   17:     if not foundIB:
   18:         try:
   19:             foundIB=self.ZSQLInlineSearch(_table=table,id=id)[0]
   20: 
   21:         except:
   22:             return ret
   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+")"
   30:         if foundIB.pages and (not foundIB.pages)=='':
   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>."
   35:         if foundIB.place_published and (not foundIB.place_published==''):
   36:             ret+=foundIB.place_published+": "
   37:         if foundIB.publisher and (not foundIB.publisher==''):
   38:             ret+=foundIB.publisher+", "
   39:         ret+=foundIB.year+"."
   40: 
   41:     elif foundIB.reference_type.lower()=='book section':
   42:         ret+=getBib(foundIB.author_semi_colon)+". &quot;"+getBib(foundIB.title)+".&quot; In <i>"+getBib(foundIB.secondary_title)+"</i>"
   43:         if (foundIB.secondary_author_semi_colon) and (not foundIB.secondary_author_semi_colon==''):
   44:             ret+=", eds.: "+foundIB.secondary_author_semi_colon
   45:         ret+=". "
   46:         if foundIB.pages and (not foundIB.pages)=='':
   47:             ret+=foundIB.pages+". "
   48:         if foundIB.place_published and (not foundIB.place_published==''):
   49:             ret+=foundIB.place_published+": "
   50:         if foundIB.publisher and (not foundIB.publisher==''):
   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>. "
   55:         if foundIB.pages and (not foundIB.pages==''):
   56:             ret+=foundIB.pages+". "
   57:         if foundIB.place_published and (not foundIB.place_published==''):
   58:             ret+=foundIB.place_published+": "
   59:         if foundIB.publisher and (not foundIB.publisher==''):
   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+","
   66:         if foundIB.pages and (not foundIB.pages==''):
   67:             ret+=foundIB.pages+". "
   68: 
   69: 
   70:             
   71:             
   72:     return ret

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