776 print(
"Use: py xpmconv.py |filename.xpm|")
779 print(
"not an xpm file")
783 fname = (
sys.argv[1])[:-3] +
"xpm42"
784 newxpm42 = open(fname,
"w")
786 cpp = int(oldxpm[0].split()[3])
791 if "/* pixels */" in l:
793 temp = l[1:-3] +
"FF" +
"\n"
795 out = out + temp[(cpp+2):]
796 if "#" not in out[2:]:
798 temp = repcol[:-3].lower()
799 repcol = colours[repcol[:-3].lower()]
802 out = out[:-3] +
"00\n"
805 oldxpm = oldxpm[prev + 1:]
806 for i, l
in enumerate(oldxpm):
807 if "};" in oldxpm[i + 1]:
808 temp = l[1:-2] +
"\n"
811 temp = l[1:-3] +
"\n"