From d3cee9d2ecdc2d9a1327b23a004ec782e138a816 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 28 Mar 2021 18:51:17 +0200 Subject: Cleaning --- backend/raw_write.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'backend') diff --git a/backend/raw_write.py b/backend/raw_write.py index 7891b43..db903c5 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -134,7 +134,6 @@ class Dumper(object): checked=0 sha512func=hashlib.sha3_512() ncuts=int(b/1024) - #try: with open(target, 'rb') as f: for x in range(0,ncuts): block = f.read(1024) @@ -147,7 +146,6 @@ class Dumper(object): block = f.read(b-ncuts*1024) sha512func.update(block) sha512sumcalc=sha512func.hexdigest().upper() - #f.close() self.sum_check = "" sum_type = "sha3" sum_file = f"{source}.{sum_type}" @@ -161,22 +159,15 @@ class Dumper(object): logging.info(_("Sum file {} not found\n").format(sum_file)) self.sum_file = False self.return_state = True - #if self.signature_found and not self.signature_checked: - ##, keep the pourcent, this is the place for source file name - #self.return_message = _('Invalid signature for %s')%self.source_file - #self.return_state = False if (self.sum_check == "") : # Can't get stored sum self.return_message += _('SHA3 sum: {}').format(sha512sumcalc) # compare the sums elif (sha512sumcalc == self.sum_check) : - #if self.signature_checked and self.signature_found: - #, keep the bracket, this is the place for sum type - self.return_message +="\n" + _("The {} sum check is OK").format(sum_type) + #, keep the bracket, this is the place for sum type + self.return_message +="\n" + _("The {} sum check is OK").format(sum_type) else: self.return_message +="\n" + _("/!\\The computed and stored sums don't match") self.return_state = False - #except: - #pass self._progress = 100 logging.info(self.return_message) self.finished.set() -- cgit v1.2.1