Changeset 968 for trunk/UTIL
- Timestamp:
- May 23, 2013, 9:25:43 AM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/bibweb
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/bibweb/ads.py
r967 r968 17 17 title = None, 18 18 retrieve = True, 19 addpdf = None, 19 20 addlink = None): 20 21 … … 60 61 htmlcontent += "<a href='#"+str(year)+"'>"+str(year)+"</a>. " 61 62 if addlink is not None: htmlcontent += "<br>"+addlink 62 if embedded: htmlcontent += "<br><br /><hr><br>"63 63 64 64 ### YEAR LOOP … … 85 85 cmd = "bib2bib --quiet %s -c '$type=%s' -oc %s -ob %s %s" % (arg) 86 86 os.system(cmd) 87 87 88 # modify the bib file to insert pdf links 89 # the trick is to use the line adsurl and expect pdf to have the same name as ADS reference 90 # ... then besides this, it is necessary to link pdfs or rename those 91 # ... the online repository is indicated by addpdf 92 if retrieve: 93 if addpdf is not None: 94 bibcontent = '' 95 for line in open(linkads+'.bib'): 96 bibcontent += line 97 if 'adsurl' in line: 98 line = line.replace('adsurl','localpdf') 99 line = line.replace('http://cdsads.u-strasbg.fr/abs/',addpdf) 100 line = line.replace('},','.pdf},') 101 line = line.replace('%','_') 102 bibcontent += line 103 bibfile2 = open('temp','w') 104 print >> bibfile2,bibcontent 105 bibfile2.close() 106 os.system('mv temp '+linkads+'.bib') 107 88 108 # 2. make the html page from the author.bib file 89 109 if customcond is None or len(listyear) > 1: … … 104 124 %s \ 105 125 -nf adsurl 'ADS link' \ 126 -nf localpdf 'PDF version' \ 106 127 -r -d --revkeys \ 107 128 -nofooter --nodoc \ … … 109 130 %s" % (arg) 110 131 os.system(cmd) 111 132 112 133 # 3. load page content and delete intermediate HTML file 113 134 htmlfile = open(author+'.html','r') … … 127 148 find = re.compile(r'DOI') 128 149 htmlcontent = find.sub('Journal website',htmlcontent) 129 find = re.compile(r'.pdf') 130 htmlcontent = find.sub('PDF version',htmlcontent) 150 151 #find = re.compile(r'.pdf') 152 #htmlcontent = find.sub('PDF version',htmlcontent) 131 153 132 154 find = re.compile(r'<table>') … … 134 156 find = re.compile(r'<td align="right">') 135 157 htmlcontent = find.sub('<td align="center" width=17% style="font-size: 75%;">',htmlcontent) 136 158 137 159 htmlcontent += '''<hr><p>Generated with 138 160 <a href='https://www.lri.fr/~filliatr/bibtex2html/doc/manual.html'>BibTeX2HTML</a> -
trunk/UTIL/PYTHON/bibweb/header.html
r967 r968 44 44 <div id="navigation"> 45 45 <ul> 46 <li><a href=" index.html">Home</a></li>47 <li class="selected"><a href=" publications.html">Publications</a></li>48 <li><a href=" work.html">Work</a></li>49 <li><a href=" abstracts.html">Abstracts</a></li>50 <li><a href=" reports.html">Reports</a></li>51 <li><a href=" model.html">Model</a></li>52 <li><a href=" links.html">Links</a></li>53 <li><a href=" teaching.html">Teaching</a></li>46 <li><a href="../index.html">Home</a></li> 47 <li class="selected"><a href="../pub/pub.html">Publications</a></li> 48 <li><a href="../work.html">Work</a></li> 49 <li><a href="../abstracts.html">Abstracts</a></li> 50 <li><a href="../reports.html">Reports</a></li> 51 <li><a href="../model.html">Model</a></li> 52 <li><a href="../links.html">Links</a></li> 53 <li><a href="../teaching.html">Teaching</a></li> 54 54 <li><a href="http://www-mars.lmd.jussieu.fr/mars/access.html">MCD</a></li> 55 55 </ul> -
trunk/UTIL/PYTHON/bibweb/mywebsite.py
r967 r968 7 7 customcond = ''' -c 'abstract:"devil"' ''',\ 8 8 linkads = "link.spiga",\ 9 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 9 10 title = "<h2>Publications about dust devils</h2>") 10 11 … … 14 15 customcond = ''' -c 'abstract:"gravity wave"' ''',\ 15 16 linkads = "link.spiga",\ 17 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 16 18 title = "<h2>Publications about gravity waves</h2>") 17 19 … … 21 23 customcond = ''' -c 'abstract:"mesoscale"' ''',\ 22 24 linkads = "link.spiga",\ 25 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 23 26 title = "<h2>Publications about mesoscale meteorology</h2>") 24 27 … … 28 31 customcond = ''' -c 'title:"cloud"' ''',\ 29 32 linkads = "link.spiga",\ 33 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 30 34 title = "<h2>Publications about clouds</h2>") 31 35 … … 35 39 customcond = ''' -c 'title:"Earth" or title:"terrestrial" or title:"Andes"' ''',\ 36 40 linkads = "link.spiga",\ 41 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 37 42 title = "<h2>Publications about the Earth</h2>") 38 43 … … 42 47 customcond = ''' -c 'title:"Mars" or title:"martian"' ''',\ 43 48 linkads = "link.spiga",\ 49 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 44 50 title = "<h2>Publications about Mars</h2>") 45 51 … … 49 55 customcond = ''' -c 'title:"boundary layer" or title:"microscale" or title:"large-eddy simulations"' ''',\ 50 56 linkads = "link.spiga",\ 57 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 51 58 title = "<h2>Publications about planetary boundary layer</h2>") 52 59 … … 56 63 customcond = ''' -c 'title:"spectrometer"' ''',\ 57 64 linkads = "link.spiga",\ 65 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 58 66 title = "<h2>Publications about remote sensing</h2>") 59 67 … … 63 71 listyear = [2013,2012,2011,2010,2009,2008,2007],\ 64 72 linkads = "link.spiga",\ 73 addpdf = "http://dl.dropbox.com/u/11078310/my_papers/ref/",\ 65 74 title = "",\ 66 75 addlink = ''' … … 75 84 <a href="pubdd.html">Dust devils</a> / 76 85 <a href="pubgw.html">Gravity waves</a> 77 ''' )86 '''+"<br><br /><hr><br>"+open('inpress.html').read())
Note: See TracChangeset
for help on using the changeset viewer.