Converts `value` type from python to dbus according signature.

    :param value: value to convert to dbus object
    :param str signature: dbus type signature.
    :returns: value in dbus type.

def convert2dbus(value, signature):
    """Converts `value` type from python to dbus according signature.

    :param value: value to convert to dbus object
    :param str signature: dbus type signature.
    :returns: value in dbus type.
    """
    if len(signature) == 2 and signature.startswith('a'):
        return dbus.Array(value, signature=signature[-1])
    dbus_string_type = dbus.String if PY3 else dbus.UTF8String
    type_map = {
        'b': dbus.Boolean, 'y': dbus.Byte, 'n': dbus.Int16,
        'i': dbus.Int32, 'x': dbus.Int64, 'q': dbus.UInt16, 'u': dbus.UInt32,
        't': dbus.UInt64, 'd': dbus.Double, 'o': dbus.ObjectPath,
        'g': dbus.Signature, 's': dbus_string_type}
    return type_map[signature](value)