MCPcopy Create free account
hub / github.com/apache/qpid-proton / msgid2py

Function msgid2py

python/cproton.py:241–264  ·  view source on GitHub ↗
(msgid)

Source from the content-addressed store, hash-verified

239
240
241def msgid2py(msgid):
242 t = msgid.type
243 if t == PN_NULL:
244 return None
245 elif t == PN_ULONG:
246 return msgid.u.as_ulong
247 elif t == PN_BINARY:
248 return bytes2py(msgid.u.as_bytes)
249 elif t == PN_STRING:
250 return bytes2string(msgid.u.as_bytes)
251 elif t == PN_UUID:
252 return UUID(bytes=uuid2bytes(msgid.u.as_uuid))
253 # These two cases are for compatibility with the broken ruby binding
254 elif t == PN_INT:
255 v = msgid.u.as_int
256 if v >= 0:
257 return v
258 return None
259 elif t == PN_LONG:
260 v = msgid.u.as_long
261 if v >= 0:
262 return v
263 return None
264 return None
265
266
267def py2msgid(py):

Callers 2

pn_message_get_idFunction · 0.85

Calls 4

UUIDTypeAlias · 0.90
bytes2pyFunction · 0.85
bytes2stringFunction · 0.85
uuid2bytesFunction · 0.85

Tested by

no test coverage detected