Merge lp:~mikemc/ubuntuone-client/refactor-launcher into lp:ubuntuone-client

Proposed by Mike McCracken on 2012-05-02
Status: Merged
Approved by: Diego Sarmentero on 2012-05-03
Approved revision: 1240
Merged at revision: 1240
Proposed branch: lp:~mikemc/ubuntuone-client/refactor-launcher
Merge into: lp:ubuntuone-client
Diff against target: 154 lines (+44/-14)
8 files modified
tests/platform/__init__.py (+2/-2)
tests/platform/launcher/__init__.py (+27/-0)
tests/platform/launcher/test_linux.py (+6/-3)
ubuntuone/platform/ipc/linux.py (+1/-1)
ubuntuone/platform/launcher/__init__.py (+6/-5)
ubuntuone/platform/launcher/linux.py (+1/-1)
ubuntuone/platform/launcher/windows.py (+1/-1)
ubuntuone/platform/windows/__init__.py (+0/-1)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-client/refactor-launcher
Reviewer Review Type Date Requested Status
Diego Sarmentero (community) 2012-05-02 Approve on 2012-05-03
Brian Curtin (community) Approve on 2012-05-03
Review via email: mp+104461@code.launchpad.net

Commit Message

- refactor platform/launcher code ( LP: 989121 )

Description of the Change

- refactor platform/launcher code ( LP: 989121 )

* moves platform/the_platform/launcher to platform/launcher/the_platform
* similar change to test suite

Tested on linux.

To post a comment you must log in.
Brian Curtin (brian.curtin) wrote :

Looks reasonable to me.
Tests pass on Windows.

