You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2010/04/06 20:26:23 UTC

svn commit: r931262 - in /qpid/trunk/qpid: python/qpid/datatypes.py tools/src/py/qpid-cluster-store

Author: aconway
Date: Tue Apr  6 18:26:22 2010
New Revision: 931262

URL: http://svn.apache.org/viewvc?rev=931262&view=rev
Log:
Remove non-portable @staticmethod from qpid/datatypes.py

Modified:
    qpid/trunk/qpid/python/qpid/datatypes.py
    qpid/trunk/qpid/tools/src/py/qpid-cluster-store

Modified: qpid/trunk/qpid/python/qpid/datatypes.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/datatypes.py?rev=931262&r1=931261&r2=931262&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/datatypes.py (original)
+++ qpid/trunk/qpid/python/qpid/datatypes.py Tue Apr  6 18:26:22 2010
@@ -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)

Modified: qpid/trunk/qpid/tools/src/py/qpid-cluster-store
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qpid-cluster-store?rev=931262&r1=931261&r2=931262&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qpid-cluster-store (original)
+++ qpid/trunk/qpid/tools/src/py/qpid-cluster-store Tue Apr  6 18:26:22 2010
@@ -19,7 +19,7 @@
 # under the License.
 #
 
-from  qpid.datatypes import uuid4, UUID
+from  qpid.datatypes import uuid4, UUID, parseUUID
 import optparse, os.path, sys
 
 op = optparse.OptionParser(
@@ -39,7 +39,7 @@ class ClusterStoreStatus:
 
     def read(self):
         f = open(self.file)
-        try: self.cluster_id, self.shutdown_id = [UUID.parse(s) for s in f.readlines()]
+        try: self.cluster_id, self.shutdown_id = [parseUUID(s) for s in f.readlines()]
         finally: f.close()
 
     def write(self):



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org