Merge lp:~diegosarmentero/ubuntuone-client/refactor-messaging into lp:ubuntuone-client

Proposed by Diego Sarmentero
Status: Merged
Approved by: Diego Sarmentero
Approved revision: 1236
Merged at revision: 1234
Proposed branch: lp:~diegosarmentero/ubuntuone-client/refactor-messaging
Merge into: lp:ubuntuone-client
Prerequisite: lp:~diegosarmentero/ubuntuone-client/refactor-filesystem_notifications
Diff against target: 212 lines (+92/-68)
6 files modified
tests/platform/messaging/__init__.py (+27/-0)
tests/platform/messaging/test_linux.py (+1/-1)
ubuntuone/platform/messaging/__init__.py (+2/-4)
ubuntuone/platform/messaging/windows.py (+62/-0)
ubuntuone/platform/windows/__init__.py (+0/-1)
ubuntuone/platform/windows/messaging.py (+0/-62)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-client/refactor-messaging
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Manuel de la Peña (community) Approve
Review via email: mp+104156@code.launchpad.net

Commit message

- Refactor platform/messaging (LP: #989122).

To post a comment you must log in.
1235. By Diego Sarmentero

Adding missing files

Revision history for this message
Manuel de la Peña (mandel) wrote :
review: Needs Fixing
1236. By Diego Sarmentero

improve __init__ imports

Revision history for this message
Manuel de la Peña (mandel) :
review: Approve
Revision history for this message
Eric Casteleijn (thisfred) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'tests/platform/messaging'
2=== added file 'tests/platform/messaging/__init__.py'
3--- tests/platform/messaging/__init__.py 1970-01-01 00:00:00 +0000
4+++ tests/platform/messaging/__init__.py 2012-05-01 11:40:24 +0000
5@@ -0,0 +1,27 @@
6+# Copyright 2012 Canonical Ltd.
7+#
8+# This program is free software: you can redistribute it and/or modify it
9+# under the terms of the GNU General Public License version 3, as published
10+# by the Free Software Foundation.
11+#
12+# This program is distributed in the hope that it will be useful, but
13+# WITHOUT ANY WARRANTY; without even the implied warranties of
14+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15+# PURPOSE. See the GNU General Public License for more details.
16+#
17+# You should have received a copy of the GNU General Public License along
18+# with this program. If not, see <http://www.gnu.org/licenses/>.
19+#
20+# In addition, as a special exception, the copyright holders give
21+# permission to link the code of portions of this program with the
22+# OpenSSL library under certain conditions as described in each
23+# individual source file, and distribute linked combinations
24+# including the two.
25+# You must obey the GNU General Public License in all respects
26+# for all of the code used other than OpenSSL. If you modify
27+# file(s) with this exception, you may extend this exception to your
28+# version of the file(s), but you are not obligated to do so. If you
29+# do not wish to do so, delete this exception statement from your
30+# version. If you delete this exception statement from all source
31+# files in the program, then also delete it here.
32+"""Platform/Messaging test code."""
33
34=== renamed file 'tests/platform/linux/test_messaging.py' => 'tests/platform/messaging/test_linux.py'
35--- tests/platform/linux/test_messaging.py 2012-04-09 20:07:05 +0000
36+++ tests/platform/messaging/test_linux.py 2012-05-01 11:40:24 +0000
37@@ -40,7 +40,7 @@
38 from twisted.trial.unittest import TestCase
39 from ubuntuone.devtools.testcases import skipIf
40
41-from ubuntuone.platform.linux.messaging import (
42+from ubuntuone.platform.messaging.linux import (
43 Messaging,
44 _server_callback,
45 indicate,
46
47=== added directory 'ubuntuone/platform/messaging'
48=== renamed file 'ubuntuone/platform/messaging.py' => 'ubuntuone/platform/messaging/__init__.py'
49--- ubuntuone/platform/messaging.py 2012-04-09 20:07:05 +0000
50+++ ubuntuone/platform/messaging/__init__.py 2012-05-01 11:40:24 +0000
51@@ -40,12 +40,10 @@
52
53
54 if sys.platform == "win32":
55- from ubuntuone.platform.windows import messaging
56- source = messaging
57+ from ubuntuone.platform.messaging import windows as source
58 hide_message = source.hide_message
59 else:
60- from ubuntuone.platform.linux import messaging
61- source = messaging
62+ from ubuntuone.platform.messaging import linux as source
63 DBUS_BUS_NAME = source.DBUS_BUS_NAME
64 DBUS_IFACE_GUI = source.DBUS_IFACE_GUI
65 TRANSLATION_DOMAIN = source.TRANSLATION_DOMAIN
66
67=== renamed file 'ubuntuone/platform/linux/messaging.py' => 'ubuntuone/platform/messaging/linux.py'
68=== added file 'ubuntuone/platform/messaging/windows.py'
69--- ubuntuone/platform/messaging/windows.py 1970-01-01 00:00:00 +0000
70+++ ubuntuone/platform/messaging/windows.py 2012-05-01 11:40:24 +0000
71@@ -0,0 +1,62 @@
72+# ubuntuone.syncdaemon.platform.messaging - Messages to the user
73+#
74+# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
75+#
76+# Copyright 2011-2012 Canonical Ltd.
77+#
78+# This program is free software: you can redistribute it and/or modify it
79+# under the terms of the GNU General Public License version 3, as published
80+# by the Free Software Foundation.
81+#
82+# This program is distributed in the hope that it will be useful, but
83+# WITHOUT ANY WARRANTY; without even the implied warranties of
84+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
85+# PURPOSE. See the GNU General Public License for more details.
86+#
87+# You should have received a copy of the GNU General Public License along
88+# with this program. If not, see <http://www.gnu.org/licenses/>.
89+#
90+# In addition, as a special exception, the copyright holders give
91+# permission to link the code of portions of this program with the
92+# OpenSSL library under certain conditions as described in each
93+# individual source file, and distribute linked combinations
94+# including the two.
95+# You must obey the GNU General Public License in all respects
96+# for all of the code used other than OpenSSL. If you modify
97+# file(s) with this exception, you may extend this exception to your
98+# version of the file(s), but you are not obligated to do so. If you
99+# do not wish to do so, delete this exception statement from your
100+# version. If you delete this exception statement from all source
101+# files in the program, then also delete it here.
102+"""Module that implements sending messages to the end user."""
103+
104+# TODO: We may want to enable different messaging systems. When none
105+# of them are available, we should fall back to silently discarding
106+# messages.
107+
108+from ubuntuone.status.messaging import AbstractMessaging
109+
110+
111+class Messaging(AbstractMessaging):
112+ """Notification of the end user."""
113+
114+ # pylint: disable=R0913
115+ def show_message(self, sender, callback=None, message_time=None,
116+ message_count=None, icon=None):
117+ """Show a message in the messaging menu."""
118+ # TODO: make this work
119+ # pylint: enable=R0913
120+
121+ def update_count(self, sender, add_count):
122+ """Update the count for an existing indicator."""
123+ # TODO: make this work
124+
125+
126+def hide_message(indicator): # pylint: disable=W0613
127+ """Remove the message once it has been dealt with."""
128+ # TODO: make this work
129+
130+
131+def open_volumes(the_indicator, message_time=None): # pylint: disable=W0613
132+ """Open the control panel to the shares tab."""
133+ # TODO: make this work
134
135=== modified file 'ubuntuone/platform/windows/__init__.py'
136--- ubuntuone/platform/windows/__init__.py 2012-05-01 11:40:24 +0000
137+++ ubuntuone/platform/windows/__init__.py 2012-05-01 11:40:24 +0000
138@@ -40,7 +40,6 @@
139 import event_logging
140 import launcher
141 import logger
142-import messaging
143 import notification
144
145 from ubuntuone.platform.os_helper import (
146
147=== removed file 'ubuntuone/platform/windows/messaging.py'
148--- ubuntuone/platform/windows/messaging.py 2012-04-09 20:07:05 +0000
149+++ ubuntuone/platform/windows/messaging.py 1970-01-01 00:00:00 +0000
150@@ -1,62 +0,0 @@
151-# ubuntuone.syncdaemon.platform.messaging - Messages to the user
152-#
153-# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
154-#
155-# Copyright 2011-2012 Canonical Ltd.
156-#
157-# This program is free software: you can redistribute it and/or modify it
158-# under the terms of the GNU General Public License version 3, as published
159-# by the Free Software Foundation.
160-#
161-# This program is distributed in the hope that it will be useful, but
162-# WITHOUT ANY WARRANTY; without even the implied warranties of
163-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
164-# PURPOSE. See the GNU General Public License for more details.
165-#
166-# You should have received a copy of the GNU General Public License along
167-# with this program. If not, see <http://www.gnu.org/licenses/>.
168-#
169-# In addition, as a special exception, the copyright holders give
170-# permission to link the code of portions of this program with the
171-# OpenSSL library under certain conditions as described in each
172-# individual source file, and distribute linked combinations
173-# including the two.
174-# You must obey the GNU General Public License in all respects
175-# for all of the code used other than OpenSSL. If you modify
176-# file(s) with this exception, you may extend this exception to your
177-# version of the file(s), but you are not obligated to do so. If you
178-# do not wish to do so, delete this exception statement from your
179-# version. If you delete this exception statement from all source
180-# files in the program, then also delete it here.
181-"""Module that implements sending messages to the end user."""
182-
183-# TODO: We may want to enable different messaging systems. When none
184-# of them are available, we should fall back to silently discarding
185-# messages.
186-
187-from ubuntuone.status.messaging import AbstractMessaging
188-
189-
190-class Messaging(AbstractMessaging):
191- """Notification of the end user."""
192-
193- # pylint: disable=R0913
194- def show_message(self, sender, callback=None, message_time=None,
195- message_count=None, icon=None):
196- """Show a message in the messaging menu."""
197- # TODO: make this work
198- # pylint: enable=R0913
199-
200- def update_count(self, sender, add_count):
201- """Update the count for an existing indicator."""
202- # TODO: make this work
203-
204-
205-def hide_message(indicator): # pylint: disable=W0613
206- """Remove the message once it has been dealt with."""
207- # TODO: make this work
208-
209-
210-def open_volumes(the_indicator, message_time=None): # pylint: disable=W0613
211- """Open the control panel to the shares tab."""
212- # TODO: make this work

Subscribers

People subscribed via source and target branches