diff options
| author | glatzor@ubuntu.com <> | 2006-07-21 22:53:55 +0200 |
|---|---|---|
| committer | glatzor@ubuntu.com <> | 2006-07-21 22:53:55 +0200 |
| commit | faa8e24031b9dfb788aa51e50770b7f572f18e9d (patch) | |
| tree | 2e5bff62c8f6f948c6e4b6efb61fdf72ec65d8d4 /software-properties | |
| parent | 14d80b531b3b1d7e2f13003c9d04cf428b6df1b7 (diff) | |
| download | python-apt-faa8e24031b9dfb788aa51e50770b7f572f18e9d.tar.gz | |
* Moved the Distribution class to aptsources
* Added a command line option: --enable-component
* Added a handler for the toggled popcon checkbutton
Diffstat (limited to 'software-properties')
| -rw-r--r-- | software-properties | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/software-properties b/software-properties index f21a5b52..6c38d073 100644 --- a/software-properties +++ b/software-properties @@ -34,6 +34,8 @@ import sys from optparse import OptionParser +import SoftwareProperties.aptsources as aptsources + #sys.path.append("@prefix@/share/update-manager/python") from SoftwareProperties import SoftwareProperties @@ -51,14 +53,18 @@ if __name__ == "__main__": action="store", type="string", dest="toplevel", help="Set x-window-id of the toplevel parent for the "\ "dialog (usefull for embedding)") + parser.add_option("-e", "--enable-component", + action="store", type="string", dest="enable_component", + help="Enable the specified component of the distro's "\ + "repositories") (options, args) = parser.parse_args() # Check for root permissions if os.geteuid() != 0: - dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, + dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, _("You need to be root to run this program") ) - dialog.set_default_response(gtk.RESPONSE_OK) + dialog.set_default_response(gtk.RESPONSE_CLOSE) dialog.run() dialog.destroy() sys.exit(1) @@ -74,7 +80,14 @@ if __name__ == "__main__": #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) + file = args[0] + if options.enable_component: + sourceslist = aptsources.SourcesList() + distro = aptsources.Distribution() + distro.get_sources(sourceslist) + distro.enable_component(sourceslist, options.enable_component) + sourceslist.save() + else: + app = SoftwareProperties.SoftwareProperties(data_dir, options, file) + app.run() + sys.exit(app.modified) |
