gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 02/09: util: futurize contrib/scripts/gnunet-chk


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 02/09: util: futurize contrib/scripts/gnunet-chk
Date: Tue, 12 Feb 2019 12:10:26 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnunet.

commit 551ed5af91446dd1352adc03461b2873ba21c3fa
Author: ng0 <address@hidden>
AuthorDate: Tue Feb 12 10:59:44 2019 +0000

    util: futurize contrib/scripts/gnunet-chk
    
    Signed-off-by: ng0 <address@hidden>
---
 contrib/scripts/gnunet-chk.py.in | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/contrib/scripts/gnunet-chk.py.in b/contrib/scripts/gnunet-chk.py.in
index c60211556..1f5a0726c 100755
--- a/contrib/scripts/gnunet-chk.py.in
+++ b/contrib/scripts/gnunet-chk.py.in
@@ -21,6 +21,12 @@
 # Brief:   Computes GNUNET style Content Hash Key for a given file
 # Author:  Sree Harsha Totakura
 
+from __future__ import print_function
+from __future__ import division
+from builtins import str
+from builtins import range
+from past.utils import old_div
+from builtins import object
 from hashlib import sha512
 import logging
 import os
@@ -90,7 +96,7 @@ def sha512_hash(data):
     return hash_obj.digest()
 
 
-class AESKey:
+class AESKey(object):
     """Class for AES Keys. Contains the main key and the initialization
     vector. """
 
@@ -177,7 +183,7 @@ def aes_decrypt(aes_key, data):
     return ptext
 
 
-class Chk:
+class Chk(object):
     """Class for the content hash key."""
     key = None
     query = None
@@ -248,7 +254,7 @@ def compute_chk_offset_(depth, end_offset):
     bds = compute_tree_size_(depth)
     if (depth > 0):
         end_offset -= 1
-    ret = end_offset / bds
+    ret = old_div(end_offset, bds)
     return ret % CHK_PER_INODE
 
 
@@ -272,7 +278,7 @@ def compute_iblock_size_(depth, offset):
         ret = CHK_PER_INODE
     else:
         bds /= CHK_PER_INODE
-        ret = mod / bds
+        ret = old_div(mod, bds)
         if (mod % bds) is not 0:
             ret += 1
     return ret

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]