~mandel/ubuntuone-client/provide_credentials_management

« back to all changes in this revision

Viewing changes to ubuntuone/platform/windows/ipc_client.py

  • Committer: Manuel de la Pena
  • Date: 2011-04-28 19:39:41 UTC
  • Revision ID: mandel@themacaque.com-20110428193941-m5h2ndm1k4vurnt8
Added the client code that allows to use the configuration API from sd.

Show diffs side-by-side

added added

removed removed

Lines of Context:
439
439
    @signal
440
440
    def on_share_unsubscribe_error(self, share_id, error):
441
441
        """Emit the ShareUnSubscribeError signal"""
 
442
 
 
443
 
 
444
class ConfigClient(RemoteClient):
 
445
    """The Syncdaemon config/settings ipc interface. """
 
446
 
 
447
    def __init__(self, remote_config):
 
448
        """ Creates the instance."""
 
449
        super(ConfigClient, self).__init__(remote_config)
 
450
 
 
451
    @callbacks(callbacks_names=[('reply_handler', 1), ('error_handler', 2)])
 
452
    @remote
 
453
    def get_throttling_limits(self, reply_handler=None, error_handler=None):
 
454
        """Get the read/write limit from AQ and return a dict.
 
455
        Returns a dict(download=int, upload=int), if int is -1 the value isn't
 
456
        configured.
 
457
        The values are bytes/second
 
458
        """
 
459
 
 
460
    @callbacks(callbacks_names=[('reply_handler', 3), ('error_handler', 4)])
 
461
    @remote
 
462
    def set_throttling_limits(self, download, upload,
 
463
                         reply_handler=None, error_handler=None):
 
464
        """Set the read and write limits. The expected values are bytes/sec."""
 
465
 
 
466
    @callbacks(callbacks_names=[('reply_handler', 1), ('error_handler', 2)])
 
467
    @remote
 
468
    def enable_bandwidth_throttling(self, reply_handler=None,
 
469
                                    error_handler=None):
 
470
        """Enable bandwidth throttling."""
 
471
 
 
472
    @callbacks(callbacks_names=[('reply_handler', 1), ('error_handler', 2)])
 
473
    @remote
 
474
    def disable_bandwidth_throttling(self, reply_handler=None,
 
475
                                     error_handler=None):
 
476
        """Disable bandwidth throttling."""
 
477
 
 
478
    @callbacks(callbacks_names=[('reply_handler', 1), ('error_handler', 2)])
 
479
    @remote
 
480
    def bandwidth_throttling_enabled(self, reply_handler=None,
 
481
                                     error_handler=None):
 
482
        """Returns True (actually 1) if bandwidth throttling is enabled and
 
483
        False (0) otherwise.
 
484
        """
 
485
 
 
486
    @remote
 
487
    def udf_autosubscribe_enabled(self):
 
488
        """Return the udf_autosubscribe config value."""
 
489
 
 
490
    @remote
 
491
    def enable_udf_autosubscribe(self):
 
492
        """Enable UDF autosubscribe."""
 
493
 
 
494
    @remote
 
495
    def disable_udf_autosubscribe(self):
 
496
        """Enable UDF autosubscribe."""
 
497
 
 
498
    @remote
 
499
    def share_autosubscribe_enabled(self):
 
500
        """Return the share_autosubscribe config value."""
 
501
 
 
502
    @remote
 
503
    def enable_share_autosubscribe(self):
 
504
        """Enable UDF autosubscribe."""
 
505
 
 
506
    @remote
 
507
    def disable_share_autosubscribe(self):
 
508
        """Enable UDF autosubscribe."""
 
509
 
 
510
    @remote
 
511
    def set_files_sync_enabled(self, enabled):
 
512
        """Enable/disable file sync service."""
 
513
 
 
514
    @remote
 
515
    def files_sync_enabled(self):
 
516
        """Return the files_sync_enabled config value."""
 
517
 
 
518
    @remote
 
519
    def autoconnect_enabled(self):
 
520
        """Return the autoconnect config value."""
 
521
 
 
522
    @remote
 
523
    def set_autoconnect_enabled(self, enabled):
 
524
        """Enable syncdaemon autoconnect."""
 
525
 
 
526
    @remote
 
527
    def show_all_notifications_enabled(self):
 
528
        """Return the show_all_notifications config value."""
 
529
 
 
530
    @remote
 
531
    def enable_show_all_notifications(self):
 
532
        """Enable showing all notifications."""
 
533
 
 
534
    @remote
 
535
    def disable_show_all_notifications(self):
 
536
        """Disable showing all notifications."""