Mercurial > dottes
diff abcrange.py @ 589:5db7e72d4219 build-default-240
Automated merge with ssh://hg.cryhavoc.org.uk/dottes
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Wed, 02 Nov 2016 00:21:30 +0000 |
parents | 1b79867b4f35 |
children | 2f6e05d0aba0 |
line wrap: on
line diff
--- a/abcrange.py Sat Oct 29 22:41:44 2016 +0100 +++ b/abcrange.py Wed Nov 02 00:21:30 2016 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Find the range of a tune. Do minimal parsing of an ABC input file # and print the lowest and highest notes therein. Accidentals are @@ -29,7 +29,7 @@ # Is it a header line? I.e. does it start LETTER COLON? # If so, ignore. start = line[:2] - if len(start) > 1 and start[1] == ":" and start[0].isalpha(): + if len(start) > 1 and start[1] == ":" and (start[0].isalpha() or start[0] == '+'): continue # Tune line. @@ -82,7 +82,7 @@ lowest = note note = 0 - print "{0}: {1} {2}".format(filename, highest, lowest) + print("{0}: {1} {2}".format(filename, highest, lowest)) if len(sys.argv) > 1: for arg in sys.argv[1:]: