From dc06505e902d3a2b8fdcc276b61db0636308d1e6 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 21 Nov 2016 12:57:55 +0800 Subject: products.py: Use "utils.hashutil.md5()" --- fg21sim/products.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fg21sim') diff --git a/fg21sim/products.py b/fg21sim/products.py index c0d23ac..5df7d7a 100644 --- a/fg21sim/products.py +++ b/fg21sim/products.py @@ -7,7 +7,6 @@ Manage and manipulate the simulation products. import os import shutil -import hashlib import json import logging from collections import OrderedDict @@ -15,6 +14,7 @@ from collections import OrderedDict import numpy as np from .errors import ManifestError +from .utils.hashutil import md5 logger = logging.getLogger(__name__) @@ -157,7 +157,7 @@ class Products: "path": os.path.relpath(filepath, curdir), # File size in bytes "size": os.path.getsize(filepath), - "md5": hashlib.md5(filepath).hexdigest(), + "md5": md5(filepath), } } logger.info("Added one product to the manifest: {0}".format(filepath)) @@ -219,7 +219,7 @@ class Products: metadata = self.manifest[comp_id][freq_id] filepath = os.path.join(curdir, metadata["healpix"]["path"]) hash_true = metadata["healpix"]["md5"] - hash_ondisk = hashlib.md5(filepath).hexdigest() + hash_ondisk = md5(filepath) if hash_ondisk == hash_true: match = True else: -- cgit v1.2.2