~verterok/ubuntuone-client/fix-571548

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/tools.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2010-03-24 18:03:11 UTC
  • mfrom: (438.1.4 services-enablement)
  • Revision ID: dobey@wayofthemonkey.com-20100324180311-0szo2530obuq8ngt
Hook up the files/music sync toggle buttons to work
Add the "News" checkbox for toggling sync of gwibber messages
Store the file sync enabled config in the config file
Add dbus methods and SyncDaemonTool methods to query/set the files sync config
Add the necessary code to toggle syncing of dbs in desktopcouch

Show diffs side-by-side

added added

removed removed

Lines of Context:
470
470
                                  error_handler=d.errback)
471
471
        return d
472
472
 
 
473
    def get_folder_info(self, path):
 
474
        """Call the get_info method for a UDF path."""
 
475
        self.log.debug('get_info')
 
476
        client = DBusClient(self.bus, '/folders', DBUS_IFACE_FOLDERS_NAME)
 
477
        d = defer.Deferred()
 
478
        client.call_method('get_info', path,
 
479
                           reply_handler=d.callback,
 
480
                           error_handler=d.errback)
 
481
        return d
 
482
 
473
483
    def query_by_path(self, path):
474
484
        """requesting a query of the node idetifiend by 'path' to the server."""
475
485
        self.log.debug('query_by_path(%s)', path)
691
701
                                  error_handler=d.errback)
692
702
        return d
693
703
 
 
704
    def is_files_sync_enabled(self):
 
705
        """Check if files sync is enabled."""
 
706
        self.log.debug('is_files_sync_enabled')
 
707
        d = defer.Deferred()
 
708
        config_client = DBusClient(self.bus, '/config',
 
709
                                   DBUS_IFACE_CONFIG_NAME)
 
710
        config_client.call_method('files_sync_enabled',
 
711
                                  reply_handler=d.callback,
 
712
                                  error_handler=d.errback)
 
713
        return d
 
714
 
 
715
    def enable_files_sync(self, enabled):
 
716
        """Enable/disable files sync."""
 
717
        self.log.debug('enable_files_sync %d', enabled)
 
718
        d = defer.Deferred()
 
719
        config_client = DBusClient(self.bus, '/config',
 
720
                                   DBUS_IFACE_CONFIG_NAME)
 
721
        config_client.call_method('set_files_sync_enabled',
 
722
                                  reply_handler=d.callback,
 
723
                                  error_handler=d.errback)
 
724
        return d
 
725
 
694
726
 
695
727
# callbacks used by u1sdtool script
696
728