review: Approve
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/platform/__init__.py'
2--- tests/platform/__init__.py 2012-05-02 13:17:12 +0000
3+++ tests/platform/__init__.py 2012-05-02 21:53:18 +0000
4@@ -29,9 +29,9 @@
5
6 if sys.platform.startswith('linux'):
7 from tests.platform.ipc import test_linux
8- ipc_source = test_linux
9+ ipc_source = test_linux
10 else:
11- from tests.platform.ipc import test_windows
12+ from tests.platform.ipc import test_windows
13 ipc_source = test_windows
14
15 IPCTestCase = ipc_source.IPCTestCase
16
17=== added directory 'tests/platform/launcher'
18=== added file 'tests/platform/launcher/__init__.py'
19--- tests/platform/launcher/__init__.py 1970-01-01 00:00:00 +0000
20+++ tests/platform/launcher/__init__.py 2012-05-02 21:53:18 +0000
21@@ -0,0 +1,27 @@
22+# Copyright 2012 Canonical Ltd.
23+#
24+# This program is free software: you can redistribute it and/or modify it
25+# under the terms of the GNU General Public License version 3, as published
26+# by the Free Software Foundation.
27+#
28+# This program is distributed in the hope that it will be useful, but
29+# WITHOUT ANY WARRANTY; without even the implied warranties of
30+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
31+# PURPOSE. See the GNU General Public License for more details.
32+#
33+# You should have received a copy of the GNU General Public License along
34+# with this program. If not, see <http://www.gnu.org/licenses/>.
35+#
36+# In addition, as a special exception, the copyright holders give
37+# permission to link the code of portions of this program with the
38+# OpenSSL library under certain conditions as described in each
39+# individual source file, and distribute linked combinations
40+# including the two.
41+# You must obey the GNU General Public License in all respects
42+# for all of the code used other than OpenSSL. If you modify
43+# file(s) with this exception, you may extend this exception to your
44+# version of the file(s), but you are not obligated to do so. If you
45+# do not wish to do so, delete this exception statement from your
46+# version. If you delete this exception statement from all source
47+# files in the program, then also delete it here.
48+"""Platform/launcher test code."""
49
50=== renamed file 'tests/platform/linux/test_unity.py' => 'tests/platform/launcher/test_linux.py'
51--- tests/platform/linux/test_unity.py 2012-04-09 20:07:05 +0000
52+++ tests/platform/launcher/test_linux.py 2012-05-02 21:53:18 +0000
53@@ -33,7 +33,7 @@
54 from twisted.internet import defer
55 from twisted.trial.unittest import TestCase
56
57-from ubuntuone.platform.linux import launcher
58+from ubuntuone.platform import launcher
59
60
61 class FakeLauncherEntryProps(object):
62@@ -66,13 +66,16 @@
63 class LauncherTestCase(TestCase):
64 """Test the Launcher interface."""
65
66- skip = None if launcher.use_libunity else "libunity not installed."
67+ from ubuntuone.platform.launcher.linux import use_libunity
68+ skip = None if use_libunity else "libunity not installed."
69
70 @defer.inlineCallbacks
71 def setUp(self):
72 """Initialize this test instance."""
73 yield super(LauncherTestCase, self).setUp()
74- self.patch(launcher.Unity, "LauncherEntry", FakeLauncherEntry)
75+ import ubuntuone.platform.launcher.linux
76+ self.patch(ubuntuone.platform.launcher.linux.Unity,
77+ "LauncherEntry", FakeLauncherEntry)
78 self.launcher = launcher.UbuntuOneLauncher()
79
80 def test_progress_starts_hidden(self):
81
82=== modified file 'ubuntuone/platform/ipc/linux.py'
83--- ubuntuone/platform/ipc/linux.py 2012-04-30 14:24:55 +0000
84+++ ubuntuone/platform/ipc/linux.py 2012-05-02 21:53:18 +0000
85@@ -37,7 +37,7 @@
86 from twisted.internet import defer
87 from xml.etree import ElementTree
88
89-from ubuntuone.platform.linux.launcher import UbuntuOneLauncher
90+from ubuntuone.platform.launcher import UbuntuOneLauncher
91
92 # Disable the "Invalid Name" check here, as we have lots of DBus style names
93 # pylint: disable-msg=C0103
94
95=== added directory 'ubuntuone/platform/launcher'
96=== renamed file 'ubuntuone/platform/launcher.py' => 'ubuntuone/platform/launcher/__init__.py'
97--- ubuntuone/platform/launcher.py 2012-04-09 20:07:05 +0000
98+++ ubuntuone/platform/launcher/__init__.py 2012-05-02 21:53:18 +0000
99@@ -26,17 +26,18 @@
100 # do not wish to do so, delete this exception statement from your
101 # version. If you delete this exception statement from all source
102 # files in the program, then also delete it here.
103-"""Use libunity to show a progressbar and emblems on the launcher icon."""
104+"""Use appropriate API to show a progressbar and emblems on the
105+launcher icon."""
106
107 import sys
108
109
110 if sys.platform == "win32":
111- from ubuntuone.platform.windows import launcher
112- source = launcher
113+ from ubuntuone.platform.launcher import windows
114+ source = windows
115 else:
116- from ubuntuone.platform.linux import launcher
117- source = launcher
118+ from ubuntuone.platform.launcher import linux
119+ source = linux
120
121 U1_DOTDESKTOP = source.U1_DOTDESKTOP
122
123
124=== renamed file 'ubuntuone/platform/linux/launcher.py' => 'ubuntuone/platform/launcher/linux.py'
125--- ubuntuone/platform/linux/launcher.py 2012-04-09 20:07:05 +0000
126+++ ubuntuone/platform/launcher/linux.py 2012-05-02 21:53:18 +0000
127@@ -1,4 +1,4 @@
128-# ubuntuone.platform.linux.unity
129+# ubuntuone.platform.launcher.linux
130 #
131 # Author: Alejandro J. Cura <alecu@canonical.com>
132 #
133
134=== renamed file 'ubuntuone/platform/windows/launcher.py' => 'ubuntuone/platform/launcher/windows.py'
135--- ubuntuone/platform/windows/launcher.py 2012-04-09 20:07:05 +0000
136+++ ubuntuone/platform/launcher/windows.py 2012-05-02 21:53:18 +0000
137@@ -1,4 +1,4 @@
138-# ubuntuone.platform.linux.unity
139+# ubuntuone.platform.launcher.windows
140 #
141 # Author: Alejandro J. Cura <alecu@canonical.com>
142 #
143
144=== modified file 'ubuntuone/platform/windows/__init__.py'
145--- ubuntuone/platform/windows/__init__.py 2012-04-30 18:56:56 +0000
146+++ ubuntuone/platform/windows/__init__.py 2012-05-02 21:53:18 +0000
147@@ -38,7 +38,6 @@
148
149 import constants
150 import event_logging
151-import launcher
152 import logger
153
154 from ubuntuone.platform.os_helper import (

Subscribers

People subscribed via source and target branches