/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: teddy at recompile
  • Date: 2020-01-12 01:42:09 UTC
  • Revision ID: teddy@recompile.se-20200112014209-ktr3acloxzbmhbnt
mandos-ctl: Add DBussy support

Add support in mandos-ctl for the "DBussy" Python D-Bus module.  Use
it by default, if it is available.

* mandos-ctl: Try to import the "dbussy" and its high-level module
  "ravel".
  (main): Use DBussy if import succeeded.
  (dbussy_adapter): New.
  (Test_dbussy_adapter_SystemBus): New test class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 
92
92
if sys.version_info.major == 2:
93
93
    __metaclass__ = type
 
94
    str = unicode
94
95
 
95
96
# Show warnings by default
96
97
if not sys.warnoptions:
122
123
            # No value found
123
124
            SO_BINDTODEVICE = None
124
125
 
125
 
if sys.version_info.major == 2:
126
 
    str = unicode
127
 
 
128
126
if sys.version_info < (3, 2):
129
127
    configparser.Configparser = configparser.SafeConfigParser
130
128
 
1413
1411
                raise ValueError("Byte arrays not supported for non-"
1414
1412
                                 "'ay' signature {!r}"
1415
1413
                                 .format(prop._dbus_signature))
1416
 
            value = dbus.ByteArray(b''.join(chr(byte)
1417
 
                                            for byte in value))
 
1414
            value = dbus.ByteArray(bytes(value))
1418
1415
        prop(value)
1419
1416
 
1420
1417
    @dbus.service.method(dbus.PROPERTIES_IFACE,