コード例 #1
0
ファイル: message.py プロジェクト: cocagne/txdbus
    def __init__(self, path, member, interface, destination=None,
                 signature=None, body=None):
        """
        @param path: C{str} DBus object path of the object sending the signal
        @param member: C{str} Member name
        @param interface: C{str} DBus interface name or None
        @param destination: C{str} DBus bus name for message destination or
                            None
        @param signature: C{str} DBus signature string for encoding
                          C{self.body}
        @param body: C{list} of python objects to encode. Objects must match
                     the C{self.signature}
        """
        marshal.validateMemberName(member)
        marshal.validateInterfaceName(interface)

        if destination:
            marshal.validateBusName(destination)

        self.path = path
        self.member = member
        self.interface = interface
        self.destination = destination
        self.signature = signature
        self.body = body

        self._marshal()
コード例 #2
0
ファイル: message.py プロジェクト: cocagne/txdbus
    def __init__(self, error_name, reply_serial, destination=None,
                 signature=None, body=None, sender=None):
        """
        @param error_name: C{str} DBus error name
        @param reply_serial: C{int} serial number this message is a reply to
        @param destination: C{str} DBus bus name for message destination or
                            None
        @param signature: C{str} DBus signature string for encoding
                          C{self.body}
        @param body: C{list} of python objects to encode. Objects must match
                     the C{self.signature}
        @param sender: C{str} name of the originating Bus connection
        """
        if destination:
            marshal.validateBusName(destination)

        marshal.validateInterfaceName(error_name)

        self.error_name = error_name
        self.reply_serial = marshal.UInt32(reply_serial)
        self.destination = destination
        self.signature = signature
        self.body = body
        self.sender = sender

        self._marshal()
コード例 #3
0
    def __init__(self, path, member, interface, destination=None,
                 signature=None, body=None):
        """
        @param path: C{str} DBus object path of the object sending the signal
        @param member: C{str} Member name
        @param interface: C{str} DBus interface name or None
        @param destination: C{str} DBus bus name for message destination or
                            None
        @param signature: C{str} DBus signature string for encoding
                          C{self.body}
        @param body: C{list} of python objects to encode. Objects must match
                     the C{self.signature}
        """
        marshal.validateMemberName(member)
        marshal.validateInterfaceName(interface)

        if destination:
            marshal.validateBusName(destination)

        self.path = path
        self.member = member
        self.interface = interface
        self.destination = destination
        self.signature = signature
        self.body = body

        self._marshal()
コード例 #4
0
    def __init__(self, error_name, reply_serial, destination=None,
                 signature=None, body=None, sender=None):
        """
        @param error_name: C{str} DBus error name
        @param reply_serial: C{int} serial number this message is a reply to
        @param destination: C{str} DBus bus name for message destination or
                            None
        @param signature: C{str} DBus signature string for encoding
                          C{self.body}
        @param body: C{list} of python objects to encode. Objects must match
                     the C{self.signature}
        @param sender: C{str} name of the originating Bus connection
        """
        if destination:
            marshal.validateBusName(destination)

        marshal.validateInterfaceName(error_name)

        self.error_name = error_name
        self.reply_serial = marshal.UInt32(reply_serial)
        self.destination = destination
        self.signature = signature
        self.body = body
        self.sender = sender

        self._marshal()
コード例 #5
0
    def __init__(self,
                 path,
                 member,
                 interface=None,
                 destination=None,
                 signature=None,
                 body=None,
                 expectReply=True,
                 autoStart=True,
                 oobFDs=None):
        """
        @param path: C{str} DBus object path
        @param member: C{str} Member name
        @param interface: C{str} DBus interface name or None
        @param destination: C{str} DBus bus name for message destination or
                            None
        @param signature: C{str} DBus signature string for encoding
                          C{self.body}
        @param body: C{list} of python objects to encode. Objects must match
                     the C{self.signature}
        @param expectReply: True if a Method Return message should be sent
                            in reply to this message
        @param autoStart: True if the Bus should auto-start a service to handle
                          this message if the service is not already running.
        """

        marshal.validateMemberName(member)

        if interface:
            marshal.validateInterfaceName(interface)

        if destination:
            marshal.validateBusName(destination)

        if path == '/org/freedesktop/DBus/Local':
            raise error.MarshallingError(
                '/org/freedesktop/DBus/Local is a reserved path')

        self.path = path
        self.member = member
        self.interface = interface
        self.destination = destination
        self.signature = signature
        self.body = body
        self.expectReply = expectReply
        self.autoStart = autoStart
        self.oobFDs = oobFDs

        self._marshal(oobFDs=oobFDs)
コード例 #6
0
ファイル: message.py プロジェクト: jkorkean/txdbus
    def __init__(
        self,
        path,
        member,
        interface=None,
        destination=None,
        signature=None,
        body=None,
        expectReply=True,
        autoStart=True,
    ):
        """
        @param path: C{str} DBus object path
        @param member: C{str} Member name
        @param interface: C{str} DBus interface name or None
        @param destination: C{str} DBus bus name for message destination or
                            None
        @param signature: C{str} DBus signature string for encoding
                          C{self.body}
        @param body: C{list} of python objects to encode. Objects must match
                     the C{self.signature}
        @param expectReply: True if a Method Return message should be sent
                            in reply to this message
        @param autoStart: True if the Bus should auto-start a service to handle
                          this message if the service is not already running.
        """

        marshal.validateMemberName(member)

        if interface:
            marshal.validateInterfaceName(interface)

        if destination:
            marshal.validateBusName(destination)

        if path == "/org/freedesktop/DBus/Local":
            raise error.MarshallingError("/org/freedesktop/DBus/Local is a reserved path")

        self.path = path
        self.member = member
        self.interface = interface
        self.destination = destination
        self.signature = signature
        self.body = body
        self.expectReply = expectReply
        self.autoStart = autoStart

        self._marshal()