Skip to content

Commit

Permalink
Added replace of /tmp/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Mar 25, 2016
1 parent f94e8a2 commit d5d703c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/cleanHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from os.path import isfile, join

def validateLine(line, filNam):
li = ['home/mwetter', 'dymola/Modelica', '///opt/dymola', 'github/lbl-srg', '<a href="http://www.3ds.com/">Automatically generated</a>']
li = ['/tmp/', 'home/mwetter', 'dymola/Modelica', '///opt/dymola', 'github/lbl-srg', '<a href="http://www.3ds.com/">Automatically generated</a>']
em = ""
for s in li:
if s in line:
Expand Down Expand Up @@ -59,6 +59,21 @@ def validateLine(line, filNam):
'/home/mwetter/proj/ldrd/bie/modeling/github/lbl-srg/modelica-buildings/Buildings':
'..',
'<pre></pre>':''}
# Search for text such as
# <img alt="image" src="/tmp/postBuildingsTagToWeb.sh.25555/modelica-buildings-3.0.0-rc.1/Buildings/Resources/Images/UsersGuide/HydronicHeating.png" border="1"/>
# in order to update the link.
with open(tesFil, 'r') as fil:
lines = fil.readlines()
for lin in lines:
iSta = lin.find('Resources/Images/UsersGuide')
if iSta > -1:
src_tag = 'src="'
i_src = lin.find(src_tag)
if i_src > -1:
# entry should be /tmp/postBuildingsTagToWeb.sh.25555/modelica-buildings-3.0.0-rc.1/Buildings
entry = lin[i_src+len(src_tag):iSta]
replacements[entry] = '../'
break

# Substitute text
for fil in files:
Expand Down

0 comments on commit d5d703c

Please sign in to comment.