Skip to content

Commit 1a6fb9b

Browse files
authored
Add files via upload
1 parent c7763c9 commit 1a6fb9b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

webArchiver.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,33 +82,33 @@ def forcedir(file_path):
8282
os.makedirs(directory)
8383
def hasher(filein, hname, blocksize):
8484
if hname=="blake2s":
85-
htype=hashlib.blake2s
85+
htype=hashlib.blake2s()
8686
elif hname=="sha384":
87-
htype=hashlib.sha384
87+
htype=hashlib.sha384()
8888
elif hname=="sha512":
89-
htype=hashlib.sha512
89+
htype=hashlib.sha512()
9090
elif hname=="sha3_256":
91-
htype=hashlib.sha3_256
91+
htype=hashlib.sha3_256()
9292
elif hname=="sha256":
93-
htype=hashlib.sha256
93+
htype=hashlib.sha256()
9494
elif hname=="md5":
95-
htype=hashlib.md5
95+
htype=hashlib.md5()
9696
elif hname=="sha3_512":
97-
htype=hashlib.sha3_512
97+
htype=hashlib.sha3_512()
9898
elif hname=="sha3_224":
99-
htype=hashlib.sha3_224
99+
htype=hashlib.sha3_224()
100100
elif hname=="shake_128":
101-
htype=hashlib.shake_128
101+
htype=hashlib.shake_128()
102102
elif hname=="shake_256":
103-
htype=hashlib.shake_256
103+
htype=hashlib.shake_256()
104104
elif hname=="sha1":
105-
htype=hashlib.sha1
105+
htype=hashlib.sha1()
106106
elif hname=="blake2b":
107-
htype=hashlib.blake2b
107+
htype=hashlib.blake2b()
108108
elif hname=="sha224":
109-
htype=hashlib.sha224
109+
htype=hashlib.sha224()
110110
elif hname=="sha3_384":
111-
htype=hashlib.sha3_384
111+
htype=hashlib.sha3_384()
112112
else:
113113
print("wrong hash type")
114114
exit(1)
@@ -142,7 +142,7 @@ def wfile(filedef, filerel):
142142
if csvid=="False":
143143
csvid=file_len(csv1)+1
144144
csver(csv1, "append", [csvid, hashin])
145-
os.replace(filedef, archivedir1 + "/" + str(csvid))
145+
shutil.move(filedef, archivedir1 + "/" + str(csvid))
146146
else:
147147
os.remove(filedef)
148148
csver(csv2, "append", [datetimes, csvid, filerel])

0 commit comments

Comments
 (0)