Merge lp:~nataliabidart/ubuntuone-client/no-more-clientdefs into lp:ubuntuone-client

Proposed by Natalia Bidart
Status: Merged
Approved by: Roman Yepishev
Approved revision: 924
Merged at revision: 926
Proposed branch: lp:~nataliabidart/ubuntuone-client/no-more-clientdefs
Merge into: lp:ubuntuone-client
Diff against target: 122 lines (+4/-69)
2 files modified
bin/ubuntuone-launch (+4/-10)
tests/platform/linux/test_dbus.py (+0/-59)
To merge this branch: bzr merge lp:~nataliabidart/ubuntuone-client/no-more-clientdefs
Reviewer Review Type Date Requested Status
Roman Yepishev (community) fieldtest Approve
Roberto Alsina (community) Approve
Review via email: mp+54376@code.launchpad.net

Commit message

- Removing dependency to clientdefs in ubuntuone-launch. Removing dependency to ubuntu_sso in dbus_interface.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve
Revision history for this message
Roman Yepishev (rye) wrote :

ubuntuone-launch is working fine with these changes.

review: Approve (fieldtest)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-launch'
2--- bin/ubuntuone-launch 2011-01-05 21:36:43 +0000
3+++ bin/ubuntuone-launch 2011-03-22 16:31:03 +0000
4@@ -1,6 +1,6 @@
5 #!/usr/bin/python
6
7-# ubuntuone-start - Ubuntu One storage synchronization daemon startup helper
8+# ubuntuone-launch - Ubuntu One storage synchronization daemon startup helper
9 #
10 # Author: John Lenton <john.lenton@canonical.com>
11 #
12@@ -53,9 +53,8 @@
13 import glib
14 import gobject
15 from dbus.mainloop.glib import DBusGMainLoop
16+from ubuntuone.platform.credentials import CredentialsManagementTool
17 from ubuntuone.platform.tools import SyncDaemonTool, is_running
18-from ubuntuone.clientdefs import APP_NAME as SD_APP_NAME
19-from ubuntu_sso.main import SSOCredentials
20 from twisted.internet import defer
21
22
23@@ -68,14 +67,9 @@
24 else:
25 # one last check: avoid having sso pop up asking for creds if
26 # the user deleted them
27+ creds_tools = CredentialsManagementTool()
28+ d = creds_tools.find_credentials()
29
30- # XXX: that this works with None is probably excessive
31- # chumminess with the implementation
32- creds = SSOCredentials(None)
33- if creds.find_credentials(SD_APP_NAME):
34- d = sync_daemon_tool.connect()
35- else:
36- d = defer.fail(RuntimeError("no creds"))
37 return d
38
39
40
41=== modified file 'tests/platform/linux/test_dbus.py'
42--- tests/platform/linux/test_dbus.py 2011-03-08 20:25:00 +0000
43+++ tests/platform/linux/test_dbus.py 2011-03-22 16:31:03 +0000
44@@ -29,8 +29,6 @@
45 from twisted.internet import defer, reactor
46 from twisted.python import failure
47
48-from ubuntu_sso.main import SSOCredentials
49-
50 from contrib.testing.testcase import (
51 BaseTwistedTestCase, FakeMain, FAKED_CREDENTIALS)
52
53@@ -76,41 +74,6 @@
54 from ubuntuone.devtools.testcase import DBusTestCase
55
56
57-# OAuth stubs
58-class FakeLoginProcessor(object):
59- """Stub login processor."""
60-
61- def __init__(self, dbus_object):
62- """Initialize the login processor."""
63- self.next_login_cb = None
64-
65- def login(self, realm, consumer_key, error_handler=None,
66- reply_handler=None, do_login=True):
67- """Stub, call self.next_login_cb or send NewCredentials if
68- self.next_login_cb isn't defined.
69- """
70- self.realm = str(realm)
71- self.consumer_key = str(consumer_key)
72- if self.next_login_cb:
73- cb = self.next_login_cb[0]
74- args = self.next_login_cb[1]
75- self.next_login_cb = None
76- return cb(*args)
77- else:
78- self.dbus_object.NewCredentials(realm, consumer_key)
79-
80- def clear_token(self, realm, consumer_key):
81- """Stub, do nothing"""
82- pass
83-
84- def next_login_with(self, callback, args=tuple()):
85- """shortcircuit the next call to login and call the specified callback.
86- callback is usually one of: self.got_token, self.got_no_token,
87- self.got_denial or self.got_error.
88- """
89- self.next_login_cb = (callback, args)
90-
91-
92 class FakeDBusInterface(object):
93 """A fake DBusInterface..."""
94
95@@ -204,28 +167,6 @@
96 self.fail(str(error))
97
98
99-class FakeLogin(SSOCredentials):
100- """Stub Object which listens for D-Bus OAuth requests"""
101-
102- def __init__(self, bus):
103- """Initiate the object."""
104- self.bus = bus
105- self.busName = dbus.service.BusName(DBUS_CREDENTIALS_IFACE,
106- bus=self.bus)
107- # bypass the parent class __init__ as it has the path hardcoded
108- # and we can't use '/' as the path, as we are already using it
109- # for syncdaemon. pylint: disable-msg=W0233,W0231
110- dbus.service.Object.__init__(self, object_path="/oauthdesktop",
111- bus_name=self.busName)
112- self.processor = FakeLoginProcessor(self)
113- self.currently_authing = False
114-
115- def shutdown(self):
116- """Shutdown and remove any trace from the bus"""
117- self.busName.get_bus().release_name(self.busName.get_name())
118- self.remove_from_connection()
119-
120-
121 class FakeNetworkManager(DBusExposedObject):
122 """ A fake NetworkManager that only emits StatusChanged signal. """
123

Subscribers

People subscribed via source and target branches