Merge lp:~nataliabidart/magicicada-client/use-protocol-from-wheel into lp:magicicada-client

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 1443
Merged at revision: 1443
Proposed branch: lp:~nataliabidart/magicicada-client/use-protocol-from-wheel
Merge into: lp:magicicada-client
Diff against target: 544 lines (+69/-125)
18 files modified
.bzrignore (+0/-1)
.coveragerc (+0/-27)
HACKING (+2/-6)
Makefile (+3/-15)
dependencies.txt (+0/-1)
requirements.txt (+1/-0)
ubuntuone/platform/tests/linux/test_vm.py (+3/-4)
ubuntuone/syncdaemon/action_queue.py (+12/-9)
ubuntuone/syncdaemon/hash_queue.py (+3/-8)
ubuntuone/syncdaemon/interaction_interfaces.py (+3/-5)
ubuntuone/syncdaemon/sync.py (+6/-6)
ubuntuone/syncdaemon/tests/test_action_queue.py (+7/-7)
ubuntuone/syncdaemon/tests/test_hashqueue.py (+6/-7)
ubuntuone/syncdaemon/tests/test_interaction_interfaces.py (+6/-8)
ubuntuone/syncdaemon/tests/test_localrescan.py (+2/-3)
ubuntuone/syncdaemon/tests/test_sync.py (+4/-5)
ubuntuone/syncdaemon/tests/test_vm.py (+5/-8)
ubuntuone/syncdaemon/volume_manager.py (+6/-5)
To merge this branch: bzr merge lp:~nataliabidart/magicicada-client/use-protocol-from-wheel
Reviewer Review Type Date Requested Status
Facundo Batista Approve
Review via email: mp+343270@code.launchpad.net

Commit message

- Use protocol from wheel release.
- Fix copyright headers from modified files.

To post a comment you must log in.
Revision history for this message
Facundo Batista (facundo) wrote :

