qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [1/3] qpid-proton git commit: Correct indentation of legacy uuid support
Date Wed, 04 Feb 2015 09:57:09 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 94f3292c5 -> 295f8b06d


Correct indentation of legacy uuid support


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/295f8b06
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/295f8b06
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/295f8b06

Branch: refs/heads/master
Commit: 295f8b06d06e04e4a9874259bd2c9d5c4744aaac
Parents: 8d19cad
Author: Gordon Sim <gsim@redhat.com>
Authored: Wed Feb 4 09:14:49 2015 +0000
Committer: Gordon Sim <gsim@redhat.com>
Committed: Wed Feb 4 09:15:40 2015 +0000

----------------------------------------------------------------------
 proton-c/bindings/python/proton/__init__.py | 34 ++++++++++++------------
 1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/295f8b06/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index a93c847..5c9fe63 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -68,23 +68,23 @@ except ImportError:
       def __hash__(self):
         return self.bytes.__hash__()
 
-  import os, random, time
-  rand = random.Random()
-  rand.seed((os.getpid(), time.time(), socket.gethostname()))
-  def random_uuid():
-    bytes = [rand.randint(0, 255) for i in xrange(16)]
-
-    # From RFC4122, the version bits are set to 0100
-    bytes[7] &= 0x0F
-    bytes[7] |= 0x40
-
-    # From RFC4122, the top two bits of byte 8 get set to 01
-    bytes[8] &= 0x3F
-    bytes[8] |= 0x80
-    return "".join(map(chr, bytes))
-
-  def uuid4():
-    return uuid.UUID(bytes=random_uuid())
+    import os, random, time
+    rand = random.Random()
+    rand.seed((os.getpid(), time.time(), socket.gethostname()))
+    def random_uuid():
+      bytes = [rand.randint(0, 255) for i in xrange(16)]
+
+      # From RFC4122, the version bits are set to 0100
+      bytes[7] &= 0x0F
+      bytes[7] |= 0x40
+
+      # From RFC4122, the top two bits of byte 8 get set to 01
+      bytes[8] &= 0x3F
+      bytes[8] |= 0x80
+      return "".join(map(chr, bytes))
+
+    def uuid4():
+      return uuid.UUID(bytes=random_uuid())
 
 def generate_uuid():
   return uuid.uuid4()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message