Merge lp:~dobey/ubuntuone-installer/fix-939797 into lp:ubuntuone-installer

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 24
Merged at revision: 28
Proposed branch: lp:~dobey/ubuntuone-installer/fix-939797
Merge into: lp:ubuntuone-installer
Diff against target: 61 lines (+19/-6)
2 files modified
ubuntuone/installer/__init__.py (+2/-0)
ubuntuone/installer/gui.py (+17/-6)
To merge this branch: bzr merge lp:~dobey/ubuntuone-installer/fix-939797
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Review via email: mp+94598@code.launchpad.net

Commit message

Only install packages that haven't yet been installed.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

yay!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/installer/__init__.py'
--- ubuntuone/installer/__init__.py 2012-02-17 21:46:16 +0000
+++ ubuntuone/installer/__init__.py 2012-02-24 18:17:44 +0000
@@ -19,6 +19,8 @@
1919
20from gi.repository import GLib20from gi.repository import GLib
2121
22CLIENT_SHELL_PACKAGE = 'ubuntuone-client-gnome'
23
22CONTROL_PANEL_COMMAND = 'ubuntuone-control-panel-qt'24CONTROL_PANEL_COMMAND = 'ubuntuone-control-panel-qt'
23CONTROL_PANEL_PACKAGE = 'ubuntuone-control-panel-qt'25CONTROL_PANEL_PACKAGE = 'ubuntuone-control-panel-qt'
2426
2527
=== modified file 'ubuntuone/installer/gui.py'
--- ubuntuone/installer/gui.py 2012-02-23 14:42:09 +0000
+++ ubuntuone/installer/gui.py 2012-02-24 18:17:44 +0000
@@ -21,9 +21,11 @@
21import os21import os
2222
23from gi.repository import Gtk, GObject, GLib, Gdk, Pango23from gi.repository import Gtk, GObject, GLib, Gdk, Pango
24from ubuntuone.installer import (CONTROL_PANEL_COMMAND,24from ubuntuone.installer import (CLIENT_SHELL_PACKAGE,
25 CONTROL_PANEL_COMMAND,
25 CONTROL_PANEL_PACKAGE,26 CONTROL_PANEL_PACKAGE,
26 MUSIC_STORE_PACKAGE)27 MUSIC_STORE_PACKAGE,
28 is_installed)
2729
28# Some shenanigans to deal with pyflakes complaining30# Some shenanigans to deal with pyflakes complaining
29inline_callbacks = None31inline_callbacks = None
@@ -196,6 +198,18 @@
196 if os.path.exists(path):198 if os.path.exists(path):
197 return path199 return path
198200
201 def __get_package_list(self):
202 """Build the list of packages, to only include non-installed ones."""
203 packages = []
204 if not is_installed(CONTROL_PANEL_PACKAGE, CONTROL_PANEL_COMMAND):
205 packages.append(CONTROL_PANEL_PACKAGE)
206 if not is_installed(MUSIC_STORE_PACKAGE):
207 packages.append(MUSIC_STORE_PACKAGE)
208 if not is_installed(CLIENT_SHELL_PACKAGE):
209 packages.append(CLIENT_SHELL_PACKAGE)
210
211 return packages
212
199 def __got_response(self, dialog, response):213 def __got_response(self, dialog, response):
200 """Handle the dialog response actions."""214 """Handle the dialog response actions."""
201 if response in [Gtk.ResponseType.CANCEL,215 if response in [Gtk.ResponseType.CANCEL,
@@ -362,10 +376,7 @@
362 Gtk.main_quit()376 Gtk.main_quit()
363377
364 transaction = yield self.client.install_packages(378 transaction = yield self.client.install_packages(
365 package_names=[MUSIC_STORE_PACKAGE,379 package_names=self.__get_package_list())
366 'ubuntuone-client-gnome',
367 CONTROL_PANEL_PACKAGE,
368 ])
369 transaction.connect('finished', finished)380 transaction.connect('finished', finished)
370 self.__apt_progress.set_transaction(transaction)381 self.__apt_progress.set_transaction(transaction)
371 transaction.run()382 transaction.run()

Subscribers

People subscribed via source and target branches

to all changes: