Skip to content

Commit

Permalink
- More robust GenerateDoc.mos
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10974 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 27, 2012
1 parent 941864b commit 03e55d5
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions Examples/GenerateDoc.mos
Expand Up @@ -235,21 +235,24 @@ for f in glob.glob('*.html'):
verblog.write('Checking file '+f+'\\n')
p = subprocess.Popen(['-modify','-quiet',f],bufsize=1000,executable='tidy',stdin=None,stdout=verblog,stderr=log)
p.wait()
file = open(f,'r')
soup = BeautifulSoup(file)
for a in soup.findAll('a'):
try:
a['href'] = linkreplace(a['href'])
except:
pass
for img in soup.findAll('img'):
try:
img['src'] = linkreplace(img['src'])
except:
pass
file.close()
file = open(f,'w')
file.write(soup.__str__())
try:
file = open(f,'r')
soup = BeautifulSoup(file)
for a in soup.findAll('a'):
try:
a['href'] = linkreplace(a['href'])
except:
pass
for img in soup.findAll('img'):
try:
img['src'] = linkreplace(img['src'])
except:
pass
file.close()
file = open(f,'w')
file.write(soup.__str__())
except:
log.write('Unknown python error')
");

writeFile("FindFiles.sh","#!/bin/bash
Expand Down

0 comments on commit 03e55d5

Please sign in to comment.