diff options
author | Phil Holmes <mail@philholmes.net> | 2012-03-04 16:10:34 +0000 |
---|---|---|
committer | Phil Holmes <mail@philholmes.net> | 2012-03-18 12:23:14 +0000 |
commit | 61f11056af686fde87a1b82936cf2a073b017b88 (patch) | |
tree | 59aed3c5b26efbaf0ee9ba57498b59f8565c74ea /scripts | |
parent | 0942948dca35950b6e9cd3529ada31c38360e184 (diff) |
Various updates to reduce make doc output
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/abc2ly.py | 36 | ||||
-rw-r--r-- | scripts/build/lys-to-tely.py | 2 | ||||
-rw-r--r-- | scripts/midi2ly.py | 35 |
3 files changed, 42 insertions, 31 deletions
diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index 3a0aeaedab..d04068fa31 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -1313,8 +1313,9 @@ def parse_file (fn): select_voice('default', '') global lineno lineno = 0 - sys.stderr.write ("Line ... ") - sys.stderr.flush () + if not global_options.quiet: + sys.stderr.write ("Line ... ") + sys.stderr.flush () __main__.state = state_list[current_voice_idx] for ln in ls: @@ -1360,7 +1361,8 @@ def parse_file (fn): def identify(): - sys.stderr.write ("%s from LilyPond %s\n" % (program_name, version)) + if not global_options.quiet: + sys.stderr.write ("%s from LilyPond %s\n" % (program_name, version)) authors = """ Written by Han-Wen Nienhuys <hanwen@xs4all.nl>, Laura Conrad @@ -1381,16 +1383,21 @@ def get_option_parser (): p.add_option("--version", action="version", help=_ ("show version number and exit")) - p.add_option("-h", "--help", action="help", help=_ ("show this help and exit")) - p.add_option ('-o', '--output', metavar='FILE', - help=_ ("write output to FILE"), - action='store') - p.add_option ('-s', '--strict', help=_ ("be strict about success"), - action='store_true') - p.add_option ('-b', '--beams', help=_ ("preserve ABC's notion of beams"), action="store_true") + p.add_option ("-o", "--output", metavar='FILE', + action="store", + help=_ ("write output to FILE")) + p.add_option ("-s", "--strict", + action="store_true", + help=_ ("be strict about success")) + p.add_option ('-b', '--beams', + action="store_true", + help=_ ("preserve ABC's notion of beams")) + p.add_option ('-q', '--quiet', + action="store_true", + help=_ ("suppress progress messages")) p.add_option_group ('', description=( _ ('Report bugs via %s') @@ -1410,12 +1417,14 @@ for f in files: if f == '-': f = '' - sys.stderr.write ('Parsing `%s\'...\n' % f) + if not global_options.quiet: + sys.stderr.write ('Parsing `%s\'...\n' % f) parse_file (f) if not global_options.output: global_options.output = os.path.basename (os.path.splitext (f)[0]) + ".ly" - sys.stderr.write ('lilypond output to: `%s\'...' % global_options.output) + if not global_options.quiet: + sys.stderr.write ('lilypond output to: `%s\'...' % global_options.output) outf = open (global_options.output, 'w') # don't substitute @VERSION@. We want this to reflect @@ -1428,4 +1437,5 @@ for f in files: dump_voices (outf) dump_score (outf) dump_lyrics (outf) - sys.stderr.write ('\n') + if not global_options.quiet: + sys.stderr.write ('\n') diff --git a/scripts/build/lys-to-tely.py b/scripts/build/lys-to-tely.py index a3bc4b576b..7a8684f194 100644 --- a/scripts/build/lys-to-tely.py +++ b/scripts/build/lys-to-tely.py @@ -163,11 +163,9 @@ if files: s = "\n".join (map (name2line, files)) s = template.replace (include_snippets, s, 1) f = "%s/%s" % (dir, name) - sys.stderr.write ("%s: writing %s..." % (program_name, f)) h = open (f, "w") h.write (s) h.close () - sys.stderr.write ('\n') else: # not Unix philosophy, but hey, at least we notice when # we don't distribute any .ly files. diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index 3a434193b0..bf9f09f26e 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -831,7 +831,8 @@ def dump_track (track, n): if vl: s += ' \\voice' + vl + '\n' else: - warning (_ ('found more than 5 voices on a staff, expect bad output')) + if not global_options.quiet: + warning (_ ('found more than 5 voices on a staff, expect bad output')) s += ' ' + dump_voice (voice, skip) s += '}\n\n' v += 1 @@ -1027,7 +1028,8 @@ def convert_midi (in_file, out_file): } ''' - progress (_ ("%s output to `%s'...") % ('LY', out_file)) + if not global_options.quiet: + progress (_ ("%s output to `%s'...") % ('LY', out_file)) if out_file == '-': handle = sys.stdout @@ -1050,27 +1052,30 @@ def get_option_parser (): metavar=_ ('DUR'), help=_ ('quantise note durations on DUR')) p.add_option ('-D', '--debug', - action='store_true', - help=_ ('debug printing')) + action='store_true', + help=_ ('debug printing')) p.add_option ('-e', '--explicit-durations', action='store_true', help=_ ('print explicit durations')) p.add_option('-h', '--help', - action='help', - help=_ ('show this help and exit')) + action='help', + help=_ ('show this help and exit')) p.add_option('-i', '--include-header', - help=_ ('prepend FILE to output'), - action='append', - default=[], - metavar=_ ('FILE')) + help=_ ('prepend FILE to output'), + action='append', + default=[], + metavar=_ ('FILE')) p.add_option('-k', '--key', help=_ ('set key: ALT=+sharps|-flats; MINOR=1'), - metavar=_ ('ALT[:MINOR]'), - default=None), + metavar=_ ('ALT[:MINOR]'), + default=None), p.add_option ('-o', '--output', help=_ ('write output to FILE'), metavar=_ ('FILE'), action='store') p.add_option ('-p', '--preview', help=_ ('preview of first 4 bars'), action='store_true') + p.add_option ('-q', '--quiet', + action="store_true", + help=_ ("suppress progress messages and warnings about excess voices")) p.add_option ('-s', '--start-quant',help= _ ('quantise note starts on DUR'), metavar=_ ('DUR')) p.add_option ('-S', '--skip', @@ -1083,15 +1088,13 @@ def get_option_parser (): help=_ ('allow tuplet durations DUR*NUM/DEN'), default=[]) p.add_option ('-V', '--verbose', help=_ ('be verbose'), - action='store_true' - ), + action='store_true') p.version = 'midi2ly (LilyPond) @TOPLEVEL_VERSION@' p.add_option ('--version', action='version', help=_ ('show version number and exit')) p.add_option ('-w', '--warranty', help=_ ('show warranty and copyright'), - action='store_true', - ), + action='store_true',) p.add_option ('-x', '--text-lyrics', help=_ ('treat every text as a lyric'), action='store_true') |