From b619c9d074eae2d1142aa6341898a7c0d972a171 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 6 Jan 2009 11:27:14 +0100 Subject: [PATCH] Update some python scripts to (c) --2008 and render grand-replace affectible. --- scripts/convert-ly.py | 23 +++++++++++++++-------- scripts/etf2ly.py | 17 +++++++++-------- scripts/lilymidi.py | 2 +- scripts/lilypond-book.py | 4 ++-- scripts/lilysong.py | 2 +- scripts/midi2ly.py | 16 +++++++++------- 6 files changed, 37 insertions(+), 27 deletions(-) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 93e345f2ae..3df263f5bb 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -44,6 +44,9 @@ copyright = ('Jan Nieuwenhuizen ', program_name = os.path.basename (sys.argv[0]) program_version = '@TOPLEVEL_VERSION@' +authors = ('Jan Nieuwenhuizen ', + 'Han-Wen Nienhuys ') + error_file_write = ly.stderr_write def warning (s): @@ -58,17 +61,16 @@ def identify (port=sys.stderr): def warranty (): identify () ly.encoded_write (sys.stdout, ''' -Copyright (c) %s by +%s - Han-Wen Nienhuys - Jan Nieuwenhuizen +%s %s %s -''' ( '2001--2006', - _ ("Distributed under terms of the GNU General Public License."), - _ ('It comes with NO WARRANTY.'))) - +''' % ( _ ('Copyright (c) %s by') % '2001--2008', + ' '.join (authors), + _ ('Distributed under terms of the GNU General Public License.'), + _ ('It comes with NO WARRANTY.'))) def get_option_parser (): p = ly.get_option_parser (usage=_ ("%s [OPTION]... FILE") % 'convert-ly', @@ -117,7 +119,9 @@ def get_option_parser (): action='store', dest="to_version", default='') - + p.add_option ('-w', '--warranty', help=_ ("show warranty and copyright"), + action='store_true', + ), p.add_option_group ('', description=( _ ("Report bugs via %s") @@ -256,6 +260,9 @@ def do_options (): opt_parser = get_option_parser() (options, args) = opt_parser.parse_args () + if options.warranty: + warranty () + sys.exit (0) if options.from_version: options.from_version = str_to_tuple (options.from_version) diff --git a/scripts/etf2ly.py b/scripts/etf2ly.py index c9f23aa677..39401b0692 100644 --- a/scripts/etf2ly.py +++ b/scripts/etf2ly.py @@ -34,6 +34,9 @@ import os program_name = sys.argv[0] +authors = ('Jan Nieuwenhuizen ', + 'Han-Wen Nienhuys ') + version = '@TOPLEVEL_VERSION@' if version == '@' + 'TOPLEVEL_VERSION' + '@': version = '(unknown version)' # uGUHGUHGHGUGH @@ -1162,18 +1165,16 @@ def identify(): def warranty (): identify () sys.stdout.write (''' -Copyright (c) %s by +%s - Han-Wen Nienhuys - Jan Nieuwenhuizen + %s %s %s -''' % ( '2001--2006', - _('Distributed under terms of the GNU General Public License.'), - _('It comes with NO WARRANTY.'))) - - +''' % ( _ ('Copyright (c) %s by') % '2001--2008', + '\n '.join (authors), + _ ('Distributed under terms of the GNU General Public License.'), + _ ('It comes with NO WARRANTY.'))) def get_option_parser (): p = ly.get_option_parser (usage=_ ("%s [OPTION]... ETF-FILE") % 'etf2ly', diff --git a/scripts/lilymidi.py b/scripts/lilymidi.py index 22eb8e61f4..e94548c18e 100644 --- a/scripts/lilymidi.py +++ b/scripts/lilymidi.py @@ -1,6 +1,6 @@ #!@TARGET_PYTHON@ -# Copyright (C) 2006, 2007 Brailcom, o.p.s. +# Copyright (c) 2006--2008 Brailcom, o.p.s. # # Author: Milan Zamazal # diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index a0ee6fb0ad..65c3b62da4 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -108,12 +108,12 @@ def warranty (): ly.encoded_write (sys.stdout, ''' %s -%s + %s %s %s ''' % ( _ ('Copyright (c) %s by') % '2001--2008', - ' '.join (authors), + '\n '.join (authors), _ ("Distributed under terms of the GNU General Public License."), _ ("It comes with NO WARRANTY."))) diff --git a/scripts/lilysong.py b/scripts/lilysong.py index adc6f57526..5f38f8640b 100644 --- a/scripts/lilysong.py +++ b/scripts/lilysong.py @@ -1,6 +1,6 @@ #!@TARGET_PYTHON@ -# Copyright (C) 2006, 2007 Brailcom, o.p.s. +# Copyright (c) 2006--2008 Brailcom, o.p.s. # # Author: Milan Zamazal # diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index ace53d3446..3b2350b15b 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -57,6 +57,9 @@ allowed_tuplet_clocks = [] program_name = sys.argv[0] program_version = '@TOPLEVEL_VERSION@' +authors = ('Jan Nieuwenhuizen ', + 'Han-Wen Nienhuys ') + errorport = sys.stderr def identify (): @@ -65,17 +68,16 @@ def identify (): def warranty (): identify () ly.encoded_write (sys.stdout, ''' -Copyright (c) %s by +%s - Han-Wen Nienhuys - Jan Nieuwenhuizen + %s %s %s -''' ( '2001--2006', - _('Distributed under terms of the GNU General Public License.'), - _('It comes with NO WARRANTY.'))) - +''' % ( _ ('Copyright (c) %s by') % '2001--2008', + '\n '.join (authors), + _ ('Distributed under terms of the GNU General Public License.'), + _ ('It comes with NO WARRANTY.'))) def progress (s): ly.encoded_write (errorport, s + '\n') -- 2.39.2