X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fabc2ly.py;h=7b075e727e637b8fd2ca0ee8418dde05377a8dbb;hb=29d1ad412ee48aa7a3a1666c7ab7af8fd2e2b1bf;hp=1b7b0687e588b04324067d2ece7418ba50a42ee0;hpb=d21a524c5cdce45fb3bc51b30c9e805d69586b56;p=lilypond.git diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index 1b7b0687e5..7b075e727e 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -12,23 +12,18 @@ program_name = 'abc2ly' version = '@TOPLEVEL_VERSION@' if version == '@' + 'TOPLEVEL_VERSION' + '@': - version = '1.2.0' + version = '1.2.6' # uGUHGUHGHGUGH + import __main__ import getopt import sys import re import string import os -try: - import mpz -except: - sys.stderr.write ("This script needs Python 1.5.1\n") - sys.exit (1) - -voice_idx_dict = {} +voice_idx_dict = {} header = {} lyrics = [] voices = [] @@ -746,11 +741,15 @@ Usage: abc2ly [OPTION]... ABC-FILE Options: -h, --help this help -o, --output=FILE set output filename to FILE + -v, --version version information """ +def print_version (): + print r"""abc2ly (GNU lilypond) %s""" % version -identify() -(options, files) = getopt.getopt (sys.argv[1:], 'o:h', ['help', 'output=']) + + +(options, files) = getopt.getopt (sys.argv[1:], 'vo:h', ['help','version', 'output=']) out_filename = '' for opt in options: @@ -758,12 +757,18 @@ for opt in options: a = opt[1] if o== '--help' or o == '-h': help () + sys.exit (0) + if o == '--version' or o == '-v': + print_version () + sys.exit(0) + if o == '--output' or o == '-o': out_filename = a else: print o raise getopt.error +identify() header['tagline'] = 'Lily was here %s -- automatically converted from ABC' % version for f in files: