We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46406bb commit 7722d92Copy full SHA for 7722d92
script.py
@@ -0,0 +1,29 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+"""
4
+Little script that replaces comment characters to html,
5
+found in the *.hbs files.
6
7
8
+import os
9
+import glob
10
11
+if __name__ == '__main__':
12
13
+ os.chdir(os.path.join(os.environ['HOME'],
14
+ "Downloads", "Casper-master"))
15
+ for filename in glob.glob("*.hbs"):
16
+ print(filename)
17
18
+ # Read in the file
19
+ with open(filename, 'r') as infile :
20
+ filedata = infile.read()
21
22
+ # Replace the target string
23
+ # Replacing comments
24
+ filedata = filedata.replace('{{!--', '<!--')
25
+ filedata = filedata.replace('--}}', '-->')
26
27
+ # Write the file out again
28
+ with open(filename, 'w') as outfile:
29
+ outfile.write(filedata)
0 commit comments