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

Proposed by Diego Sarmentero on 2012-04-30
Status: Merged
Approved by: Diego Sarmentero on 2012-05-01
Approved revision: 1233
Merged at revision: 1233
Proposed branch: lp:~diegosarmentero/ubuntuone-client/refactor-filesystem_notifications
Merge into: lp:ubuntuone-client
Prerequisite: lp:~diegosarmentero/ubuntuone-client/refactor-ipc
Diff against target: 196 lines (+80/-21)
9 files modified
tests/platform/filesystem_notifications/__init__.py (+27/-0)
tests/platform/filesystem_notifications/test_linux.py (+3/-1)
tests/platform/filesystem_notifications/test_windows.py (+4/-2)
ubuntuone/platform/__init__.py (+3/-2)
ubuntuone/platform/filesystem_notifications/__init__.py (+41/-0)
ubuntuone/platform/filesystem_notifications/linux.py (+1/-3)
ubuntuone/platform/filesystem_notifications/windows.py (+1/-4)
ubuntuone/platform/linux/__init__.py (+0/-4)
ubuntuone/platform/windows/__init__.py (+0/-5)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-client/refactor-filesystem_notifications
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve on 2012-05-01
Manuel de la Peña (community) 2012-04-30 Approve on 2012-05-01
Review via email: mp+104143@code.launchpad.net

Commit Message

