aboutsummaryrefslogtreecommitdiff
path: root/gui/themes/makedeftheme.py
blob: d9729bc33fd30b838c342289604de3b38351f467 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# encoding: utf-8
import sys
import re

def main():
	theme_file = open(sys.argv[1], "r")
	def_file = open("default.inc", "w")
	
	try:
		output = "\""
		for line in theme_file:
			if (len(line)):
				output += (line.rstrip("\n\r\t ").lstrip() + " ")
		
		output = re.sub("\/\*(.*?)\*\/", "", output).replace("\t", " ").replace("  ", " ")
		def_file.write(output + "\"\n")
	finally:
		theme_file.close()
		def_file.close()

if __name__ == "__main__":
	sys.exit(main())