Rock!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2016-10-24 20:59:39 +0000
3+++ .bzrignore 2018-04-14 23:49:33 +0000
4@@ -14,4 +14,3 @@
5 .protocol
6 clientdefs.py
7 logging.conf
8-ubuntuone/storageprotocol
9
10=== removed file '.coveragerc'
11--- .coveragerc 2010-04-30 14:30:34 +0000
12+++ .coveragerc 1970-01-01 00:00:00 +0000
13@@ -1,27 +0,0 @@
14-# .coveragerc to control coverage.py
15-[run]
16-branch = True
17-
18-[report]
19-# Regexes for lines to exclude from consideration
20-exclude_lines =
21- # Have to re-enable the standard pragma
22- pragma: no cover
23-
24- # Don't complain about missing debug-only code:
25- def __repr__
26- if self\.debug
27-
28- # Don't complain if tests don't hit defensive assertion code:
29- raise AssertionError
30- raise NotImplementedError
31-
32- # Don't complain if non-runnable code isn't run:
33- if 0:
34- if __name__ == .__main__.:
35-
36-ignore_errors = True
37-
38-omit =
39- /usr
40- tests
41
42=== modified file 'HACKING'
43--- HACKING 2018-03-08 18:32:01 +0000
44+++ HACKING 2018-04-14 23:49:33 +0000
45@@ -1,9 +1,5 @@
46-In order to run tests in ubuntuone-client, you will need to have a built
47-version of ubuntuone-storage-protocol in a tree, or installed. You can
48-specify the path to a built tree with the --with-protocol option to configure,
49-or autogen.sh (which calls configure after creating it).
50-
51-Or you can simply bootstrap and everything will happen automagically:
52+In order to run tests in ubuntuone-client, you can simply bootstrap and
53+everything will be setup automagically:
54
55 $: sudo apt-get install make
56 $: make bootstrap
57
58=== modified file 'Makefile'
59--- Makefile 2018-03-25 11:12:10 +0000
60+++ Makefile 2018-04-14 23:49:33 +0000
61@@ -28,31 +28,19 @@
62 # For further info, check http://launchpad.net/magicicada-client
63
64 ENV = $(CURDIR)/.env
65-PROTOCOL_DIR = $(CURDIR)/.protocol
66-PROTOCOL_LINK = ubuntuone/storageprotocol
67
68 deps:
69 cat dependencies.txt | sudo xargs apt-get install -y --no-install-recommends
70 cat dependencies-devel.txt | sudo xargs apt-get install -y --no-install-recommends
71
72-$(PROTOCOL_DIR):
73- bzr branch lp:magicicada-protocol $(PROTOCOL_DIR)
74-
75-$(PROTOCOL_LINK): $(PROTOCOL_DIR)
76- ln -s $(PROTOCOL_DIR)/$(PROTOCOL_LINK) $(PROTOCOL_LINK)
77-
78-update-protocol:
79- cd $(PROTOCOL_DIR) && bzr pull && python setup.py build
80-
81 build:
82 $(ENV)/bin/python setup.py build
83
84-bootstrap: deps $(PROTOCOL_DIR) $(PROTOCOL_LINK) update-protocol venv build
85+bootstrap: deps venv build
86
87 docker-bootstrap: clean
88 cat dependencies.txt | xargs apt-get install -y --no-install-recommends
89 cat dependencies-devel.txt | xargs apt-get install -y --no-install-recommends
90- $(MAKE) $(PROTOCOL_DIR) $(PROTOCOL_LINK) update-protocol
91
92 venv:
93 virtualenv --system-site-packages $(ENV)
94@@ -65,8 +53,8 @@
95 ./run-tests
96
97 clean:
98- rm -rf build _trial_temp $(PROTOCOL_DIR) $(PROTOCOL_LINK) $(ENV)
99+ rm -rf build _trial_temp $(ENV)
100 find -name '*.pyc' -delete
101
102 .PHONY:
103- deps update-protocol bootstrap lint test clean
104+ deps bootstrap lint test clean
105
106=== modified file 'dependencies.txt'
107--- dependencies.txt 2018-03-14 21:01:56 +0000
108+++ dependencies.txt 2018-04-14 23:49:33 +0000
109@@ -1,5 +1,4 @@
110 gir1.2-soup-2.4
111-protobuf-compiler
112 python-configglue
113 python-dirspec
114 python-distutils-extra
115
116=== modified file 'requirements.txt'
117--- requirements.txt 2018-03-18 11:59:08 +0000
118+++ requirements.txt 2018-04-14 23:49:33 +0000
119@@ -1,1 +1,2 @@
120 Send2Trash==1.5.0
121+magicicadaprotocol==2.0
122
123=== modified file 'ubuntuone/platform/tests/linux/test_vm.py'
124--- ubuntuone/platform/tests/linux/test_vm.py 2016-07-30 21:58:48 +0000
125+++ ubuntuone/platform/tests/linux/test_vm.py 2018-04-14 23:49:33 +0000
126@@ -1,8 +1,7 @@
127-# tests.platform.linux - linux platform tests
128-#
129-# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
130+# -*- coding: utf-8 -*-
131 #
132 # Copyright 2010-2012 Canonical Ltd.
133+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
134 #
135 # This program is free software: you can redistribute it and/or modify it
136 # under the terms of the GNU General Public License version 3, as published
137@@ -33,10 +32,10 @@
138 import os
139 import uuid
140
141+from magicicadaprotocol import request
142 from twisted.internet import defer
143
144 from contrib.testing.testcase import FakeMain
145-from ubuntuone.storageprotocol import request
146 from ubuntuone.syncdaemon.tests.test_vm import (
147 MetadataTestCase,
148 BaseVolumeManagerTests,
149
150=== modified file 'ubuntuone/syncdaemon/action_queue.py'
151--- ubuntuone/syncdaemon/action_queue.py 2018-03-14 21:01:56 +0000
152+++ ubuntuone/syncdaemon/action_queue.py 2018-04-14 23:49:33 +0000
153@@ -42,20 +42,23 @@
154
155 import OpenSSL.SSL
156
157-from zope.interface import implements
158+from magicicadaprotocol import (
159+ content_hash,
160+ errors as protocol_errors,
161+ protocol_pb2,
162+)
163+from magicicadaprotocol.client import (
164+ ThrottlingStorageClient,
165+ ThrottlingStorageClientFactory,
166+)
167+from magicicadaprotocol.context import get_ssl_context
168 from twisted.internet import reactor, defer, task
169 from twisted.internet import error as twisted_errors
170 from twisted.python.failure import Failure, DefaultException
171+from zope.interface import implements
172
173 from ubuntuone import clientdefs
174 from ubuntuone.platform import platform, remove_file
175-from ubuntuone.storageprotocol import protocol_pb2, content_hash
176-from ubuntuone.storageprotocol import errors as protocol_errors
177-from ubuntuone.storageprotocol.client import (
178- ThrottlingStorageClient,
179- ThrottlingStorageClientFactory,
180-)
181-from ubuntuone.storageprotocol.context import get_ssl_context
182 from ubuntuone.syncdaemon.interfaces import IActionQueue, IMarker
183 from ubuntuone.syncdaemon.logger import mklog, TRACE
184 from ubuntuone.syncdaemon import config, offload_queue
185@@ -884,7 +887,7 @@
186
187 def buildProtocol(self, addr):
188 """Build the client and store it. Connect callbacks."""
189- # XXX: Very Important Note: within the storageprotocol project,
190+ # XXX: Very Important Note: within the magicicadaprotocol project,
191 # ThrottlingStorageClient.connectionMade sets self.factory.client
192 # to self *if* self.factory.client is not None.
193 # Since buildProcotol is called before connectionMade, the latter
194
195=== modified file 'ubuntuone/syncdaemon/hash_queue.py'
196--- ubuntuone/syncdaemon/hash_queue.py 2016-09-17 14:29:53 +0000
197+++ ubuntuone/syncdaemon/hash_queue.py 2018-04-14 23:49:33 +0000
198@@ -1,10 +1,7 @@
199-# ubuntuone.syncdaemon.hash_queue - hash queues
200-#
201-# Authors: Facundo Batista <facundo@canonical.com>
202-# Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
203-# Alejandro J. Cura <alecu@canonical.com>
204+# -*- coding: utf-8 -*-
205 #
206 # Copyright 2009-2012 Canonical Ltd.
207+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
208 #
209 # This program is free software: you can redistribute it and/or modify it
210 # under the terms of the GNU General Public License version 3, as published
211@@ -41,11 +38,9 @@
212
213 from collections import OrderedDict
214
215+from magicicadaprotocol.content_hash import content_hash_factory, crc32
216 from twisted.internet import reactor
217
218-from ubuntuone.storageprotocol.content_hash import \
219- content_hash_factory, crc32
220-
221 from ubuntuone.platform import (
222 open_file,
223 stat_path,
224
225=== modified file 'ubuntuone/syncdaemon/interaction_interfaces.py'
226--- ubuntuone/syncdaemon/interaction_interfaces.py 2016-09-17 01:06:23 +0000
227+++ ubuntuone/syncdaemon/interaction_interfaces.py 2018-04-14 23:49:33 +0000
228@@ -1,6 +1,7 @@
229 # -*- coding: utf-8 -*-
230 #
231 # Copyright 2011-2015 Canonical Ltd.
232+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
233 #
234 # This program is free software: you can redistribute it and/or modify it
235 # under the terms of the GNU General Public License version 3, as published
236@@ -44,17 +45,14 @@
237
238 from functools import wraps
239
240+from magicicadaprotocol import request
241 from twisted.internet import defer
242
243 from ubuntuone.networkstate import NetworkManagerState
244-try:
245- from ubuntuone.networkstate.networkstates import ONLINE
246-except ImportError:
247- from ubuntuone.networkstate import ONLINE
248+from ubuntuone.networkstate.networkstates import ONLINE
249
250 from ubuntuone.logger import log_call
251 from ubuntuone.platform import ExternalInterface
252-from ubuntuone.storageprotocol import request
253 from ubuntuone.syncdaemon import config
254 from ubuntuone.syncdaemon.action_queue import Download, Upload
255 from ubuntuone.syncdaemon.interfaces import IMarker
256
257=== modified file 'ubuntuone/syncdaemon/sync.py'
258--- ubuntuone/syncdaemon/sync.py 2018-03-09 09:11:05 +0000
259+++ ubuntuone/syncdaemon/sync.py 2018-04-14 23:49:33 +0000
260@@ -1,7 +1,7 @@
261 # -*- coding: utf-8 -*-
262 #
263 # Copyright 2009-2012 Canonical Ltd.
264-# Copyright 2015-2018 Chicharreros
265+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
266 #
267 # This program is free software: you can redistribute it and/or modify it
268 # under the terms of the GNU General Public License version 3, as published
269@@ -31,15 +31,15 @@
270
271 from __future__ import with_statement
272
273+import logging
274 import os
275-import logging
276+import sys
277 from operator import attrgetter
278-import sys
279+
280+from magicicadaprotocol import delta
281
282 from ubuntuone.syncdaemon.marker import MDMarker
283-from ubuntuone.storageprotocol import delta
284-from ubuntuone.syncdaemon.fsm.fsm import \
285- StateMachineRunner, StateMachine
286+from ubuntuone.syncdaemon.fsm.fsm import StateMachineRunner, StateMachine
287 from ubuntuone.syncdaemon import u1fsfsm
288 from ubuntuone.syncdaemon.logger import DebugCapture
289 from ubuntuone.syncdaemon.filesystem_manager import (
290
291=== modified file 'ubuntuone/syncdaemon/tests/test_action_queue.py'
292--- ubuntuone/syncdaemon/tests/test_action_queue.py 2018-03-14 21:01:56 +0000
293+++ ubuntuone/syncdaemon/tests/test_action_queue.py 2018-04-14 23:49:33 +0000
294@@ -45,6 +45,13 @@
295
296 import OpenSSL.SSL
297
298+from magicicadaprotocol import (
299+ client,
300+ content_hash,
301+ errors,
302+ protocol_pb2,
303+ request,
304+)
305 from mocker import Mocker, MockerTestCase, ANY, expect
306 from twisted.internet import defer, reactor
307 from twisted.internet import error as twisted_error
308@@ -65,13 +72,6 @@
309 from ubuntuone.devtools.testcases import skipTest
310 from ubuntuone import logger, clientdefs
311 from ubuntuone.platform import open_file, platform, path_exists
312-from ubuntuone.storageprotocol import (
313- client,
314- content_hash,
315- errors,
316- protocol_pb2,
317- request,
318-)
319 from ubuntuone.syncdaemon import interfaces, config
320 from ubuntuone.syncdaemon import action_queue
321 from ubuntuone.syncdaemon.action_queue import (
322
323=== modified file 'ubuntuone/syncdaemon/tests/test_hashqueue.py'
324--- ubuntuone/syncdaemon/tests/test_hashqueue.py 2016-09-17 14:29:53 +0000
325+++ ubuntuone/syncdaemon/tests/test_hashqueue.py 2018-04-14 23:49:33 +0000
326@@ -1,8 +1,7 @@
327-#
328-# Authors: Facundo Batista <facundo@canonical.com>
329-# Alejandro J. Cura <alecu@canonical.com>
330+# -*- coding: utf-8 -*-
331 #
332 # Copyright 2009-2012 Canonical Ltd.
333+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
334 #
335 # This program is free software: you can redistribute it and/or modify it
336 # under the terms of the GNU General Public License version 3, as published
337@@ -32,13 +31,14 @@
338
339 from __future__ import with_statement
340
341+import logging
342 import os
343 import random
344+import threading
345 import time
346-import logging
347-import threading
348-
349 from StringIO import StringIO
350+
351+from magicicadaprotocol.content_hash import content_hash_factory, crc32
352 from twisted.trial.unittest import TestCase as TwistedTestCase
353 from twisted.internet import defer, reactor
354 from ubuntuone.devtools.handlers import MementoHandler
355@@ -48,7 +48,6 @@
356 from ubuntuone.platform import open_file, stat_path
357 from ubuntuone.syncdaemon import hash_queue
358 from ubuntuone.syncdaemon.hash_queue import HASHQUEUE_DELAY
359-from ubuntuone.storageprotocol.content_hash import content_hash_factory, crc32
360
361 FAKE_TIMESTAMP = 1
362
363
364=== modified file 'ubuntuone/syncdaemon/tests/test_interaction_interfaces.py'
365--- ubuntuone/syncdaemon/tests/test_interaction_interfaces.py 2016-09-17 01:06:23 +0000
366+++ ubuntuone/syncdaemon/tests/test_interaction_interfaces.py 2018-04-14 23:49:33 +0000
367@@ -1,6 +1,7 @@
368 # -*- coding: utf-8 -*-
369 #
370 # Copyright 2011-2015 Canonical Ltd.
371+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
372 #
373 # This program is free software: you can redistribute it and/or modify it
374 # under the terms of the GNU General Public License version 3, as published
375@@ -31,15 +32,9 @@
376 import logging
377 import os
378
379+from magicicadaprotocol.protocol_pb2 import AccountInfo
380 from twisted.internet import defer
381 from ubuntuone.devtools.handlers import MementoHandler
382-try:
383- from ubuntuone.networkstate.networkstates import ONLINE
384-except ImportError:
385- from ubuntuone.networkstate import ONLINE
386-from ubuntuone.platform.tests.ipc.test_perspective_broker import (
387- FakeNetworkManagerState,
388-)
389
390 from contrib.testing.testcase import (
391 FAKED_CREDENTIALS,
392@@ -50,8 +45,11 @@
393 FakeMainTestCase,
394 skipIfOS,
395 )
396+from ubuntuone.networkstate.networkstates import ONLINE
397 from ubuntuone.platform import make_dir, make_link
398-from ubuntuone.storageprotocol.protocol_pb2 import AccountInfo
399+from ubuntuone.platform.tests.ipc.test_perspective_broker import (
400+ FakeNetworkManagerState,
401+)
402 from ubuntuone.syncdaemon import (
403 config,
404 interaction_interfaces,
405
406=== modified file 'ubuntuone/syncdaemon/tests/test_localrescan.py'
407--- ubuntuone/syncdaemon/tests/test_localrescan.py 2018-03-08 19:39:13 +0000
408+++ ubuntuone/syncdaemon/tests/test_localrescan.py 2018-04-14 23:49:33 +0000
409@@ -1,6 +1,7 @@
410 # -*- coding: utf-8 -*-
411 #
412 # Copyright 2009-2012 Canonical Ltd.
413+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
414 #
415 # This program is free software: you can redistribute it and/or modify it
416 # under the terms of the GNU General Public License version 3, as published
417@@ -34,6 +35,7 @@
418 import os
419 import uuid
420
421+from magicicadaprotocol import content_hash as storage_hash, volumes
422 from twisted.internet import defer, reactor
423 from ubuntuone.devtools.handlers import MementoHandler
424 from ubuntuone.devtools.testcases import skipIfOS
425@@ -62,9 +64,6 @@
426 )
427 from ubuntuone.syncdaemon.marker import MDMarker
428 from ubuntuone.syncdaemon.tritcask import Tritcask
429-from ubuntuone.storageprotocol import (
430- content_hash as storage_hash, volumes
431-)
432 from ubuntuone.syncdaemon.volume_manager import (
433 ACCESS_LEVEL_RO,
434 ACCESS_LEVEL_RW,
435
436=== modified file 'ubuntuone/syncdaemon/tests/test_sync.py'
437--- ubuntuone/syncdaemon/tests/test_sync.py 2018-03-09 09:11:05 +0000
438+++ ubuntuone/syncdaemon/tests/test_sync.py 2018-04-14 23:49:33 +0000
439@@ -1,7 +1,7 @@
440 # -*- coding: utf-8 -*-
441 #
442 # Copyright 2009-2012 Canonical Ltd.
443-# Copyright 2015-2018 Chicharreros
444+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
445 #
446 # This program is free software: you can redistribute it and/or modify it
447 # under the terms of the GNU General Public License version 3, as published
448@@ -39,8 +39,11 @@
449 import unittest
450 import uuid
451
452+from magicicadaprotocol import delta
453+from magicicadaprotocol.request import ROOT
454 from twisted.internet import defer
455 from twisted.python.failure import Failure
456+from ubuntuone.devtools.handlers import MementoHandler
457 from ubuntuone.devtools.testcases import skipIfOS
458
459 from contrib.testing.testcase import (
460@@ -49,8 +52,6 @@
461 BaseTwistedTestCase,
462 Listener,
463 )
464-
465-from ubuntuone.devtools.handlers import MementoHandler
466 from ubuntuone.platform import (
467 make_dir,
468 open_file,
469@@ -63,8 +64,6 @@
470 from ubuntuone.syncdaemon.sync import FSKey, Sync, SyncStateMachineRunner
471 from ubuntuone.syncdaemon.volume_manager import Share
472 from ubuntuone.syncdaemon.event_queue import EventQueue, EVENTS
473-from ubuntuone.storageprotocol.request import ROOT
474-from ubuntuone.storageprotocol import delta
475 from ubuntuone.syncdaemon.marker import MDMarker
476
477
478
479=== modified file 'ubuntuone/syncdaemon/tests/test_vm.py'
480--- ubuntuone/syncdaemon/tests/test_vm.py 2016-06-04 21:14:35 +0000
481+++ ubuntuone/syncdaemon/tests/test_vm.py 2018-04-14 23:49:33 +0000
482@@ -1,8 +1,7 @@
483 # -*- coding: utf-8 -*-
484 #
485-# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
486-#
487 # Copyright 2009-2012 Canonical Ltd.
488+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
489 #
490 # This program is free software: you can redistribute it and/or modify it
491 # under the terms of the GNU General Public License version 3, as published
492@@ -40,16 +39,14 @@
493 import sys
494 import uuid
495
496+from magicicadaprotocol import volumes, request
497+from magicicadaprotocol.client import ListShares
498+from magicicadaprotocol.sharersp import NotifyShareHolder, ShareResponse
499+
500 from mocker import Mocker, MATCH
501 from twisted.internet import defer, reactor
502 from ubuntuone.devtools.handlers import MementoHandler
503 from ubuntuone.devtools.testcases import skipIfOS
504-from ubuntuone.storageprotocol import volumes, request
505-from ubuntuone.storageprotocol.client import ListShares
506-from ubuntuone.storageprotocol.sharersp import (
507- NotifyShareHolder,
508- ShareResponse,
509-)
510
511 from contrib.testing.testcase import (
512 BaseTwistedTestCase,
513
514=== modified file 'ubuntuone/syncdaemon/volume_manager.py'
515--- ubuntuone/syncdaemon/volume_manager.py 2016-06-01 21:38:23 +0000
516+++ ubuntuone/syncdaemon/volume_manager.py 2018-04-14 23:49:33 +0000
517@@ -1,6 +1,7 @@
518-# ubuntuone.syncdaemon.volume_manager - manages volumes
519+# -*- coding: utf-8 -*-
520 #
521 # Copyright 2009-2012 Canonical Ltd.
522+# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
523 #
524 # This program is free software: you can redistribute it and/or modify it
525 # under the terms of the GNU General Public License version 3, as published
526@@ -41,14 +42,14 @@
527
528 from itertools import ifilter
529
530-from twisted.internet import defer
531-from ubuntuone.platform import expand_user
532-from ubuntuone.storageprotocol import request
533-from ubuntuone.storageprotocol.volumes import (
534+from magicicadaprotocol import request
535+from magicicadaprotocol.volumes import (
536 ShareVolume,
537 UDFVolume,
538 RootVolume,
539 )
540+from twisted.internet import defer
541+from ubuntuone.platform import expand_user
542
543 from ubuntuone.syncdaemon.marker import MDMarker
544 from ubuntuone.syncdaemon.interfaces import IMarker

Subscribers

People subscribed via source and target branches

to all changes: