~ubuntu-branches/ubuntu/precise/ubuntuone-control-panel/precise-proposed

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/sd_client/linux.py

  • Committer: Package Import Robot
  • Author(s): Natalia Bidart (nessita)
  • Date: 2012-04-04 13:03:50 UTC
  • mfrom: (1.1.29)
  • Revision ID: package-import@ubuntu.com-20120404130350-1th0krhu9jaw8g25
Tags: 2.99.92-0ubuntu1
* New upstream release:
  - Using limit_bandwidth attribute to properly process the info dict
    for preferences (LP: #944256).
  - Handle errors from backend on the signin wizard page (LP: #945078).
  - Avoid the 'show/hide details' button to grow when focused (LP: #961348).
  - Modified stylesheet to use the new colours from brand, and to also ease
    the reading of white text (LP: #956077).
  - Fixed the gap tab outlines (LP: #822629).
  - Remove custom path validation and use the one provided by syncdaemon
    (LP: #824252).
  - Make use of the new feature from syncdaemon where 'refresh_volumes'
    returns a deferred that gets fired when the server info is ready
    (LP: #851810).
  - Ensured that Folders' tree view has proper texts in the columns to
    have proper column widths (LP: #965175).
  - Forced white background (LP: #961346).
* debian/control:
  - Bumped dependency versions on ubuntu-sso-client and ubuntuone-client to
    2.99.92.
* debian/watch:
  - Updated url to fetch tarball from latest milestone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
 
3
 
# Authors: Alejandro J. Cura <alecu@canonical.com>
4
 
# Authors: Natalia B. Bidart <nataliabidart@canonical.com>
5
 
#
6
 
# Copyright 2010 Canonical Ltd.
7
 
#
8
 
# This program is free software: you can redistribute it and/or modify it
9
 
# under the terms of the GNU General Public License version 3, as published
10
 
# by the Free Software Foundation.
11
 
#
12
 
# This program is distributed in the hope that it will be useful, but
13
 
# WITHOUT ANY WARRANTY; without even the implied warranties of
14
 
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
 
# PURPOSE.  See the GNU General Public License for more details.
16
 
#
17
 
# You should have received a copy of the GNU General Public License along
18
 
# with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
 
20
 
"""Client to use other DBus services."""
21
 
 
22
 
import dbus.service
23
 
 
24
 
from ubuntuone.controlpanel.logger import setup_logging
25
 
 
26
 
 
27
 
logger = setup_logging('sd_client')
28
 
 
29
 
 
30
 
def get_syncdaemon_proxy(object_path, dbus_interface):
31
 
    """Get a DBus proxy for syncdaemon at 'object_path':'dbus_interface'."""
32
 
    logger.debug('get_syncdaemon_proxy: object_path %r, dbus_interface %r',
33
 
                 object_path, dbus_interface)
34
 
    bus = dbus.SessionBus()
35
 
    obj = bus.get_object(bus_name='com.ubuntuone.SyncDaemon',
36
 
                         object_path=object_path,
37
 
                         follow_name_owner_changes=True)
38
 
    proxy = dbus.Interface(object=obj, dbus_interface=dbus_interface)
39
 
    return proxy
40
 
 
41
 
 
42
 
def set_status_changed_handler(handler):
43
 
    """Connect 'handler' with syncdaemon's StatusChanged signal."""
44
 
    proxy = get_syncdaemon_proxy('/status', 'com.ubuntuone.SyncDaemon.Status')
45
 
    sig = proxy.connect_to_signal('StatusChanged', handler)
46
 
    return proxy, sig