Skip to content

Instantly share code, notes, and snippets.

@lasconic
lasconic / generateTs.py
Created December 21, 2018 16:02
generate .h file for MuseScore's tours
#!/usr/bin/env python
import os
import xml.etree.ElementTree as ET
def addMessage(f, text, comment=''):
text = text.replace('"', r'\"')
if (comment):
f.write('QT_TRANSLATE_NOOP3("TourXML", "' + text.encode('utf8') + '", "' + comment.encode('utf8') + '"),\n')
{
"hourly":[
{
"time":"00:00",
"conso":111
},
{
"time":"00:30",
"conso":113
},
template count
m 38
w 4
l 2
lb 1