
| Current Path : /home/cgabriel/20_dev/11_iftlib/score/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //home/cgabriel/20_dev/11_iftlib/score/expand.py |
import sys
import re
import os
import codecs
text0 = codecs.open(sys.argv[1],"r","utf-8").read()
text = re.sub(r"V:XX ","V:A_,T_,C1,C2,C3,C4,Fl,Tr,Sx,Co,Ps,Bk,1_,2_,3_,4_,5_,Pc",text0,9999999)
#text = re.sub(r"\nI: +","\nI:",text0,99999999,re.DOTALL)
while 0 == 0:
m = re.search(r"^(.*?\n)(V:)([a-zA-Z0-9\_]+,[a-zA-Z0-9\_,]+)(.*?)\n(.*?I: *\n)(.*)$",text,re.DOTALL)
if not m:
break
text = m.group(1)
for o in m.group(3).split(","):
o1 = re.sub(r"\_$"," ",o)
o1 = re.sub(r"\_$"," ",o1)
o1 = re.sub(r"\_$"," ",o1)
if not ("V:" + o1) in m.group(5):
text = text + "V:" + o1 + m.group(4) + "\n"
text = text + m.group(5) + m.group(6)
# print text
open("yyy.abc","w").write(text)
os.system("abcm2ps yyy.abc -j 0 -O " + re.sub(r"\.abc$","",sys.argv[1]) + ".ps")