Mercurial > libervia-web
comparison src/browser/libervia_main.py @ 456:da2a7f2b34c9
browser and server sides: use asyncConnect instead of connect
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 23 May 2014 10:41:42 +0200 |
parents | 05e98b8d9f02 |
children | b55bc50756fa |
comparison
equal
deleted
inserted
replaced
455:05e98b8d9f02 | 456:da2a7f2b34c9 |
---|---|
119 | 119 |
120 | 120 |
121 class RegisterCall(LiberviaJsonProxy): | 121 class RegisterCall(LiberviaJsonProxy): |
122 def __init__(self): | 122 def __init__(self): |
123 LiberviaJsonProxy.__init__(self, "/register_api", | 123 LiberviaJsonProxy.__init__(self, "/register_api", |
124 ["isRegistered", "isConnected", "connect", "registerParams", "getMenus"]) | 124 ["isRegistered", "isConnected", "asyncConnect", "registerParams", "getMenus"]) |
125 | 125 |
126 | 126 |
127 class BridgeCall(LiberviaJsonProxy): | 127 class BridgeCall(LiberviaJsonProxy): |
128 def __init__(self): | 128 def __init__(self): |
129 LiberviaJsonProxy.__init__(self, "/json_api", | 129 LiberviaJsonProxy.__init__(self, "/json_api", |
331 else: | 331 else: |
332 self._register.call('isConnected', self._isConnectedCB) | 332 self._register.call('isConnected', self._isConnectedCB) |
333 | 333 |
334 def _isConnectedCB(self, connected): | 334 def _isConnectedCB(self, connected): |
335 if not connected: | 335 if not connected: |
336 self._register.call('connect', lambda x: self.logged()) | 336 self._register.call('asyncConnect', lambda x: self.logged()) |
337 else: | 337 else: |
338 self.logged() | 338 self.logged() |
339 | 339 |
340 def logged(self): | 340 def logged(self): |
341 if self._register_box: | 341 if self._register_box: |