Unify booleans coming and going from dbus

Bug #683619 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Control Panel
Fix Released
High
Natalia Bidart
ubuntuone-control-panel (Ubuntu)
Fix Released
Medium
Natalia Bidart

Bug Description

Since we're passing booleans as strings when using dicts, we should unify how we 'encode' booleans.

I suggest using '1' for True and '0' for False, and an exception in any other case.

Related branches

Changed in ubuntuone-control-panel:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Naty Bidart (nataliabidart)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

I think we should take another look at using dbus Variants, and making the dictionaries we use as DBus parameters be of type (string, variant), instead of (string, string).

On the upsides, we won't have the problem mentioned on this bug, we might be able to send a DBus.dictionary as a value, it will look cleaner.

On the downside, in python-dbus, using variants is more noisy than just strings. For instance, to build up the dict to send thru dbus, each value should be created as dbus.String(u'abc', variant_level=1).

Changed in ubuntuone-control-panel (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Naty Bidart (nataliabidart)
Changed in ubuntuone-control-panel:
status: Triaged → In Progress
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

For now we'll follow up syncdaemon's Dbus API convention that is:

'' for False
'True' for True (or any other string that returns True for bool())

Changed in ubuntuone-control-panel:
status: In Progress → Fix Committed
Changed in ubuntuone-control-panel (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntuone-control-panel - 0.1.0-0ubuntu1

---------------
ubuntuone-control-panel (0.1.0-0ubuntu1) natty; urgency=low

  * debian/control
    - depends on ubutuone-client >= 1.5.1
    - depends on ubuntu-sso-client >= 1.1.7

  * New upstream release.

    [ Natalia B. Bidart <email address hidden> ]

      * Updated list of messages to be shown on the overview panel (LP:
      #690379).

      * Implemented callback for failure when loading devices.

      * Added a spinner on every UbuntuOneBin to be shown while loading the
      panel content.

      * Devices can now be removed (LP: #691295).

      * Migrated dbus_client to use non-deprectaed SSO D-Bus API.

      * Added clear_credentials to dbus_client module.

      * Implemented devices tab (LP: #690649).

      * Maximum size is set using geometry hints (LP: #683164).

      * Added logging to dbus_service and backend.

      * Error signals now sent the object id when available (LP: #691292).

      * After machine was added, Folders page is shown (LP: #674459).

      * VolumesInfoError signal is now handled (LP: #690292).

      * When FileSyncStatusError is received, no more DbusException messages
      are leaked to the end user (LP: #690305).

      * User can now subcribe and unsubscribe from folders (LP: #689646).

      * Dbus booleans are now those strings whose bool() defines its value. So,
      '' for False and any other non empty string for True (LP: #683619).

      * File sync status is retrieved and displayed in the right top corner
      (LP: #673670).

      * Adding handling for file sync disabled (only backend for now).

      * Management panel is not twined itself if CredentialsFound signal is
     received several times (LP: #683649).

    [ Rodney Dawes <email address hidden> ]

      * Default to None and initialize if None in code, instead of mutable
      defaults.
 -- Natalia Bidart (nessita) <email address hidden> Wed, 22 Dec 2010 11:15:04 -0300

Changed in ubuntuone-control-panel (Ubuntu):
status: In Progress → Fix Released
Changed in ubuntuone-control-panel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.