UNDEF = 255
state = UNDEF
+strict = 0
voice_idx_dict = {}
header = {}
header['footnotes'] = ''
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
HSPACE=' \t'
midi_specs = ''
+
+
+def error (msg):
+ sys.stderr.write (msg)
+ if strict:
+ sys.exit (1)
+
def check_clef(s):
if not s:
key_count = flat_key_seq.index (keytup)
accseq = map (lambda x: (3*x + 3 ) % 7, range (1, key_count + 1))
else:
+ error ("Huh?")
raise "Huh"
key_table = [0] * 7
ln = junk_space (ln)
if ln:
- msg = "%s: %d: Huh? Don't understand\n" % (fn, lineno)
- sys.stderr.write (msg)
+ error ("%s: %d: Huh? Don't understand\n" % (fn, lineno))
left = orig_ln[0:-len (ln)]
sys.stderr.write (left + '\n')
sys.stderr.write (' ' * len (left) + ln + '\n')
-h, --help this help
-o, --output=FILE set output filename to FILE
-v, --version version information
-
+ -s, --strict be strict about succes.
+
This program converts ABC music files (see
http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt) To LilyPond input.
"""
-(options, files) = getopt.getopt (sys.argv[1:], 'vo:h', ['help','version', 'output='])
+(options, files) = getopt.getopt (sys.argv[1:], 'vo:hs', ['help','version', 'output=', 'strict'])
out_filename = ''
for opt in options:
if o== '--help' or o == '-h':
help ()
sys.exit (0)
- if o == '--version' or o == '-v':
+ elif o == '--version' or o == '-v':
print_version ()
sys.exit(0)
-
- if o == '--output' or o == '-o':
+ elif o == '--strict' or o == '-s':
+ strict = 1
+ elif o == '--output' or o == '-o':
out_filename = a
else:
print o