Skip to content

Commit

Permalink
- Updated GenerateDoc
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11008 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 3, 2012
1 parent 1245a56 commit 4181702
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Examples/GenerateDoc.mos
Expand Up @@ -224,7 +224,10 @@ repls = ["+replaceCommands+"

def linkreplace(link):
for (regex,repl) in repls:
link = regex.sub(repl,link)
try:
link = regex.sub(repl,link)
except:
pass
return link

log = open('tidy.log','w')
Expand All @@ -241,6 +244,7 @@ for f in glob.glob('*.html'):
try:
file = open(f,'r')
soup = BeautifulSoup(file)
file.close()
for a in soup.findAll('a'):
try:
a['href'] = linkreplace(a['href'])
Expand All @@ -251,11 +255,13 @@ for f in glob.glob('*.html'):
img['src'] = linkreplace(img['src'])
except:
pass
file.close()
file = open(f,'w')
file.write(soup.__str__())
try:
file = open(f,'w')
file.write(soup.__str__())
except:
log.write('Error writing back file: ' + f + '\\n')
except:
log.write('Unknown python error in: ' + f)
log.write('Unknown python error in: ' + f + '\\n')
");

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

0 comments on commit 4181702

Please sign in to comment.