summaryrefslogtreecommitdiff
path: root/python/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'python/qpid')
-rw-r--r--python/qpid/datatypes.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/python/qpid/datatypes.py b/python/qpid/datatypes.py
index fc267c48ef..c37929394c 100644
--- a/python/qpid/datatypes.py
+++ b/python/qpid/datatypes.py
@@ -308,17 +308,15 @@ except ImportError:
def uuid4():
return UUID(random_uuid())
-class UUID:
+def parseUUID(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]))
+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)