Merge lp:~statik/ubuntuone-client/fix-lint into lp:ubuntuone-client

Proposed by Elliot Murphy
Status: Merged
Approved by: Eric Casteleijn
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~statik/ubuntuone-client/fix-lint
Merge into: lp:ubuntuone-client
Diff against target: 417 lines (+36/-49)
17 files modified
tests/syncdaemon/test_action_predicates.py (+4/-4)
tests/syncdaemon/test_action_queue.py (+3/-3)
tests/syncdaemon/test_dbus.py (+0/-5)
tests/syncdaemon/test_eq_inotify.py (+0/-3)
tests/syncdaemon/test_fileshelf.py (+1/-1)
tests/syncdaemon/test_fsm.py (+12/-12)
tests/syncdaemon/test_hashqueue.py (+0/-1)
tests/syncdaemon/test_localrescan.py (+3/-3)
tests/syncdaemon/test_sync.py (+1/-1)
tests/syncdaemon/test_vm.py (+1/-5)
ubuntuone/oauthdesktop/auth.py (+1/-1)
ubuntuone/syncdaemon/dbus_interface.py (+1/-1)
ubuntuone/syncdaemon/events_nanny.py (+1/-1)
ubuntuone/syncdaemon/filesystem_manager.py (+1/-2)
ubuntuone/syncdaemon/volume_manager.py (+5/-4)
ubuntuone/u1sync/client.py (+1/-1)
ubuntuone/u1sync/main.py (+1/-1)
To merge this branch: bzr merge lp:~statik/ubuntuone-client/fix-lint
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Rick McBride (community) Approve
Review via email: mp+19036@code.launchpad.net

Commit message

Fix all lint warnings on lucid

To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

Fix all lint warnings on lucid. There is one change I wasn't sure about, it is commented in the diff.

Revision history for this message
Rick McBride (rmcbride) wrote :

YAY no more lint warnings on Lucid

review: Approve
Revision history for this message
Eric Casteleijn (thisfred) wrote :

