File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2424import shutil
2525import urllib .parse
2626from xml_utils import xml_escape , xml_unescape
27+ from multiprocessing import Pool
2728
2829# copy the source tree
2930os .system ('rm -rf output/reference' )
@@ -157,7 +158,8 @@ def rlink_fix(match):
157158 return pre + target + post
158159
159160# clean the html files
160- for fn in html_files :
161+
162+ def clean_file (fn ):
161163 f = open (fn , "r" )
162164 text = f .read ()
163165 f .close ()
@@ -173,8 +175,11 @@ def rlink_fix(match):
173175 ret = os .system ('xsltproc --novalid --html --encoding UTF-8 preprocess.xsl "' + fn + '" > "' + tmpfile + '"' )
174176 if ret != 0 :
175177 print ("FAIL: " + fn )
176- continue
177- os .system ('mv "' + tmpfile + '" "' + fn + '"' )
178+ else :
179+ os .system ('mv "' + tmpfile + '" "' + fn + '"' )
180+
181+ with Pool () as pool :
182+ pool .map (clean_file , html_files )
178183
179184# append css modifications
180185
You can’t perform that action at this time.
0 commit comments