- Refactor platform/filesystem_notifications (LP: #989125).

To post a comment you must log in.
review: Approve
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/filesystem_notifications'
2=== added file 'tests/platform/filesystem_notifications/__init__.py'
3--- tests/platform/filesystem_notifications/__init__.py 1970-01-01 00:00:00 +0000
4+++ tests/platform/filesystem_notifications/__init__.py 2012-04-30 16:23: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/File System Notifications test code."""
33
34=== renamed file 'tests/platform/test_filesystem_notifications.py' => 'tests/platform/filesystem_notifications/test_filesystem_notifications.py'
35=== renamed file 'tests/platform/linux/test_filesystem_notifications.py' => 'tests/platform/filesystem_notifications/test_linux.py'
36--- tests/platform/linux/test_filesystem_notifications.py 2012-04-09 20:07:05 +0000
37+++ tests/platform/filesystem_notifications/test_linux.py 2012-04-30 16:23:24 +0000
38@@ -43,7 +43,9 @@
39 from ubuntuone.devtools.handlers import MementoHandler
40 from ubuntuone.syncdaemon import volume_manager
41 from ubuntuone.syncdaemon.tritcask import Tritcask
42-from ubuntuone.platform.linux import filesystem_notifications
43+from ubuntuone.platform.filesystem_notifications import (
44+ linux as filesystem_notifications,
45+)
46
47 # We normally access to private attribs in tests
48 # pylint: disable=W0212
49
50=== renamed file 'tests/platform/windows/test_filesystem_notifications.py' => 'tests/platform/filesystem_notifications/test_windows.py'
51--- tests/platform/windows/test_filesystem_notifications.py 2012-04-27 20:38:13 +0000
52+++ tests/platform/filesystem_notifications/test_windows.py 2012-04-30 16:23:24 +0000
53@@ -50,8 +50,10 @@
54 IN_DELETE,
55 IN_OPEN,
56 )
57-from ubuntuone.platform.windows import filesystem_notifications
58-from ubuntuone.platform.windows.filesystem_notifications import (
59+from ubuntuone.platform.filesystem_notifications import (
60+ windows as filesystem_notifications,
61+)
62+from ubuntuone.platform.filesystem_notifications.windows import (
63 FilesystemMonitor,
64 NotifyProcessor,
65 Watch,
66
67=== modified file 'ubuntuone/platform/__init__.py'
68--- ubuntuone/platform/__init__.py 2012-04-30 16:23:24 +0000
69+++ ubuntuone/platform/__init__.py 2012-04-30 16:23:24 +0000
70@@ -44,6 +44,7 @@
71 source = linux
72
73 from ubuntuone.platform import ipc
74+from ubuntuone.platform import filesystem_notifications
75
76 # This imports needs to be here in order to be included in this namespace
77 from ubuntuone.platform import credentials
78@@ -107,8 +108,8 @@
79 get_filesystem_logger = source.get_filesystem_logger
80
81 # From File System Notifications
82-FilesystemMonitor = source.FilesystemMonitor
83-_GeneralINotifyProcessor = source._GeneralINotifyProcessor
84+FilesystemMonitor = filesystem_notifications.FilesystemMonitor
85+_GeneralINotifyProcessor = filesystem_notifications._GeneralINotifyProcessor
86
87 # IPC
88 ExternalInterface = ipc.ExternalInterface
89
90=== added directory 'ubuntuone/platform/filesystem_notifications'
91=== added file 'ubuntuone/platform/filesystem_notifications/__init__.py'
92--- ubuntuone/platform/filesystem_notifications/__init__.py 1970-01-01 00:00:00 +0000
93+++ ubuntuone/platform/filesystem_notifications/__init__.py 2012-04-30 16:23:24 +0000
94@@ -0,0 +1,41 @@
95+# -*- coding: utf-8 *-*
96+#
97+# Copyright 2012 Canonical Ltd.
98+#
99+# This program is free software: you can redistribute it and/or modify it
100+# under the terms of the GNU General Public License version 3, as published
101+# by the Free Software Foundation.
102+#
103+# This program is distributed in the hope that it will be useful, but
104+# WITHOUT ANY WARRANTY; without even the implied warranties of
105+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
106+# PURPOSE. See the GNU General Public License for more details.
107+#
108+# You should have received a copy of the GNU General Public License along
109+# with this program. If not, see <http://www.gnu.org/licenses/>.
110+#
111+# In addition, as a special exception, the copyright holders give
112+# permission to link the code of portions of this program with the
113+# OpenSSL library under certain conditions as described in each
114+# individual source file, and distribute linked combinations
115+# including the two.
116+# You must obey the GNU General Public License in all respects
117+# for all of the code used other than OpenSSL. If you modify
118+# file(s) with this exception, you may extend this exception to your
119+# version of the file(s), but you are not obligated to do so. If you
120+# do not wish to do so, delete this exception statement from your
121+# version. If you delete this exception statement from all source
122+# files in the program, then also delete it here.
123+"""File System Notification module."""
124+
125+import sys
126+
127+
128+if sys.platform == "win32":
129+ from ubuntuone.platform.filesystem_notifications import windows
130+ FilesystemMonitor = windows.FilesystemMonitor
131+ _GeneralINotifyProcessor = windows.NotifyProcessor
132+else:
133+ from ubuntuone.platform.filesystem_notifications import linux
134+ FilesystemMonitor = linux.FilesystemMonitor
135+ _GeneralINotifyProcessor = linux._GeneralINotifyProcessor
136
137=== renamed file 'ubuntuone/platform/linux/filesystem_notifications.py' => 'ubuntuone/platform/filesystem_notifications/linux.py'
138--- ubuntuone/platform/linux/filesystem_notifications.py 2012-04-27 20:38:13 +0000
139+++ ubuntuone/platform/filesystem_notifications/linux.py 2012-04-30 16:23:24 +0000
140@@ -1,8 +1,6 @@
141+# -*- coding: utf-8 *-*
142 # ubuntuone.syncdaemon.event_queue - Event queuing
143 #
144-# Authors: Facundo Batista <facundo@canonical.com>
145-# Manuel de la Pena <manuel@canonical.com>
146-#
147 # Copyright 2009-2012 Canonical Ltd.
148 #
149 # This program is free software: you can redistribute it and/or modify it
150
151=== renamed file 'ubuntuone/platform/windows/filesystem_notifications.py' => 'ubuntuone/platform/filesystem_notifications/windows.py'
152--- ubuntuone/platform/windows/filesystem_notifications.py 2012-04-27 20:38:13 +0000
153+++ ubuntuone/platform/filesystem_notifications/windows.py 2012-04-30 16:23:24 +0000
154@@ -1,7 +1,4 @@
155-#
156-# Authors: Manuel de la Pena <manuel@canonical.com>
157-# Natalia B. Bidart <natalia.bidart@canonical.com>
158-# Alejandro J. Cura <alecu@canonical.com>
159+# -*- coding: utf-8 *-*
160 #
161 # Copyright 2011-2012 Canonical Ltd.
162 #
163
164=== modified file 'ubuntuone/platform/linux/__init__.py'
165--- ubuntuone/platform/linux/__init__.py 2012-04-30 16:23:24 +0000
166+++ ubuntuone/platform/linux/__init__.py 2012-04-30 16:23:24 +0000
167@@ -70,8 +70,4 @@
168 setup_filesystem_logging,
169 get_filesystem_logger,
170 )
171-from ubuntuone.platform.linux.filesystem_notifications import (
172- FilesystemMonitor,
173- _GeneralINotifyProcessor,
174-)
175 from ubuntuone.platform.linux import notification
176
177=== modified file 'ubuntuone/platform/windows/__init__.py'
178--- ubuntuone/platform/windows/__init__.py 2012-04-30 16:23:24 +0000
179+++ ubuntuone/platform/windows/__init__.py 2012-04-30 16:23:24 +0000
180@@ -38,7 +38,6 @@
181
182 import constants
183 import event_logging
184-import filesystem_notifications
185 import launcher
186 import logger
187 import messaging
188@@ -80,8 +79,4 @@
189 setup_filesystem_logging,
190 get_filesystem_logger,
191 )
192-from ubuntuone.platform.windows.filesystem_notifications import (
193- FilesystemMonitor,
194- NotifyProcessor as _GeneralINotifyProcessor,
195-)
196 from ubuntuone.platform.windows import notification

Subscribers

People subscribed via source and target branches