summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2007-11-15 23:46:40 +0100
committerGuillaume Seguin <guillaume@segu.in>2007-11-15 23:46:40 +0100
commit18fed8ef43e08311417997b11ef6623af2c743de (patch)
tree87eacee7f3f4c3d52aeedad580ab550cd6ab5aab
parentbd5ef2ff4607da7ea8d1b90524a5413729407d94 (diff)
downloadgnome-about-18fed8ef43e08311417997b11ef6623af2c743de.tar.gz
gnome-about-18fed8ef43e08311417997b11ef6623af2c743de.tar.bz2
* Cleanup option handling, use gnome-python for a pretty --help
-rwxr-xr-xgnome-about.py24
1 files changed, 10 insertions, 14 deletions
diff --git a/gnome-about.py b/gnome-about.py
index 8d79fe6..8cd6613 100755
--- a/gnome-about.py
+++ b/gnome-about.py
@@ -31,7 +31,6 @@ import pygtk
pygtk.require ('2.0')
import gobject
-from gobject.option import OptionParser, make_option
import gtk
import gnome
@@ -935,10 +934,7 @@ class GnomeAbout (gtk.Dialog):
super (GnomeAbout, self).__init__ (_("About the GNOME Desktop"),
buttons = (gtk.STOCK_CLOSE,
gtk.RESPONSE_CLOSE))
-
- defs = {gnome.PARAM_APP_DATADIR : DATADIR}
- self.program = gnome.program_init ("gnome-about", VERSION,
- properties = defs)
+ self.program = gnome.program_get ()
# Immediately fetch system infos to load description messages
self.system_infos = self.get_system_infos ()
@@ -1117,15 +1113,15 @@ contributors list) correctly positionned and sized.'''
gtk.main_quit ()
if __name__ == "__main__":
- parser = OptionParser (
- option_list = [
- make_option ("--gnome-version",
- action = "store_true",
- dest = "gnome_version",
- help = _("Display information on this GNOME version")),
- ])
- parser.parse_args (sys.argv)
- if parser.values.gnome_version:
+ popt_table = [
+ ("gnome-version", "", None, None, 0,
+ _("Display information on this GNOME version"), "")
+ ]
+ program = gnome.program_init ("gnome-about", VERSION,
+ popt_table = popt_table)
+ program.set_property (gnome.PARAM_APP_DATADIR, DATADIR)
+ leftover, args_dict = program.get_popt_args ()
+ if args_dict["gnome-version"]:
about = GnomeAbout (ui = False)
about.gnome_version ()
else: