diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/datatypes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/qpid/datatypes.py b/python/qpid/datatypes.py index e4cbcb7f10..fc267c48ef 100644 --- a/python/qpid/datatypes.py +++ b/python/qpid/datatypes.py @@ -313,6 +313,12 @@ class UUID: def __init__(self, bytes): self.bytes = bytes + @staticmethod + def parse(str): + fields=str.split("-") + fields[4:5] = [fields[4][:4], fields[4][4:]] + return UUID(struct.pack("!LHHHHL", *[int(x,16) for x in fields])) + def __cmp__(self, other): if isinstance(other, UUID): return cmp(self.bytes, other.bytes) |
