Merge lp:~dobey/ubuntuone-client/update-from-trunk into lp:ubuntuone-client/stable-3-0

Proposed by dobey on 2012-01-18
Status: Merged
Approved by: dobey on 2012-01-18
Approved revision: no longer in the source branch.
Merged at revision: 1167
Proposed branch: lp:~dobey/ubuntuone-client/update-from-trunk
Merge into: lp:ubuntuone-client/stable-3-0
Diff against target: 576 lines (+174/-30)
17 files modified
bin/ubuntuone-syncdaemon (+26/-0)
data/syncdaemon.conf (+5/-0)
tests/platform/test_external_interface.py (+8/-0)
tests/platform/test_os_helper.py (+27/-0)
tests/platform/test_tools.py (+6/-0)
tests/platform/test_u1sdtool.py (+15/-5)
tests/syncdaemon/test_interaction_interfaces.py (+5/-0)
tests/syncdaemon/test_main.py (+6/-0)
tests/syncdaemon/test_vm_helper.py (+17/-0)
ubuntuone/platform/credentials/windows.py (+3/-8)
ubuntuone/platform/linux/dbus_interface.py (+6/-0)
ubuntuone/platform/tools/__init__.py (+5/-0)
ubuntuone/platform/windows/ipc.py (+5/-1)
ubuntuone/platform/windows/ipc_client.py (+4/-0)
ubuntuone/platform/windows/os_helper.py (+26/-13)
ubuntuone/syncdaemon/interaction_interfaces.py (+5/-2)
ubuntuone/syncdaemon/main.py (+5/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-client/update-from-trunk
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2012-01-18
Natalia Bidart 2012-01-18 Approve on 2012-01-18
Review via email: mp+89070@code.launchpad.net

Commit Message

[Natalia Bidart]

    Do not log calls to current_{uploads,downloads}.
    Use latest SSO interface.

[Diego Sarmentero]

    Provide a get_home_dir() method to get a proper home dir in unicode environments (LP: #898640).
    Handle link creation with unicode paths (LP: #891173).

[Alejandro J. Cura]

    Provide a --debug-manhole option to use twisted's manhole for debugging the syncdaemon.

To post a comment you must log in.
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve
Manuel de la Peña (mandel) wrote :

Seems ok.

review: Approve
1167. By Diego Sarmentero on 2012-01-18

[Natalia Bidart]

    Do not log calls to current_{uploads,downloads}.
    Use latest SSO interface.

[Diego Sarmentero]

    Provide a get_home_dir() method to get a proper home dir in unicode environments (LP: #898640).
    Handle link creation with unicode paths (LP: #891173).

[Alejandro J. Cura]

    Provide a --debug-manhole option to use twisted's manhole for debugging the syncdaemon.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-syncdaemon'
2--- bin/ubuntuone-syncdaemon 2011-10-21 13:40:09 +0000
3+++ bin/ubuntuone-syncdaemon 2012-01-18 16:15:47 +0000
4@@ -85,6 +85,12 @@
5 d = async_main(parser, options, argv)
6 d.addErrback(check_death)
7
8+ # check if we should start a twisted manhole
9+ if options.debug_manhole:
10+ startManhole()
11+ else:
12+ logger.root_logger.info('not starting twisted.manhole')
13+
14 if options.debug_lsprof_file:
15 try:
16 from bzrlib.lsprof import profile
17@@ -97,6 +103,26 @@
18 reactor.run()
19
20
21+def startManhole():
22+ try:
23+ from twisted.conch import manhole, manhole_ssh
24+ from twisted.cred.portal import Portal
25+ from twisted.cred.checkers import InMemoryUsernamePasswordDatabaseDontUse
26+ except ImportError:
27+ logger.root_logger.warning('twisted.manhole not available')
28+ else:
29+ logger.root_logger.info('starting twisted.manhole')
30+ realm = manhole_ssh.TerminalRealm()
31+ getManhole = lambda _: manhole.Manhole(globals())
32+ realm.chainedProtocolFactory.protocolFactory = getManhole
33+ portal = Portal(realm)
34+ checker = InMemoryUsernamePasswordDatabaseDontUse(debug="debug")
35+ portal.registerChecker(checker)
36+ manholeFactory = manhole_ssh.ConchFactory(portal)
37+ reactor.listenTCP(2222, manholeFactory)
38+ logger.root_logger.info('twisted.manhole started')
39+
40+
41 @defer.inlineCallbacks
42 def async_main(parser, options, argv):
43 """The client entry point that can yield."""
44
45=== modified file 'data/syncdaemon.conf'
46--- data/syncdaemon.conf 2011-04-26 18:53:19 +0000
47+++ data/syncdaemon.conf 2012-01-18 16:15:47 +0000
48@@ -132,6 +132,11 @@
49 with ".callgrind", the output will be formatted for use with KCacheGrind.
50 Otherwise, the output will be a pickle. *WARNING*: bzr must be installed.
51
52+manhole.default = False
53+manhole.parser = bool
54+manhole.action = store_true
55+manhole.help = Start a twisted manhole on port 2222
56+
57 heapy_monitor.default = False
58 heapy_monitor.parser = bool
59 heapy_monitor.action = store_true
60
61=== modified file 'tests/platform/test_external_interface.py'
62--- tests/platform/test_external_interface.py 2011-10-26 20:20:37 +0000
63+++ tests/platform/test_external_interface.py 2012-01-18 16:15:47 +0000
64@@ -165,6 +165,14 @@
65 self.assert_remote_method('disconnect')
66
67 @defer.inlineCallbacks
68+ def test_get_homedir(self):
69+ """Test get_homedir."""
70+ result = self.root_dir
71+ yield self.assert_method_called(self.service.sync,
72+ 'get_homedir', result)
73+ self.assert_remote_method('get_homedir', out_signature='s')
74+
75+ @defer.inlineCallbacks
76 def test_get_rootdir(self):
77 """Test get_rootdir."""
78 result = self.root_dir
79
80=== modified file 'tests/platform/test_os_helper.py'
81--- tests/platform/test_os_helper.py 2011-11-17 19:24:31 +0000
82+++ tests/platform/test_os_helper.py 2012-01-18 16:15:47 +0000
83@@ -311,6 +311,12 @@
84 """The dir is not there."""
85 self.assertFalse(path_exists(os.path.join(self.basedir, 'subdir')))
86
87+ def test_path_exist_for_link_without_lnk_extension(self):
88+ """Test if the path of a link exist without the lnk extension."""
89+ destination = os.path.join(self.basedir, 'destination')
90+ make_link(self.testfile, destination)
91+ self.assertTrue(path_exists(destination))
92+
93 def test_make_link(self):
94 """The link is properly made."""
95 destination = os.path.join(self.basedir, 'destination')
96@@ -320,6 +326,27 @@
97 self.assertEqual(os.path.normcase(self.testfile),
98 os.path.normcase(read_link(destination)))
99
100+ def _assert_read_link(self, target):
101+ """Assert if the target path of the link is correct."""
102+ destination = os.path.join(self.basedir, target)
103+ make_link(self.testfile, destination)
104+
105+ target = read_link(destination)
106+ self.assertEqual(self.testfile, target)
107+
108+ def test_links_target_without_lnk_extension(self):
109+ """Create a link to self.testfile and then retrieve the link target."""
110+ # In windows the .lnk extension should be added automatically
111+ # if the extension is not added by make_link, read_link will fail
112+ # because Windows is not going to recognize the file as a link
113+ target = 'target'
114+ self._assert_read_link(target)
115+
116+ def test_links_target_with_lnk_extension(self):
117+ """Create a link to self.testfile and then retrieve the link target."""
118+ target = 'target.lnk'
119+ self._assert_read_link(target)
120+
121 def test_movetotrash_file_ok(self):
122 """Move a file to trash ok.
123
124
125=== modified file 'tests/platform/test_tools.py'
126--- tests/platform/test_tools.py 2011-11-17 18:38:41 +0000
127+++ tests/platform/test_tools.py 2012-01-18 16:15:47 +0000
128@@ -958,6 +958,12 @@
129 repr(dirty_mdids[mdid2]['path'].encode('utf-8')))
130
131 @defer.inlineCallbacks
132+ def test_get_home_dir(self):
133+ """Test the get_home_dir method."""
134+ result = yield self.tool.get_home_dir()
135+ self.assertEqual(self.main.get_homedir().decode('utf-8'), result)
136+
137+ @defer.inlineCallbacks
138 def test_get_root_dir(self):
139 """Test the get_root_dir method."""
140 result = yield self.tool.get_root_dir()
141
142=== modified file 'tests/platform/test_u1sdtool.py'
143--- tests/platform/test_u1sdtool.py 2011-11-02 16:51:32 +0000
144+++ tests/platform/test_u1sdtool.py 2012-01-18 16:15:47 +0000
145@@ -28,6 +28,7 @@
146 FakeDownload,
147 FakeUpload,
148 )
149+from ubuntuone.syncdaemon.vm_helper import get_udf_path
150 from ubuntuone.syncdaemon.volume_manager import (
151 ACCESS_LEVEL_RO,
152 Share,
153@@ -58,6 +59,7 @@
154 out = StringIO()
155 d = self.tool.get_shares()
156 d.addCallback(lambda result: show_shares(result, out))
157+
158 def check(result):
159 """check the output"""
160 self.assertEqual('No shares\n', out.getvalue())
161@@ -86,6 +88,7 @@
162 out = StringIO()
163 d = self.tool.list_shared()
164 d.addCallback(lambda result: show_shared(result, out))
165+
166 def check(result):
167 """check the output"""
168 self.assertEqual('No shared\n', out.getvalue())
169@@ -98,6 +101,7 @@
170 self.fs.create(path, "")
171 self.fs.set_node_id(path, "node_id")
172 # helper function, pylint: disable-msg=C0111
173+
174 def fake_create_share(node_id, user, name, access_level, marker, path):
175 self.main.vm.handle_AQ_CREATE_SHARE_OK(share_id='share_id',
176 marker=marker)
177@@ -110,6 +114,7 @@
178 "path=%s\n" % path.decode('utf-8')
179 d = self.tool.list_shared()
180 d.addCallback(lambda result: show_shared(result, out))
181+
182 def check(result):
183 """check the output"""
184 self.assertEqual(out.getvalue(), expected)
185@@ -166,6 +171,7 @@
186 stat: %(stat)s
187 """
188 # the callback, pylint: disable-msg=C0111
189+
190 def callback(result):
191 if encoding is not None:
192 result.update(dict(path_info=path))
193@@ -176,6 +182,7 @@
194 value = expected % result
195 self.assertEqual(out.getvalue(), value)
196 # helper callback, pylint: disable-msg=C0111
197+
198 def show(result):
199 show_path_info(result, path, out)
200 return result
201@@ -191,6 +198,7 @@
202 d.addCallback(lambda _: self.tool.get_current_downloads())
203 d.addCallback(lambda result: show_downloads(result, out))
204 expected = u'Current uploads: 0\nCurrent downloads: 0\n'
205+
206 def check(result):
207 """check the output"""
208 self.assertEqual(out.getvalue(), expected)
209@@ -241,6 +249,7 @@
210 ]
211 d = self.tool.get_status()
212 d.addCallback(lambda result: show_state(result, out))
213+
214 def check(result):
215 """check the output"""
216 info = [x.strip() for x in out.getvalue().split("\n") if x.strip()]
217@@ -274,7 +283,7 @@
218 self.action_q.queue.waiting.extend([cmd1, cmd2])
219
220 out = StringIO()
221- expected = (
222+ expected = (
223 " FakeCommand(running=True, share_id='', "
224 "node_id='node1', path='foo', other='')\n"
225 " FakeCommand(running=False, share_id='', "
226@@ -294,7 +303,7 @@
227 self.action_q.queue.waiting.extend([cmd1, cmd2])
228
229 out = StringIO()
230- expected = (
231+ expected = (
232 "Warning: this option is deprecated! Use '--waiting' instead\n"
233 " FakeCommand(running=True, share_id='', node_id='node1', "
234 "path='p', other='')\n"
235@@ -344,6 +353,7 @@
236 out = StringIO()
237 d = self.tool.get_folders()
238 d.addCallback(lambda result: show_folders(result, out))
239+
240 def check(result):
241 """check the output"""
242 self.assertEqual('No folders\n', out.getvalue())
243@@ -354,14 +364,14 @@
244 def test_show_folders_subscribed(self):
245 """Test the output of --list-folders."""
246 out = StringIO()
247- path = u'ñoño'.encode('utf-8')
248- suggested_path = os.path.join("~", u'ñoño')
249+ suggested_path = u"~/ñoño"
250+ path = get_udf_path(suggested_path)
251
252 udf = UDF("folder_id", "node_id", suggested_path, path,
253 subscribed=True)
254 yield self.main.vm.add_udf(udf)
255 expected = u"Folder list:\n id=folder_id subscribed=True " + \
256- u"path=\xf1o\xf1o\n"
257+ u"path=%s\n" % path.decode('utf-8')
258 result = yield self.tool.get_folders()
259 show_folders(result, out)
260 self.assertEqual(out.getvalue(), expected)
261
262=== modified file 'tests/syncdaemon/test_interaction_interfaces.py'
263--- tests/syncdaemon/test_interaction_interfaces.py 2011-12-12 19:32:25 +0000
264+++ tests/syncdaemon/test_interaction_interfaces.py 2012-01-18 16:15:47 +0000
265@@ -2158,6 +2158,11 @@
266
267 self.assertEqual(self.events, [('SYS_USER_DISCONNECT', {})])
268
269+ def test_get_homedir(self):
270+ """Test the get_homedir method."""
271+ result = self.sd_obj.get_homedir()
272+ self.assertEqual(self.main.get_homedir().decode('utf-8'), result)
273+
274 def test_get_rootdir(self):
275 """Test the get_rootdir method."""
276 result = self.sd_obj.get_rootdir()
277
278=== modified file 'tests/syncdaemon/test_main.py'
279--- tests/syncdaemon/test_main.py 2011-11-09 20:03:15 +0000
280+++ tests/syncdaemon/test_main.py 2012-01-18 16:15:47 +0000
281@@ -262,6 +262,12 @@
282 main = self.build_main()
283 self.assertNotIn(main.status_listener, self._get_listeners(main))
284
285+ def test_get_homedir(self):
286+ """The get_homedir returns the root dir."""
287+ expected = expand_user('~')
288+ main = self.build_main()
289+ self.assertEqual(main.get_homedir(), expected)
290+
291 def test_get_rootdir(self):
292 """The get_rootdir returns the root dir."""
293 expected = expand_user(os.path.join('~', 'Ubuntu Test One'))
294
295=== modified file 'tests/syncdaemon/test_vm_helper.py'
296--- tests/syncdaemon/test_vm_helper.py 2011-11-09 20:03:15 +0000
297+++ tests/syncdaemon/test_vm_helper.py 2012-01-18 16:15:47 +0000
298@@ -93,6 +93,14 @@
299 os_helper.make_dir(dest_path)
300 self.assertFalse(create_shares_link(source_path, dest_path))
301
302+ def test_create_shares_link_existing_destiny_with_lnk_extension(self):
303+ """Add the lnk extension to the end of the file like windows needs."""
304+ base = self.mktemp("test_create_shares_link_exists")
305+ source_path = os.path.join(base, "source")
306+ dest_path = os.path.join(base, "dest.lnk")
307+ os_helper.make_dir(dest_path)
308+ self.assertFalse(create_shares_link(source_path, dest_path))
309+
310 def test_create_shares_link_makes_the_link(self):
311 """create_shares_link makes the link as expected."""
312 base = self.mktemp("test_create_shares_link_makes_the_link")
313@@ -111,6 +119,15 @@
314 self.assertTrue(create_shares_link(source_path, dest_path))
315 self.assertFalse(create_shares_link(source_path, dest_path))
316
317+ def test_create_shares_link_existing_source_with_lnk_extension(self):
318+ """Add the lnk extension to the end of the file like windows needs."""
319+ base = self.mktemp("test_create_shares_link_makes_the_link")
320+ source_path = os.path.join(base, "source")
321+ dest_path = os.path.join(base, "dest.lnk")
322+ os_helper.make_dir(source_path)
323+ self.assertTrue(create_shares_link(source_path, dest_path))
324+ self.assertFalse(create_shares_link(source_path, dest_path))
325+
326
327 class GetShareDirNameTests(BaseVolumeManagerTests):
328
329
330=== modified file 'ubuntuone/platform/credentials/windows.py'
331--- ubuntuone/platform/credentials/windows.py 2011-09-13 19:31:23 +0000
332+++ ubuntuone/platform/credentials/windows.py 2012-01-18 16:15:47 +0000
333@@ -1,8 +1,5 @@
334 # -*- coding: utf-8 -*-
335 #
336-# Authors: Manuel de la Pena <manuel@canonical.com>
337-# Alejandro J. Cura <alecu@canonical.com>
338-#
339 # Copyright 2011 Canonical Ltd.
340 #
341 # This program is free software: you can redistribute it and/or modify it
342@@ -19,7 +16,7 @@
343 """Ubuntu One credentials management IPC service."""
344
345
346-from ubuntu_sso.main.windows import UbuntuSSOClient
347+from ubuntu_sso.main import get_sso_client
348 from twisted.internet import defer
349
350 from ubuntu_sso.credentials import (
351@@ -168,8 +165,6 @@
352 @defer.inlineCallbacks
353 def get_creds_proxy():
354 """Get the CredentialsManagement proxy."""
355- client = UbuntuSSOClient()
356- yield client.connect()
357- yield client.cred_management.register_to_signals()
358- result = CredentialsManagement(client.cred_management)
359+ client = yield get_sso_client()
360+ result = CredentialsManagement(client.cred_manager)
361 defer.returnValue(result)
362
363=== modified file 'ubuntuone/platform/linux/dbus_interface.py'
364--- ubuntuone/platform/linux/dbus_interface.py 2011-10-21 21:01:56 +0000
365+++ ubuntuone/platform/linux/dbus_interface.py 2012-01-18 16:15:47 +0000
366@@ -287,6 +287,12 @@
367
368 @dbus.service.method(DBUS_IFACE_SYNC_NAME,
369 in_signature='', out_signature='s')
370+ def get_homedir(self):
371+ """Return the home dir."""
372+ return self.service.sync.get_homedir()
373+
374+ @dbus.service.method(DBUS_IFACE_SYNC_NAME,
375+ in_signature='', out_signature='s')
376 def get_rootdir(self):
377 """Return the root dir/mount point."""
378 return self.service.sync.get_rootdir()
379
380=== modified file 'ubuntuone/platform/tools/__init__.py'
381--- ubuntuone/platform/tools/__init__.py 2011-11-12 17:09:09 +0000
382+++ ubuntuone/platform/tools/__init__.py 2012-01-18 16:15:47 +0000
383@@ -651,6 +651,11 @@
384 return self.proxy.call_method('file_system', 'get_dirty_nodes')
385
386 @log_call(logger.debug)
387+ def get_home_dir(self):
388+ """Return the home directory."""
389+ return self.proxy.call_method('sync_daemon', 'get_homedir')
390+
391+ @log_call(logger.debug)
392 def get_root_dir(self):
393 """Return the root directory."""
394 return self.proxy.call_method('sync_daemon', 'get_rootdir')
395
396=== modified file 'ubuntuone/platform/windows/ipc.py'
397--- ubuntuone/platform/windows/ipc.py 2011-10-25 02:24:29 +0000
398+++ ubuntuone/platform/windows/ipc.py 2012-01-18 16:15:47 +0000
399@@ -372,6 +372,7 @@
400 remote_calls = [
401 'connect',
402 'disconnect',
403+ 'get_homedir',
404 'get_rootdir',
405 'get_sharesdir',
406 'get_sharesdir_link',
407@@ -393,6 +394,10 @@
408 """Disconnect from the server."""
409 self.service.sync.disconnect()
410
411+ def get_homedir(self):
412+ """Return the home dir/mount point."""
413+ return self.service.sync.get_homedir()
414+
415 def get_rootdir(self):
416 """Return the root dir/mount point."""
417 return self.service.sync.get_rootdir()
418@@ -647,7 +652,6 @@
419
420 signal_mapping = {}
421
422-
423 def get_throttling_limits(self):
424 """Get the read/write limit from AQ and return a dict.
425
426
427=== modified file 'ubuntuone/platform/windows/ipc_client.py'
428--- ubuntuone/platform/windows/ipc_client.py 2011-11-02 16:37:55 +0000
429+++ ubuntuone/platform/windows/ipc_client.py 2012-01-18 16:15:47 +0000
430@@ -264,6 +264,10 @@
431 """Disconnect from the server."""
432
433 @remote
434+ def get_homedir(self):
435+ """Return the home dir/mount point."""
436+
437+ @remote
438 def get_rootdir(self):
439 """Return the root dir/mount point."""
440
441
442=== modified file 'ubuntuone/platform/windows/os_helper.py'
443--- ubuntuone/platform/windows/os_helper.py 2011-12-29 12:16:21 +0000
444+++ ubuntuone/platform/windows/os_helper.py 2012-01-18 16:15:47 +0000
445@@ -60,6 +60,10 @@
446 WinWorldSid,
447 )
448
449+from comtypes import shelllink
450+from comtypes.client import CreateObject
451+from comtypes.persist import IPersistFile
452+
453 # ugly trick to stop pylint for complaining about
454 # WindowsError on Linux
455 if sys.platform != 'win32':
456@@ -564,7 +568,7 @@
457 @windowspath()
458 def path_exists(path):
459 """Return if the path exists."""
460- return os.path.exists(path)
461+ return os.path.exists(path) or native_is_link(path)
462
463
464 @windowspath()
465@@ -638,16 +642,12 @@
466 destination = destination.replace(LONG_PATH_PREFIX, u'')
467 target = target.replace(LONG_PATH_PREFIX, u'')
468
469- shell_script = Dispatch('WScript.Shell')
470 try:
471- shortcut = shell_script.CreateShortCut(destination)
472- shortcut.Targetpath = target
473- shortcut.save()
474- except AttributeError:
475- # This try-except is required at least for the current implementation
476- # to allow the application to run even when the paths has unicode chars
477- logger.exception('Link couldn\'t be created for '
478- 'destination %r:', destination)
479+ shortcut = CreateObject(shelllink.ShellLink)
480+ shortcut.SetPath(target)
481+ shortcut.SetWorkingDirectory(target)
482+ pf = shortcut.QueryInterface(IPersistFile)
483+ pf.Save(destination, True)
484 except:
485 logger.exception('make_link could not be completed for target %r, '
486 'destination %r:', target, destination)
487@@ -658,17 +658,30 @@
488 @windowspath()
489 def read_link(path):
490 """Read the destination of a link."""
491+ # THIS SHOULD BE FIXED IN ORDER TO SUPPORT THE PROPER API
492+ # The workaround to support unicode paths was to use: WorkingDirectory,
493+ # because TargetPath or anything related was returning malformed paths.
494+ # The bug associated to this issue is: #907336
495+ # https://bugs.launchpad.net/ubuntuone-client/+bug/907336
496 if not path.endswith(u'.lnk'):
497 path += u'.lnk'
498- shell_script = Dispatch('WScript.Shell')
499- shortcut = shell_script.CreateShortCut(path)
500- result = get_syncdaemon_valid_path(LONG_PATH_PREFIX + shortcut.Targetpath)
501+ shortcut = CreateObject(shelllink.ShellLink)
502+ pf = shortcut.QueryInterface(IPersistFile)
503+ pf.Load(path, True)
504+ target_path = shortcut.GetWorkingDirectory().encode('utf-8')
505+ target_path = target_path.decode('utf-8')
506+ result = get_syncdaemon_valid_path(LONG_PATH_PREFIX + target_path)
507 return result
508
509
510 @windowspath()
511 def is_link(path):
512 """Returns if a path is a link or not."""
513+ return native_is_link(path)
514+
515+
516+def native_is_link(path):
517+ """Check if a file is a link, using native paths."""
518 if not path.endswith('.lnk'):
519 path += '.lnk'
520 return os.path.exists(path)
521
522=== modified file 'ubuntuone/syncdaemon/interaction_interfaces.py'
523--- ubuntuone/syncdaemon/interaction_interfaces.py 2011-12-06 20:23:14 +0000
524+++ ubuntuone/syncdaemon/interaction_interfaces.py 2012-01-18 16:15:47 +0000
525@@ -211,7 +211,6 @@
526 """
527 return self._get_current_state()
528
529- @log_call(logger.debug)
530 def current_uploads(self):
531 """Return a list of files with a upload in progress."""
532 current_uploads = []
533@@ -228,7 +227,6 @@
534 current_uploads.append(entry)
535 return current_uploads
536
537- @log_call(logger.debug)
538 def current_downloads(self):
539 """Return a list of files with a download in progress."""
540 current_downloads = []
541@@ -1243,6 +1241,11 @@
542 self.main.event_q.push('SYS_USER_DISCONNECT')
543
544 @log_call(logger.debug)
545+ def get_homedir(self):
546+ """Return the home dir point."""
547+ return self.main.get_homedir().decode('utf-8')
548+
549+ @log_call(logger.debug)
550 def get_rootdir(self):
551 """Return the root dir/mount point."""
552 return self.main.get_rootdir().decode('utf-8')
553
554=== modified file 'ubuntuone/syncdaemon/main.py'
555--- ubuntuone/syncdaemon/main.py 2011-10-21 13:40:09 +0000
556+++ ubuntuone/syncdaemon/main.py 2012-01-18 16:15:47 +0000
557@@ -21,7 +21,7 @@
558
559 from twisted.internet import defer, reactor, task
560
561-from ubuntu_sso.xdg_base_directory import native_path
562+from ubuntu_sso.xdg_base_directory import native_path, xdg_home
563 from ubuntuone.syncdaemon import (
564 action_queue,
565 config,
566@@ -249,6 +249,10 @@
567 """Do the server rescan."""
568 return self.vm.server_rescan()
569
570+ def get_homedir(self):
571+ """Return the home dir point."""
572+ return xdg_home
573+
574 def get_rootdir(self):
575 """Return the base dir/mount point."""
576 return self.root_dir

Subscribers

People subscribed via source and target branches

to all changes: