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
=== added directory 'tests/platform/messaging'
=== added file 'tests/platform/messaging/__init__.py'
--- tests/platform/messaging/__init__.py 1970-01-01 00:00:00 +0000
+++ tests/platform/messaging/__init__.py 2012-05-01 11:40:24 +0000
@@ -0,0 +1,27 @@
1# Copyright 2012 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify it
4# under the terms of the GNU General Public License version 3, as published
5# by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful, but
8# WITHOUT ANY WARRANTY; without even the implied warranties of
9# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
10# PURPOSE. See the GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License along
13# with this program. If not, see <http://www.gnu.org/licenses/>.
14#
15# In addition, as a special exception, the copyright holders give
16# permission to link the code of portions of this program with the
17# OpenSSL library under certain conditions as described in each
18# individual source file, and distribute linked combinations
19# including the two.
20# You must obey the GNU General Public License in all respects
21# for all of the code used other than OpenSSL. If you modify
22# file(s) with this exception, you may extend this exception to your
23# version of the file(s), but you are not obligated to do so. If you
24# do not wish to do so, delete this exception statement from your
25# version. If you delete this exception statement from all source
26# files in the program, then also delete it here.
27"""Platform/Messaging test code."""
028
=== renamed file 'tests/platform/linux/test_messaging.py' => 'tests/platform/messaging/test_linux.py'
--- tests/platform/linux/test_messaging.py 2012-04-09 20:07:05 +0000
+++ tests/platform/messaging/test_linux.py 2012-05-01 11:40:24 +0000
@@ -40,7 +40,7 @@
40from twisted.trial.unittest import TestCase40from twisted.trial.unittest import TestCase
41from ubuntuone.devtools.testcases import skipIf41from ubuntuone.devtools.testcases import skipIf
4242
43from ubuntuone.platform.linux.messaging import (43from ubuntuone.platform.messaging.linux import (
44 Messaging,44 Messaging,
45 _server_callback,45 _server_callback,
46 indicate,46 indicate,
4747
=== added directory 'ubuntuone/platform/messaging'
=== renamed file 'ubuntuone/platform/messaging.py' => 'ubuntuone/platform/messaging/__init__.py'
--- ubuntuone/platform/messaging.py 2012-04-09 20:07:05 +0000
+++ ubuntuone/platform/messaging/__init__.py 2012-05-01 11:40:24 +0000
@@ -40,12 +40,10 @@
4040
4141
42if sys.platform == "win32":42if sys.platform == "win32":
43 from ubuntuone.platform.windows import messaging43 from ubuntuone.platform.messaging import windows as source
44 source = messaging
45 hide_message = source.hide_message44 hide_message = source.hide_message
46else:45else:
47 from ubuntuone.platform.linux import messaging46 from ubuntuone.platform.messaging import linux as source
48 source = messaging
49 DBUS_BUS_NAME = source.DBUS_BUS_NAME47 DBUS_BUS_NAME = source.DBUS_BUS_NAME
50 DBUS_IFACE_GUI = source.DBUS_IFACE_GUI48 DBUS_IFACE_GUI = source.DBUS_IFACE_GUI
51 TRANSLATION_DOMAIN = source.TRANSLATION_DOMAIN49 TRANSLATION_DOMAIN = source.TRANSLATION_DOMAIN
5250
=== renamed file 'ubuntuone/platform/linux/messaging.py' => 'ubuntuone/platform/messaging/linux.py'
=== added file 'ubuntuone/platform/messaging/windows.py'
--- ubuntuone/platform/messaging/windows.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/platform/messaging/windows.py 2012-05-01 11:40:24 +0000
@@ -0,0 +1,62 @@
1# ubuntuone.syncdaemon.platform.messaging - Messages to the user
2#
3# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
4#
5# Copyright 2011-2012 Canonical Ltd.
6#
7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19# In addition, as a special exception, the copyright holders give
20# permission to link the code of portions of this program with the
21# OpenSSL library under certain conditions as described in each
22# individual source file, and distribute linked combinations
23# including the two.
24# You must obey the GNU General Public License in all respects
25# for all of the code used other than OpenSSL. If you modify
26# file(s) with this exception, you may extend this exception to your
27# version of the file(s), but you are not obligated to do so. If you
28# do not wish to do so, delete this exception statement from your
29# version. If you delete this exception statement from all source
30# files in the program, then also delete it here.
31"""Module that implements sending messages to the end user."""
32
33# TODO: We may want to enable different messaging systems. When none
34# of them are available, we should fall back to silently discarding
35# messages.
36
37from ubuntuone.status.messaging import AbstractMessaging
38
39
40class Messaging(AbstractMessaging):
41 """Notification of the end user."""
42
43 # pylint: disable=R0913
44 def show_message(self, sender, callback=None, message_time=None,
45 message_count=None, icon=None):
46 """Show a message in the messaging menu."""
47 # TODO: make this work
48 # pylint: enable=R0913
49
50 def update_count(self, sender, add_count):
51 """Update the count for an existing indicator."""
52 # TODO: make this work
53
54
55def hide_message(indicator): # pylint: disable=W0613
56 """Remove the message once it has been dealt with."""
57 # TODO: make this work
58
59
60def open_volumes(the_indicator, message_time=None): # pylint: disable=W0613
61 """Open the control panel to the shares tab."""
62 # TODO: make this work
063
=== modified file 'ubuntuone/platform/windows/__init__.py'
--- ubuntuone/platform/windows/__init__.py 2012-05-01 11:40:24 +0000
+++ ubuntuone/platform/windows/__init__.py 2012-05-01 11:40:24 +0000
@@ -40,7 +40,6 @@
40import event_logging40import event_logging
41import launcher41import launcher
42import logger42import logger
43import messaging
44import notification43import notification
4544
46from ubuntuone.platform.os_helper import (45from ubuntuone.platform.os_helper import (
4746
=== removed file 'ubuntuone/platform/windows/messaging.py'
--- ubuntuone/platform/windows/messaging.py 2012-04-09 20:07:05 +0000
+++ ubuntuone/platform/windows/messaging.py 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1# ubuntuone.syncdaemon.platform.messaging - Messages to the user
2#
3# Author: Eric Casteleijn <eric.casteleijn@canonical.com>
4#
5# Copyright 2011-2012 Canonical Ltd.
6#
7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19# In addition, as a special exception, the copyright holders give
20# permission to link the code of portions of this program with the
21# OpenSSL library under certain conditions as described in each
22# individual source file, and distribute linked combinations
23# including the two.
24# You must obey the GNU General Public License in all respects
25# for all of the code used other than OpenSSL. If you modify
26# file(s) with this exception, you may extend this exception to your
27# version of the file(s), but you are not obligated to do so. If you
28# do not wish to do so, delete this exception statement from your
29# version. If you delete this exception statement from all source
30# files in the program, then also delete it here.
31"""Module that implements sending messages to the end user."""
32
33# TODO: We may want to enable different messaging systems. When none
34# of them are available, we should fall back to silently discarding
35# messages.
36
37from ubuntuone.status.messaging import AbstractMessaging
38
39
40class Messaging(AbstractMessaging):
41 """Notification of the end user."""
42
43 # pylint: disable=R0913
44 def show_message(self, sender, callback=None, message_time=None,
45 message_count=None, icon=None):
46 """Show a message in the messaging menu."""
47 # TODO: make this work
48 # pylint: enable=R0913
49
50 def update_count(self, sender, add_count):
51 """Update the count for an existing indicator."""
52 # TODO: make this work
53
54
55def hide_message(indicator): # pylint: disable=W0613
56 """Remove the message once it has been dealt with."""
57 # TODO: make this work
58
59
60def open_volumes(the_indicator, message_time=None): # pylint: disable=W0613
61 """Open the control panel to the shares tab."""
62 # TODO: make this work

Subscribers

People subscribed via source and target branches