feat: add additional pxd defs for message (#118)
This commit is contained in:
@@ -3,9 +3,9 @@ from typing import TYPE_CHECKING, Any, List, Union
|
|||||||
|
|
||||||
from .. import introspection as intr
|
from .. import introspection as intr
|
||||||
from .._private.util import replace_fds_with_idx, replace_idx_with_fds
|
from .._private.util import replace_fds_with_idx, replace_idx_with_fds
|
||||||
from ..constants import ErrorType
|
from ..constants import ErrorType, MessageFlag
|
||||||
from ..errors import DBusError
|
from ..errors import DBusError
|
||||||
from ..message import Message, MessageFlag
|
from ..message import Message
|
||||||
from ..message_bus import BaseMessageBus
|
from ..message_bus import BaseMessageBus
|
||||||
from ..proxy_object import BaseProxyInterface, BaseProxyObject
|
from ..proxy_object import BaseProxyInterface, BaseProxyObject
|
||||||
from ..signature import Variant
|
from ..signature import Variant
|
||||||
|
|||||||
@@ -3,21 +3,45 @@
|
|||||||
import cython
|
import cython
|
||||||
|
|
||||||
|
|
||||||
|
cdef object ErrorType
|
||||||
|
cdef object SignatureTree
|
||||||
|
cdef object SignatureType
|
||||||
|
cdef object MessageType
|
||||||
|
cdef object Variant
|
||||||
|
cdef object Marshaller
|
||||||
|
|
||||||
|
|
||||||
|
cdef object HEADER_PATH
|
||||||
|
cdef object HEADER_INTERFACE
|
||||||
|
cdef object HEADER_MEMBER
|
||||||
|
cdef object HEADER_ERROR_NAME
|
||||||
|
cdef object HEADER_REPLY_SERIAL
|
||||||
|
cdef object HEADER_DESTINATION
|
||||||
|
cdef object HEADER_SENDER
|
||||||
|
cdef object HEADER_SIGNATURE
|
||||||
|
cdef object HEADER_UNIX_FDS
|
||||||
|
|
||||||
|
|
||||||
|
cdef object LITTLE_ENDIAN
|
||||||
|
cdef object PROTOCOL_VERSION
|
||||||
|
|
||||||
|
cdef get_signature_tree
|
||||||
|
|
||||||
cdef class Message:
|
cdef class Message:
|
||||||
|
|
||||||
cdef public str destination
|
cdef public object destination
|
||||||
cdef public str path
|
cdef public object path
|
||||||
cdef public str interface
|
cdef public object interface
|
||||||
cdef public str member
|
cdef public object member
|
||||||
cdef public object message_type
|
cdef public object message_type
|
||||||
cdef public object flags
|
cdef public object flags
|
||||||
cdef public str error_name
|
cdef public object error_name
|
||||||
cdef public unsigned int reply_serial
|
cdef public unsigned int reply_serial
|
||||||
cdef public str sender
|
cdef public object sender
|
||||||
cdef public list unix_fds
|
cdef public object unix_fds
|
||||||
cdef public str signature
|
cdef public object signature
|
||||||
cdef public object signature_tree
|
cdef public object signature_tree
|
||||||
cdef public list body
|
cdef public object body
|
||||||
cdef public unsigned int serial
|
cdef public unsigned int serial
|
||||||
|
|
||||||
cpdef _marshall(self, bint negotiate_unix_fd)
|
cpdef _marshall(self, bint negotiate_unix_fd)
|
||||||
|
|||||||
@@ -266,33 +266,21 @@ class Message:
|
|||||||
# Variant is invalid.
|
# Variant is invalid.
|
||||||
|
|
||||||
if self.path:
|
if self.path:
|
||||||
fields.append([HEADER_PATH, Variant("o", self.path, verify=False)])
|
fields.append([HEADER_PATH, Variant("o", self.path, False)])
|
||||||
if self.interface:
|
if self.interface:
|
||||||
fields.append(
|
fields.append([HEADER_INTERFACE, Variant("s", self.interface, False)])
|
||||||
[HEADER_INTERFACE, Variant("s", self.interface, verify=False)]
|
|
||||||
)
|
|
||||||
if self.member:
|
if self.member:
|
||||||
fields.append([HEADER_MEMBER, Variant("s", self.member, verify=False)])
|
fields.append([HEADER_MEMBER, Variant("s", self.member, False)])
|
||||||
if self.error_name:
|
if self.error_name:
|
||||||
fields.append(
|
fields.append([HEADER_ERROR_NAME, Variant("s", self.error_name, False)])
|
||||||
[HEADER_ERROR_NAME, Variant("s", self.error_name, verify=False)]
|
|
||||||
)
|
|
||||||
if self.reply_serial:
|
if self.reply_serial:
|
||||||
fields.append(
|
fields.append([HEADER_REPLY_SERIAL, Variant("u", self.reply_serial, False)])
|
||||||
[HEADER_REPLY_SERIAL, Variant("u", self.reply_serial, verify=False)]
|
|
||||||
)
|
|
||||||
if self.destination:
|
if self.destination:
|
||||||
fields.append(
|
fields.append([HEADER_DESTINATION, Variant("s", self.destination, False)])
|
||||||
[HEADER_DESTINATION, Variant("s", self.destination, verify=False)]
|
|
||||||
)
|
|
||||||
if self.signature:
|
if self.signature:
|
||||||
fields.append(
|
fields.append([HEADER_SIGNATURE, Variant("g", self.signature, False)])
|
||||||
[HEADER_SIGNATURE, Variant("g", self.signature, verify=False)]
|
|
||||||
)
|
|
||||||
if self.unix_fds and negotiate_unix_fd:
|
if self.unix_fds and negotiate_unix_fd:
|
||||||
fields.append(
|
fields.append([HEADER_UNIX_FDS, Variant("u", len(self.unix_fds), False)])
|
||||||
[HEADER_UNIX_FDS, Variant("u", len(self.unix_fds), verify=False)]
|
|
||||||
)
|
|
||||||
|
|
||||||
header_body = [
|
header_body = [
|
||||||
LITTLE_ENDIAN,
|
LITTLE_ENDIAN,
|
||||||
|
|||||||
Reference in New Issue
Block a user