dasbus.specification module

class DBusSpecification[source]

Bases: object

DBus XML specification.

ACCESS_READ = 'read'
ACCESS_READWRITE = 'readwrite'
ACCESS_WRITE = 'write'
DIRECTION_IN = 'in'
DIRECTION_OUT = 'out'
class Method(name, interface_name, in_type, out_type)

Bases: tuple

in_type

Alias for field number 2

interface_name

Alias for field number 1

name

Alias for field number 0

out_type

Alias for field number 3

class Property(name, interface_name, readable, writable, type)

Bases: tuple

interface_name

Alias for field number 1

name

Alias for field number 0

readable

Alias for field number 2

type

Alias for field number 4

writable

Alias for field number 3

RETURN_PARAMETER = 'return'
STANDARD_INTERFACES = '\n    <node>\n        <interface name="org.freedesktop.DBus.Introspectable">\n            <method name="Introspect">\n            <arg type="s" name="xml_data" direction="out"/>\n            </method>\n        </interface>\n        <interface name="org.freedesktop.DBus.Peer">\n            <method name="Ping"/>\n            <method name="GetMachineId">\n                <arg type="s" name="machine_uuid" direction="out"/>\n            </method>\n       </interface>\n        <interface name="org.freedesktop.DBus.Properties">\n            <method name="Get">\n                <arg type="s" name="interface_name" direction="in"/>\n                <arg type="s" name="property_name" direction="in"/>\n                <arg type="v" name="value" direction="out"/>\n            </method>\n            <method name="GetAll">\n                <arg type="s" name="interface_name" direction="in"/>\n                <arg type="a{sv}" name="properties" direction="out"/>\n            </method>\n            <method name="Set">\n                <arg type="s" name="interface_name" direction="in"/>\n                <arg type="s" name="property_name" direction="in"/>\n                <arg type="v" name="value" direction="in"/>\n            </method>\n            <signal name="PropertiesChanged">\n                <arg type="s" name="interface_name"/>\n                <arg type="a{sv}" name="changed_properties"/>\n                <arg type="as" name="invalidated_properties"/>\n            </signal>\n        </interface>\n    </node>\n    '
class Signal(name, interface_name, type)

Bases: tuple

interface_name

Alias for field number 1

name

Alias for field number 0

type

Alias for field number 2

add_member(member)[source]

Add a member of a DBus interface.

classmethod from_xml(xml)[source]

Return a DBus specification for the given XML.

get_member(interface_name, member_name)[source]

Get a member of a DBus interface.

property interfaces

Interfaces of the DBus specification.

property members

Members of the DBus specification.

exception DBusSpecificationError[source]

Bases: Exception

Exception for the DBus specification errors.

class DBusSpecificationParser[source]

Bases: object

Class for parsing DBus XML specification.

classmethod parse_specification(xml, factory=<class 'dasbus.specification.DBusSpecification'>)[source]

Generate a representation of a DBus XML specification.

Parameters
  • xml – the XML specification to parse

  • factory – the DBus specification factory

Returns

a representation od the DBus specification

xml_parser

alias of XMLParser