diff options
| author | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-04-18 22:23:08 +0200 |
|---|---|---|
| committer | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-04-18 22:23:08 +0200 |
| commit | 02352fee746a3e17be326d7a68b1b8b4970f6203 (patch) | |
| tree | b4be9ba12d69fc9f78fd60a2f67080687cab2d54 /software-properties | |
| parent | 09a3302637368aa2dda1ea8cef86dd32d7423c26 (diff) | |
| download | python-apt-02352fee746a3e17be326d7a68b1b8b4970f6203.tar.gz | |
* rename gnome-software-properties to software-properties (there is no
dependency on gnome anymore)
* remove deprecated code
Diffstat (limited to 'software-properties')
| -rw-r--r-- | software-properties | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/software-properties b/software-properties new file mode 100644 index 00000000..2e1d5da6 --- /dev/null +++ b/software-properties @@ -0,0 +1,81 @@ +#!/usr/bin/env python2.4 +# update-manager.in - easy updating application +# +# Copyright (c) 2004,2005 Canonical +# 2004,2005 Michiel Sikkes +# +# Author: Michiel Sikkes <michiel@eyesopened.nl> +# Michael Vogt <mvo@debian.org> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA + +import pygtk +pygtk.require('2.0') +import gtk +import gtk.gdk +import gtk.glade +import gobject +import gnome +import gettext +import os +import sys + +from optparse import OptionParser + +#sys.path.append("@prefix@/share/update-manager/python") + +from SoftwareProperties import SoftwareProperties + +if __name__ == "__main__": + _ = gettext.gettext + + # Begin parsing of options + parser = OptionParser() + parser.add_option ("-n", "--no-update", action="store_true", + dest="no_update", default=False, + help="No update on repository change (usefull if called "\ + "from a external program).") + parser.add_option("-t", "--toplevel", + action="store", type="string", dest="toplevel", + help="Set x-window-id of the toplevel parent for the "\ + "dialog (usefull for embedding)") + + + (options, args) = parser.parse_args() + # Check for root permissions + if os.geteuid() != 0: + dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, + _("You need to be root to run this program") ) + dialog.set_default_response(gtk.RESPONSE_OK) + dialog.run() + dialog.destroy() + sys.exit(1) + + localesApp="update-manager" + localesDir="/usr/share/locale" + gettext.bindtextdomain(localesApp, localesDir) + gettext.textdomain(localesApp) + gtk.glade.bindtextdomain(localesApp, localesDir) + gtk.glade.textdomain(localesApp) + + data_dir="/usr/share/update-manager/" + #data_dir="/tmp/xxx/share/update-manager/" + file = None + if len(args) > 0: + file = args[0] + app = SoftwareProperties.SoftwareProperties(data_dir, options, file) + app.run() + sys.exit(app.modified) |