+YAY!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/syncdaemon/test_action_predicates.py'
2--- tests/syncdaemon/test_action_predicates.py 2010-01-13 20:07:41 +0000
3+++ tests/syncdaemon/test_action_predicates.py 2010-02-10 17:40:25 +0000
4@@ -86,10 +86,10 @@
5 def test_simple_commands(self):
6 """Test command execution."""
7 out = []
8- cmd = AppendCommand(self.request_queue,
9- append_to=out, value="a").start()
10- cmd = AppendCommand(self.request_queue,
11- append_to=out, value="b").start()
12+ AppendCommand(self.request_queue,
13+ append_to=out, value="a").start()
14+ AppendCommand(self.request_queue,
15+ append_to=out, value="b").start()
16 self.request_queue.run()
17 self.request_queue.run()
18 self.assertEqual(["a", "b"], out)
19
20=== modified file 'tests/syncdaemon/test_action_queue.py'
21--- tests/syncdaemon/test_action_queue.py 2010-01-29 18:09:48 +0000
22+++ tests/syncdaemon/test_action_queue.py 2010-02-10 17:40:25 +0000
23@@ -360,7 +360,7 @@
24
25 self.command.action_queue.client.create_udf = check
26
27- res = self.command._run()
28+ self.command._run()
29
30 self.assertTrue(self.called, 'command was called')
31
32@@ -420,7 +420,7 @@
33
34 self.command.action_queue.client.list_volumes = check
35
36- res = self.command._run()
37+ self.command._run()
38
39 self.assertTrue(self.called, 'command was called')
40
41@@ -481,7 +481,7 @@
42
43 self.command.action_queue.client.delete_volume = check
44
45- res = self.command._run()
46+ self.command._run()
47
48 self.assertTrue(self.called, 'command was called')
49
50
51=== modified file 'tests/syncdaemon/test_dbus.py'
52--- tests/syncdaemon/test_dbus.py 2010-02-04 18:04:41 +0000
53+++ tests/syncdaemon/test_dbus.py 2010-02-10 17:40:25 +0000
54@@ -1657,8 +1657,6 @@
55 def test_create_server_error(self):
56 """Test for Folders.create."""
57 path = os.path.join(self.home_dir, u'ñoño')
58- id = uuid.uuid4()
59- node_id = uuid.uuid4()
60 d = defer.Deferred()
61 # patch AQ.create_udf
62 def create_udf(path, name, marker):
63@@ -1685,8 +1683,6 @@
64 def test_create_client_error(self):
65 """Test for Folders.create."""
66 path = os.path.join(self.home_dir, u'ñoño')
67- id = uuid.uuid4()
68- node_id = uuid.uuid4()
69 d = defer.Deferred()
70 # patch AQ.create_udf
71 def create_udf(path, name, marker):
72@@ -1789,7 +1785,6 @@
73 udf = self._create_udf(uuid.uuid4(), 'node_id', suggested_path,
74 subscribed=False)
75 yield self.main.vm.add_udf(udf)
76- signal_deferred = defer.Deferred()
77 d = defer.Deferred()
78 def subscribe_handler(info):
79 """FolderSubscribed handler."""
80
81=== modified file 'tests/syncdaemon/test_eq_inotify.py'
82--- tests/syncdaemon/test_eq_inotify.py 2010-02-08 19:24:06 +0000
83+++ tests/syncdaemon/test_eq_inotify.py 2010-02-10 17:40:25 +0000
84@@ -1165,7 +1165,6 @@
85 fromfile = os.path.join(self.root_dir, "mdid.u1partial.foo")
86 root_dir = os.path.join(self.root_dir, "my_files")
87 tofile = os.path.join(root_dir, "foo")
88- mypath = functools.partial(os.path.join, root_dir)
89 os.mkdir(root_dir)
90 open(fromfile, "w").close()
91 self.eq.add_to_mute_filter("FS_FILE_CREATE", tofile)
92@@ -1366,7 +1365,6 @@
93 def test_move_udf_ancestor(self):
94 """UDF is unsubscribed on ancestor move."""
95 original = self.eq.fs.vm.unsubscribe_udf
96- expected = []
97 path = self.udf.ancestors[-2] # an ancestor common to both UDFs
98 # generate IN_MOVED_FROM and IN_MOVED_TO
99 newpath = path + u'.old'
100@@ -1405,7 +1403,6 @@
101 def test_move_udf_itself(self):
102 """UDF is unsubscribed if renamed."""
103 original = self.eq.fs.vm.unsubscribe_udf
104- expected = []
105 newpath = self.udf.path + u'.old'
106 os.rename(self.udf.path, newpath)
107 assert os.path.exists(newpath)
108
109=== modified file 'tests/syncdaemon/test_fileshelf.py'
110--- tests/syncdaemon/test_fileshelf.py 2010-01-15 20:04:32 +0000
111+++ tests/syncdaemon/test_fileshelf.py 2010-02-10 17:40:25 +0000
112@@ -226,7 +226,7 @@
113
114 def test_custom_unpickle(self):
115 """Test the _pickle and _unpikle methods."""
116- path = self.mktemp('my_shelf')
117+ self.mktemp('my_shelf')
118 class InMemoryFileShelf(FileShelf):
119 """A in-memory FileShelf."""
120 values = {}
121
122=== modified file 'tests/syncdaemon/test_fsm.py'
123--- tests/syncdaemon/test_fsm.py 2010-01-26 19:46:37 +0000
124+++ tests/syncdaemon/test_fsm.py 2010-02-10 17:40:25 +0000
125@@ -1853,7 +1853,7 @@
126 """Test that a dir is deleted, when is not empty and modified."""
127 local_dir = os.path.join(self.root_dir, "foo")
128 os.mkdir(local_dir)
129- mdid = self.fsm.create(local_dir, "", is_dir=True)
130+ self.fsm.create(local_dir, "", is_dir=True)
131 self.fsm.set_node_id(local_dir, "uuid")
132
133 local_file = os.path.join(local_dir, "bar.txt")
134@@ -1875,12 +1875,12 @@
135
136 local_dir = os.path.join(self.root_dir, "foo")
137 os.mkdir(local_dir)
138- mdid = self.fsm.create(local_dir, "", is_dir=True)
139+ self.fsm.create(local_dir, "", is_dir=True)
140 self.fsm.set_node_id(local_dir, "uuid")
141
142 local_file = os.path.join(local_dir, "bar.txt")
143 open(local_file, 'w').close() # touch bar.txt so it exists
144- mdid_file = self.fsm.create(local_file, "")
145+ self.fsm.create(local_file, "")
146 self.fsm.set_node_id(local_file, "uuid_file")
147
148 self.fsm.delete_file(local_dir)
149@@ -1898,7 +1898,7 @@
150 log.read() # ignore log content till now
151
152 local_dir = os.path.join(self.root_dir, "foo")
153- mdid = self.fsm.create(local_dir, "", is_dir=True)
154+ self.fsm.create(local_dir, "", is_dir=True)
155 self.fsm.set_node_id(local_dir, "uuid")
156
157 # local_dir does not exist on the file system
158@@ -2006,7 +2006,7 @@
159 """Test the recursive changed feature for a non empty dir."""
160 local_dir = os.path.join(self.root_dir, "foo")
161 os.mkdir(local_dir)
162- mdid = self.fsm.create(local_dir, "", is_dir=True)
163+ self.fsm.create(local_dir, "", is_dir=True)
164 self.fsm.set_node_id(local_dir, "uuid")
165
166 sub_dir = os.path.join(local_dir, "bar")
167@@ -2707,11 +2707,11 @@
168 if os.path.exists(d):
169 shutil.rmtree(d)
170 os.mkdir(d)
171- mdid = self.fsm.create(d, '', is_dir=True)
172+ self.fsm.create(d, '', is_dir=True)
173 self.fsm.set_node_id(d, 'uuid')
174
175 open(self.some_file, 'w').close()
176- mdid_file = self.fsm.create(self.some_file, "")
177+ self.fsm.create(self.some_file, "")
178 self.fsm.set_node_id(self.some_file, "uuid_file")
179
180 def tearDown(self):
181@@ -2737,7 +2737,7 @@
182 """Check paths starting with excluding directories with same prefix."""
183 similar_dir = os.path.join(self.root_dir, 'fooo')
184 os.mkdir(similar_dir)
185- mdid = self.fsm.create(similar_dir, '', is_dir=True)
186+ self.fsm.create(similar_dir, '', is_dir=True)
187 self.fsm.set_node_id(similar_dir, 'uuid')
188
189 expected = sorted([(self.some_dir, True), (self.sub_dir, True),
190@@ -2759,15 +2759,15 @@
191 def test_get_for_server_rescan_by_path(self):
192 """Test FSM.get_for_server_rescan_by_path method"""
193 # create the share fsm object
194- share_mdid = self.fsm.create(self.share_path, self.share.volume_id)
195+ self.fsm.create(self.share_path, self.share.volume_id)
196 self.fsm.set_node_id(self.share_path, "share_uuid")
197 # create a few nodes
198 path1 = os.path.join(self.share_path, "path1")
199 path2 = os.path.join(self.share_path, "path1", "path2")
200 path_out = os.path.join(self.root_dir, "path1")
201- mdid1 = self.fsm.create(path1, "share", is_dir=True)
202- mdid2 = self.fsm.create(path2, "share")
203- mdid_out = self.fsm.create(path_out, "")
204+ self.fsm.create(path1, "share", is_dir=True)
205+ self.fsm.create(path2, "share")
206+ self.fsm.create(path_out, "")
207 self.fsm.set_node_id(path1, "uuid1")
208 self.fsm.set_node_id(path2, "uuid2")
209 self.fsm.set_node_id(path_out, "uuid3")
210
211=== modified file 'tests/syncdaemon/test_hashqueue.py'
212--- tests/syncdaemon/test_hashqueue.py 2010-02-05 02:01:13 +0000
213+++ tests/syncdaemon/test_hashqueue.py 2010-02-10 17:40:25 +0000
214@@ -540,7 +540,6 @@
215 hasher = content_hash_factory()
216 hasher.hash_object.update(testinfo)
217 testfile = os.path.join(self.test_dir, "testfile")
218- testhash = hasher.content_hash()
219 # send what to hash
220 with open(testfile, "w") as fh:
221 fh.write(testinfo)
222
223=== modified file 'tests/syncdaemon/test_localrescan.py'
224--- tests/syncdaemon/test_localrescan.py 2010-02-09 14:21:08 +0000
225+++ tests/syncdaemon/test_localrescan.py 2010-02-10 17:40:25 +0000
226@@ -1679,8 +1679,8 @@
227 """The file is created but never started to download."""
228 # create the file in metadata
229 path = os.path.join(self.share.path, "a")
230-# open(path, "w").close()
231- mdid = self.fsm.create(path, self.share.volume_id, is_dir=False, node_id="1")
232+ # open(path, "w").close()
233+ self.fsm.create(path, self.share.volume_id, is_dir=False, node_id="1")
234
235 def check(_):
236 """No event, and no MD"""
237@@ -1712,7 +1712,7 @@
238 os.mkdir(dir)
239 path_b = os.path.join(self.share.path, "dir", "b")
240 open(path_b, "w").close()
241- mdid_dir = self.fsm.create(dir, self.share.volume_id, is_dir=True)
242+ self.fsm.create(dir, self.share.volume_id, is_dir=True)
243 self.fsm.set_node_id(dir, "uuid2")
244
245 mdid_b = self.fsm.create(path_b, self.share.volume_id, is_dir=False)
246
247=== modified file 'tests/syncdaemon/test_sync.py'
248--- tests/syncdaemon/test_sync.py 2010-01-22 20:31:51 +0000
249+++ tests/syncdaemon/test_sync.py 2010-02-10 17:40:25 +0000
250@@ -104,7 +104,7 @@
251 def test_set(self):
252 """test that changes to the key are keeped in _changes until sync"""
253 path = os.path.join(self.share.path, 'path')
254- mdid = self.fsm.create(path, "share", node_id='uuid1')
255+ self.fsm.create(path, "share", node_id='uuid1')
256 key = FSKey(self.fsm, path=path)
257 key.set(local_hash='a_hash')
258 self.assertEquals('a_hash', key._changes['local_hash'])
259
260=== modified file 'tests/syncdaemon/test_vm.py'
261--- tests/syncdaemon/test_vm.py 2010-02-01 13:43:33 +0000
262+++ tests/syncdaemon/test_vm.py 2010-02-10 17:40:25 +0000
263@@ -474,7 +474,7 @@
264 """Test for VolumeManager._delete_fsm_object"""
265 path = os.path.join(self.root_dir, 'dir')
266 os.makedirs(path)
267- mdid = self.main.fs.create(path, "", is_dir=True)
268+ self.main.fs.create(path, "", is_dir=True)
269 self.main.fs.set_node_id(path, 'dir_node_id')
270 self.main.event_q.inotify_add_watch(path)
271 self.assertTrue(self.main.event_q.inotify_has_watch(path), path)
272@@ -858,7 +858,6 @@
273
274 def test_handle_AQ_LIST_VOLUMES_root(self):
275 """Test the handling of the AQ_LIST_VOLUMES event."""
276- share_id = uuid.uuid4()
277 root_volume = volumes.RootVolume(uuid.uuid4())
278 response = [root_volume]
279 self.vm.refresh_volumes = lambda: self.fail('refresh_volumes called!')
280@@ -1209,8 +1208,6 @@
281 """Test for handle_AQ_CREATE_UDF_ERROR."""
282 d = defer.Deferred()
283 path = os.path.join(self.home_dir, u'ñoño'.encode("utf8"))
284- udf_id = uuid.uuid4()
285- node_id = uuid.uuid4()
286 # patch AQ.create_udf
287 def create_udf(path, name, marker):
288 """Fake create_udf"""
289@@ -1393,7 +1390,6 @@
290 node_id=str(uuid.uuid4()),
291 volume_id='accepted_share_id',
292 access_level='Modify', accepted=False)
293- share_path_view = os.path.join(self.shares_dir, 'fake_share_view')
294 share_view = Share(path=share_path, volume_id='share_id_view',
295 access_level='View', accepted=True)
296 self.vm.add_share(share_modify)
297
298=== modified file 'ubuntuone/oauthdesktop/auth.py'
299--- ubuntuone/oauthdesktop/auth.py 2009-12-23 19:44:00 +0000
300+++ ubuntuone/oauthdesktop/auth.py 2010-02-10 17:40:25 +0000
301@@ -90,7 +90,7 @@
302 newurl = headers['uri']
303 else:
304 return
305- void = fp.read()
306+ fp.read()
307 fp.close()
308 # In case the server sent a relative URL, join with original:
309 newurl = urllib.basejoin(self.type + ":" + url, newurl)
310
311=== modified file 'ubuntuone/syncdaemon/dbus_interface.py'
312--- ubuntuone/syncdaemon/dbus_interface.py 2010-02-01 17:48:25 +0000
313+++ ubuntuone/syncdaemon/dbus_interface.py 2010-02-10 17:40:25 +0000
314@@ -1434,7 +1434,7 @@
315 try:
316 access_token = self.main.get_access_token()
317 self.event_queue.push('SYS_CONNECT', access_token)
318- except NoAccessToken, e:
319+ except NoAccessToken:
320 if do_login:
321 yield self._request_token()
322 self.connect(do_login=False)
323
324=== modified file 'ubuntuone/syncdaemon/events_nanny.py'
325--- ubuntuone/syncdaemon/events_nanny.py 2009-11-20 22:00:25 +0000
326+++ ubuntuone/syncdaemon/events_nanny.py 2010-02-10 17:40:25 +0000
327@@ -96,7 +96,7 @@
328 self._hashing.add(path)
329
330 try:
331- opened = self._reduce_opened(path)
332+ self._reduce_opened(path)
333 except KeyError:
334 # it wasn't supervised by open
335 return
336
337=== modified file 'ubuntuone/syncdaemon/filesystem_manager.py'
338--- ubuntuone/syncdaemon/filesystem_manager.py 2010-01-14 14:18:32 +0000
339+++ ubuntuone/syncdaemon/filesystem_manager.py 2010-02-10 17:40:25 +0000
340@@ -277,7 +277,7 @@
341 # check if the share exists
342 try:
343 self._get_share(mdobj["share_id"])
344- except KeyError, e:
345+ except KeyError:
346 # oops, the share is gone!, invalidate this mdid
347 log_warning('Share %s disappeared! deleting mdid: %s', mdobj['share_id'], mdid)
348 del self.fs[mdid]
349@@ -784,7 +784,6 @@
350
351 def _get_partial_path(self, mdobj):
352 """Gets the path of the .partial file for a given mdobj"""
353- is_dir = mdobj["is_dir"]
354 path = self.get_abspath(mdobj['share_id'], mdobj['path'])
355 partial_path = os.path.join(self.partials_dir, mdobj['mdid'] + '.u1partial')
356 dirname, filename = os.path.split(path)
357
358=== modified file 'ubuntuone/syncdaemon/volume_manager.py'
359--- ubuntuone/syncdaemon/volume_manager.py 2010-02-09 15:22:50 +0000
360+++ ubuntuone/syncdaemon/volume_manager.py 2010-02-10 17:40:25 +0000
361@@ -905,7 +905,7 @@
362 return result
363 try:
364 d = self._scan_udf(udf)
365- except KeyError, e:
366+ except KeyError:
367 push_error("METADATA_DOES_NOT_EXIST")
368 else:
369 d.addCallback(subscribe)
370@@ -961,7 +961,7 @@
371 def handle_AQ_DELETE_VOLUME_ERROR(self, volume_id, error):
372 """Handle AQ_DELETE_VOLUME_ERROR."""
373 try:
374- volume = self.get_volume(str(volume_id))
375+ self.get_volume(str(volume_id))
376 except KeyError:
377 self.log.warning("Received a AQ_DELETE_VOLUME_ERROR of a missing"
378 "volume id")
379@@ -1310,9 +1310,10 @@
380 if 'id' in share.__dict__:
381 share.volume_id = share.__dict__.pop('id')
382 if 'free_bytes' in share.__dict__:
383- free_bytes = share.__dict__.pop('free_bytes')
384+ # FIXME: REVIEWERS PLEASE CONFIRM THIS IS CORRECT
385+ share.free_bytes = share.__dict__.pop('free_bytes')
386 else:
387- free_bytes = None
388+ share.free_bytes = None
389 return share
390 # handle the root special case
391 if share.path == self._root_dir or share.id == '':
392
393=== modified file 'ubuntuone/u1sync/client.py'
394--- ubuntuone/u1sync/client.py 2010-01-20 23:18:55 +0000
395+++ ubuntuone/u1sync/client.py 2010-02-10 17:40:25 +0000
396@@ -365,7 +365,7 @@
397 lambda f: waiter.wake((None, None, f)))
398 else:
399 waiter.wake((d, None, None))
400- except Exception, e:
401+ except Exception:
402 waiter.wake((None, sys.exc_info(), None))
403
404 self.reactor.callFromThread(runner)
405
406=== modified file 'ubuntuone/u1sync/main.py'
407--- ubuntuone/u1sync/main.py 2010-01-20 22:56:50 +0000
408+++ ubuntuone/u1sync/main.py 2010-02-10 17:40:25 +0000
409@@ -442,7 +442,7 @@
410 """Capture the exception from calling func."""
411 try:
412 func()
413- except Exception, e:
414+ except Exception:
415 queue.put(sys.exc_info())
416 else:
417 queue.put(None)

Subscribers

People subscribed via source and target branches