diff options
| author | Michael Vogt <egon@top> | 2005-12-01 13:22:42 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@top> | 2005-12-01 13:22:42 +0100 |
| commit | 7e6db3ee0e78a1c8c99ad949a8e1bf33a5baad0b (patch) | |
| tree | 5b4c2fc7dc7ae108605b43a4a113301614e35d4f /UpdateManager | |
| parent | 8477efa841179e2097066fc0e0f3ef20151da614 (diff) | |
| download | python-apt-7e6db3ee0e78a1c8c99ad949a8e1bf33a5baad0b.tar.gz | |
* release notes information added
Diffstat (limited to 'UpdateManager')
| -rw-r--r-- | UpdateManager/MetaRelease.py | 7 | ||||
| -rw-r--r-- | UpdateManager/UpdateManager.py | 30 |
2 files changed, 34 insertions, 3 deletions
diff --git a/UpdateManager/MetaRelease.py b/UpdateManager/MetaRelease.py index f91e30b6..a19b2229 100644 --- a/UpdateManager/MetaRelease.py +++ b/UpdateManager/MetaRelease.py @@ -15,12 +15,13 @@ class Dist(object): self.name = name self.date = date self.supported = supported + self.releaseNotesURI = None class MetaRelease(gobject.GObject): # some constants #METARELEASE_URI = "http://changelogs.ubuntu.com/meta-release" - METARELEASE_URI = "http://people.ubuntu.com/~mvo/meta-release-test" + METARELEASE_URI = "http://people.ubuntu.com/~mvo/dist-upgrader/meta-release-test" METARELEASE_FILE = "/var/lib/update-manager/meta-release" __gsignals__ = { @@ -79,6 +80,8 @@ class MetaRelease(gobject.GObject): supported = index_tag.Section["Supported"] # add the information to a new date object dist = Dist(name,date,supported) + if index_tag.Section.has_key("ReleaseNotes"): + dist.releaseNotesURI = index_tag.Section["ReleaseNotes"] dists.append(dist) if name == current_dist_name: current_dist = dist @@ -102,10 +105,8 @@ class MetaRelease(gobject.GObject): # only warn if unsupported and a new dist is available (because # the development version is also unsupported) if upgradable_to != "" and not current_dist.supported: - #self.current_dist_not_supported(upgradable_to) self.emit("dist_no_longer_supported",upgradable_to) elif upgradable_to != "": - #self.new_dist_available(upgradable_to) self.emit("new_dist_available",upgradable_to) # parsing done and sucessfully diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 7b846ed9..b2ebd1c9 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -57,6 +57,7 @@ class MyCache(apt.Cache): self._depcache.Upgrade() + class UpdateList: def __init__(self, parent_window): self.pkgs = [] @@ -608,6 +609,34 @@ class UpdateManager(SimpleGladeApp): def on_button_dist_upgrade_clicked(self, button): print "on_button_dist_upgrade_clicked" + # see if we have release notes + # FIXME: care about i18n! (append -$lang or something) + if self.new_dist.releaseNotesURI != None: + uri = self.new_dist.releaseNotesURI + print uri + self.window_main.set_sensitive(False) + self.window_main.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) + while gtk.events_pending(): + gtk.main_iteration() + + # download/display the release notes + # FIXME: add some progress reporting here + try: + release_notes = urllib2.urlopen(uri) + notes = release_notes.read() + self.textview_release_notes.get_buffer().set_text(notes) + self.dialog_release_notes.set_transient_for(self.window_main) + self.dialog_release_notes.run() + self.dialog_release_notes.destroy() + except urllib2.HTTPError: + # FIXME: make proper error dialogs here + print _("Release notes not found on the server.") + except IOError: + print _("Failed to download Release Notes. Please " + "check if there is an active internet connection.") + self.window_main.set_sensitive(True) + self.window_main.window.set_cursor(None) + def new_dist_available(self, meta_release, upgradable_to): print "new_dist_available: %s" % upgradable_to.name @@ -629,6 +658,7 @@ class UpdateManager(SimpleGladeApp): #dialog.destroy() self.frame_new_release.show() self.label_new_release.set_markup("<b>New distibution release codename '%s' available</b>" % upgradable_to.name) + self.new_dist = upgradable_to # fixme: we should probably abstract away all the stuff from libapt |
