@@ -339,7 +339,7 @@ def linkreplace(link,filepath):
339339 result = regex.sub(repl,result)
340340 except:
341341 pass
342- if result <> link and not rehttp.match(result):
342+ if result is not link and not rehttp.match(result):
343343 links.write('%s!%s\\n' % (filepath,ignorebookmark.sub(r'\\1',result)))
344344 return result
345345
@@ -349,7 +349,7 @@ for filepath in sorted(glob.glob('*.html')):
349349# sys.stdout.write(tag) # not much point in writing the tags to stdout
350350 sys.stderr.write(tag)
351351 pid = sub.call(['tidy', '-utf8', '-modify', '-asxhtml', '--add-xml-decl', 'yes', '-quiet', filepath])
352- if pid <> 2:
352+ if pid != 2:
353353 with open(filepath,'r') as html_file:
354354 soup = BeautifulSoup(html_file, fromEncoding='utf-8')
355355 for a in soup.findAll('a'):
@@ -500,7 +500,7 @@ def update(subst):
500500 patched = orig
501501 for s in subst.items():
502502 patched = re.sub('\\\\b'+s[0],s[1],patched)
503- if patched != orig:
503+ if patched is not orig:
504504 with open (file, 'w' ) as f: f.write(patched)
505505 return
506506
@@ -540,19 +540,14 @@ system("mkdir -p " + dirs);
540540system("cp '" + py + "' '" + self + "' .");
541541"tar";
542542dirs;
543- cmd := "find . Icons -maxdepth 1 \\( -name '*.html' -o -name '*.svg' \\) -print0 | tar cJf ModelicaDocumentation.tar.xz --dereference --null style.css " + dirs + " GenerateDoc.mos generate_icons.py fix-case-sensitive.py FindFiles.log tidy.filtered tidy.links -T -";
543+ cmd := "find . Icons -maxdepth 1 \\( -name '*.html' -o -name '*.svg' \\) -print | tar cJf ModelicaDocumentation.tar.xz --dereference style.css " + dirs + " GenerateDoc.mos generate_icons.py fix-case-sensitive.py FindFiles.log tidy.filtered tidy.links -T -";
544544system(cmd);
545545getErrorString();
546546
547547// Make zip (case-insensitive)
548548system("python ./fix-case-sensitive.py");
549- "FindFiles.sh";
550- system("bash FindFiles.sh");
551549system("rm -f ModelicaDocumentation.zip");
552- system("mkdir -p " + dirs);
553- system("cp '" + py + "' '" + self + "' .");
554- "tar";
555- dirs;
550+ "zip";
556551cmd := "find . -maxdepth 1 -name '*.html' -print | zip -qr ModelicaDocumentation.zip style.css -@ Icons " + dirs + " GenerateDoc.mos generate_icons.py fix-case-sensitive.py FindFiles.log tidy.filtered tidy.links";
557552system(cmd);
558553getErrorString();
0 commit comments