mirror of
https://gitlab.os-k.eu/neox/CNIRevelator.git
synced 2023-08-25 14:03:10 +02:00
SHA1 added
This commit is contained in:
parent
7b4e7a51a0
commit
df654066a8
@ -1,2 +1,2 @@
|
||||
# ver|url|checksum, and | as separator, one version per ||
|
||||
3.0.0|https://neoxgroup.eu/ftpaccess/Applicatifs/CNIRevelator/CNIRevelator_2.2.5|1234||3.0.0|https://neoxgroup.eu/ftpaccess/Applicatifs/CNIRevelator/CNIRevelator_2.2.5|1234||
|
||||
3.0.1|https://github.com/neox95/CNIRevelator/releases/download/3.0.1-pre-alpha/CNIRevelator.zip|FIaHzUzgi7Lqmad7md9bzsvbdx4=||
|
||||
|
@ -31,6 +31,7 @@ import time
|
||||
import os
|
||||
import shutil
|
||||
import zipfile
|
||||
import hashlib
|
||||
|
||||
import logger # logger.py
|
||||
import globs # globs.py
|
||||
@ -128,8 +129,23 @@ def batch():
|
||||
logfile.printdbg('Preparing download for the new version')
|
||||
|
||||
getTheUpdate = downloader.newdownload(credentials, finalurl, globs.CNIRFolder + '\\..\\CNIPackage.zip').download()
|
||||
|
||||
# BUF_SIZE is totally arbitrary, change for your app!
|
||||
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
|
||||
|
||||
sha1 = hashlib.sha1()
|
||||
|
||||
with open(globs.CNIRFolder + '\\..\\CNIPackage.zip', 'rb') as f:
|
||||
while True:
|
||||
data = f.read(BUF_SIZE)
|
||||
if not data:
|
||||
break
|
||||
sha1.update(data)
|
||||
|
||||
logfile.printdbg("SHA1: {0}".format(sha1.hexdigest()))
|
||||
|
||||
# And now unzip and launch
|
||||
logfile.printdbg("Unzipping the package")
|
||||
zip_ref = zipfile.ZipFile(globs.CNIRFolder + '\\..\\CNIPackage.zip', 'r')
|
||||
zip_ref.extractall(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full))
|
||||
zip_ref.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user