~nataliabidart/ubuntuone-control-panel/disable-files

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/dbus_service.py

  • Committer: Natalia B. Bidart
  • Date: 2011-04-01 20:05:07 UTC
  • mfrom: (117.1.5 ubuntuone-control-panel)
  • Revision ID: natalia.bidart@canonical.com-20110401200507-9hl6n7pg5spwelaz
MergedĀ trunkĀ in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from ubuntuone.controlpanel import (DBUS_BUS_NAME, DBUS_PREFERENCES_PATH,
33
33
    DBUS_PREFERENCES_IFACE)
34
34
from ubuntuone.controlpanel.backend import (
35
 
    ControlBackend, FILE_SYNC_DISABLED, FILE_SYNC_DISCONNECTED,
 
35
    ControlBackend, filter_field,
 
36
    FILE_SYNC_DISABLED, FILE_SYNC_DISCONNECTED,
36
37
    FILE_SYNC_ERROR, FILE_SYNC_IDLE, FILE_SYNC_STARTING, FILE_SYNC_STOPPED,
37
38
    FILE_SYNC_SYNCING,
38
39
    MSG_KEY, STATUS_KEY,
85
86
    """
86
87
    def inner(error, _=None):
87
88
        """Do the Failure transformation."""
 
89
        logger.error('processing failure: %r', error.printTraceback())
88
90
        error_dict = error_handler(error)
89
91
        if _ is not None:
90
92
            result = f(_, error_dict)
149
151
        d.addCallback(self.DevicesInfoReady)
150
152
        d.addErrback(transform_failure(self.DevicesInfoError))
151
153
 
152
 
    @log_call(logger.debug)
153
154
    @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="aa{ss}")
154
155
    def DevicesInfoReady(self, info):
155
156
        """The info for the devices is available right now."""
 
157
        logger.debug('DevicesInfoReady: args %r',
 
158
                     filter_field(info, field='device_id'))
156
159
 
157
160
    @log_call(logger.error)
158
161
    @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}")
161
164
 
162
165
    #---
163
166
 
164
 
    @log_call(logger.info)
 
167
    @log_call(logger.info, with_args=False)
165
168
    @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="sa{ss}")
166
169
    def change_device_settings(self, device_id, settings):
167
170
        """Configure a given device."""
170
173
        d.addErrback(transform_failure(self.DeviceSettingsChangeError),
171
174
                     device_id)
172
175
 
173
 
    @log_call(logger.info)
 
176
    @log_call(logger.info, with_args=False)
174
177
    @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s")
175
178
    def DeviceSettingsChanged(self, device_id):
176
179
        """The settings for the device were changed."""
177
180
 
178
 
    @log_call(logger.error)
 
181
    @log_call(logger.error, with_args=False)
179
182
    @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="sa{ss}")
180
183
    def DeviceSettingsChangeError(self, device_id, error):
181
184
        """Problem changing settings for the device."""
182
185
 
183
186
    #---
184
187
 
185
 
    @log_call(logger.warning)
 
188
    @log_call(logger.warning, with_args=False)
186
189
    @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="s")
187
190
    def remove_device(self, device_id):
188
191
        """Remove a given device."""
190
193
        d.addCallback(self.DeviceRemoved)
191
194
        d.addErrback(transform_failure(self.DeviceRemovalError), device_id)
192
195
 
193
 
    @log_call(logger.warning)
 
196
    @log_call(logger.warning, with_args=False)
194
197
    @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s")
195
198
    def DeviceRemoved(self, device_id):
196
199
        """The removal for the device was completed."""
197
200
 
198
 
    @log_call(logger.error)
 
201
    @log_call(logger.error, with_args=False)
199
202
    @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="sa{ss}")
200
203
    def DeviceRemovalError(self, device_id, error):
201
204
        """Problem removing the device."""