]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/bin/text2html.py
Make distributed tarball from Git file list
[lilypond.git] / stepmake / bin / text2html.py
index 80de4094506382eb78e157962e7113ce13442180..51f3948ef4aa68507f4f8ebfdd652ad626346981 100644 (file)
@@ -6,41 +6,41 @@ import sys
 
 
 entities = {
-       "&" : 'amp',
-       "`" : 'apos',
-       '>' : 'gt',
-       '<' : 'lt',
-       '"' : 'quot',
-       }
+    "&" : 'amp',
+    "`" : 'apos',
+    '>' : 'gt',
+    '<' : 'lt',
+    '"' : 'quot',
+    }
 
 def txt2html (s):
-       for i in entities.keys ():
-               s = re.sub (i, '\001' + entities[i] + ';', s);
-       s = re.sub ('\001', '&', s);
-       return s
+    for i in entities.keys ():
+        s = re.sub (i, '\001' + entities[i] + ';', s);
+    s = re.sub ('\001', '&', s);
+    return s
 
 for a in sys.argv[1:]:
-       # hmm, we need: text2html out/foe.txt -> out/foe.html,
-       # -o is a bit overkill?
-       # outfile = os.path.basename (os.path.splitext(a)[0]) + '.html'
-       outfile = os.path.splitext(a)[0] + '.html'
-       
-       try:
-           os.unlink(outfile)
-       except:
-           pass
-
-       s = r"""
+    # hmm, we need: text2html out/foe.txt -> out/foe.html,
+    # -o is a bit overkill?
+    # outfile = os.path.basename (os.path.splitext(a)[0]) + '.html'
+    outfile = os.path.splitext(a)[0] + '.html'
+    
+    try:
+      os.unlink(outfile)
+    except:
+      pass
+
+    s = r"""
 
 <html>
 <head>
 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
 </head>
 
 <body><pre>
 %s
 </pre></body></html>
 """ % txt2html (open (a).read ())
-       open (outfile, 'w').write (s)
+    open (outfile, 'w').write (s)