[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
- [GNUnet-SVN] [gnunet] branch master updated (abf25faba -> c886489c9), gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 02/09: util: futurize contrib/scripts/gnunet-chk,
gnunet <=
- [GNUnet-SVN] [gnunet] 01/09: util: futurize gnunet-qr, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 04/09: util: futurize contrib/scripts/pydiffer, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 03/09: util: futurize contrib/scripts/gnunet_pyexpect, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 05/09: util: futurize contrib/scripts/terminate, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 07/09: util: futurize fs/test_gnunet_fs_psd, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 08/09: util: futurize revocation/test_local_revocation, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 09/09: Merge branch 'master' of gnunet.org:gnunet, gnunet, 2019/02/12
- [GNUnet-SVN] [gnunet] 06/09: util: futurize consensus/consensus-simulation, gnunet, 2019/02/12