feat: add cython extension for messages (#73)
This commit is contained in:
parent
5db51562bc
commit
8676f12a7e
1
build.py
1
build.py
@ -22,6 +22,7 @@ def build(setup_kwargs):
|
||||
dict(
|
||||
ext_modules=cythonize(
|
||||
[
|
||||
"src/dbus_fast/message.py",
|
||||
"src/dbus_fast/signature.py",
|
||||
"src/dbus_fast/unpack.py",
|
||||
"src/dbus_fast/_private/marshaller.py",
|
||||
|
||||
23
src/dbus_fast/message.pxd
Normal file
23
src/dbus_fast/message.pxd
Normal file
@ -0,0 +1,23 @@
|
||||
"""cdefs for message.py"""
|
||||
|
||||
import cython
|
||||
|
||||
|
||||
cdef class Message:
|
||||
|
||||
cdef public str destination
|
||||
cdef public str path
|
||||
cdef public str interface
|
||||
cdef public str member
|
||||
cdef public object message_type
|
||||
cdef public object flags
|
||||
cdef public str error_name
|
||||
cdef public unsigned int reply_serial
|
||||
cdef public str sender
|
||||
cdef public list unix_fds
|
||||
cdef public str signature
|
||||
cdef public object signature_tree
|
||||
cdef public list body
|
||||
cdef public unsigned int serial
|
||||
|
||||
cpdef _marshall(self, negotiate_unix_fd: bint)
|
||||
@ -121,7 +121,7 @@ class Message:
|
||||
self.error_name = (
|
||||
error_name if type(error_name) is not ErrorType else error_name.value
|
||||
)
|
||||
self.reply_serial = reply_serial
|
||||
self.reply_serial = reply_serial or 0
|
||||
self.sender = sender
|
||||
self.unix_fds = unix_fds
|
||||
if type(signature) is SignatureTree:
|
||||
@ -131,7 +131,7 @@ class Message:
|
||||
self.signature = signature
|
||||
self.signature_tree = get_signature_tree(signature)
|
||||
self.body = body
|
||||
self.serial = serial
|
||||
self.serial = serial or 0
|
||||
|
||||
if not validate:
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user