1
# GNU Solfege - free ear training software
2
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Tom Cato Amundsen
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
from __future__ import absolute_import
22
class SolfegeOptionParser(optparse.OptionParser):
24
optparse.OptionParser.__init__(self)
25
self.add_option('-v', '--version', action='store_true', dest='version')
26
self.add_option('-w', '--warranty', action='store_true', dest='warranty',
27
help=_('Show warranty and copyright.'))
28
self.add_option('--no-splash', action='store_true', dest='no_splash',
29
help=_('Do not show the startup window.'),
31
self.add_option('--verbose-sound-init', action='store_true',
33
dest='verbose_sound_init',
34
help=_('Display more info about the sound setup.'))
35
self.add_option('--no-sound', action='store_true', dest='no_sound',
37
help=_('Do not play any sounds. Instead some data is printed to standard output. Use this for debugging and porting.'))
38
self.add_option('--debug', action='store_true', dest='debug',
39
help=_('Include features used by the Solfege developers to debug the program.'))
40
self.add_option('--disable-exception-handler', action='store_true',
41
dest='disable_exception_handler',
42
help=_("Disable the exception handling in Gui.standard_exception_handler."))
43
self.add_option('--no-random', action='store_true', dest='no_random',
44
help=_('For debugging only: Select questions from lesson files in sequential order.'))
45
self.add_option('--show-gtk-warnings', action='store_true',
46
dest='show_gtk_warnings',
47
help=_('Show GtkWarnings and PangoWarnings in the traceback window.'))
48
def print_help(self, outfile=None):
51
encoding = outfile.encoding
53
encoding = "iso-8859-1"
54
outfile.write(self.format_help().encode(encoding, 'replace'))