@@ -125,11 +125,8 @@ def count_files(self):
125125
126126 return len (self .get_files ())
127127
128- def _sort_hash_list (self ):
129- self ._hash_list = sorted (self ._hash_list , key = lambda x : x [0 ] + x [1 ])
130-
131128 def generate (self , progress = None ):
132- """Generate the Data Integrity Fingerprint.
129+ """Generate hash list to get Data Integrity Fingerprint.
133130
134131 Parameters
135132 ----------
@@ -142,15 +139,15 @@ def generate(self, progress=None):
142139
143140 """
144141
145- self . _hash_list = []
142+ hash_list = []
146143
147144 if os .path .isfile (self ._data ):
148145 # from checksum file
149146 with codecs .open (self ._data , encoding = "utf-8" ) as f :
150147 for line in f :
151148 h , fl = line .split (self .CHECKSUM_FILENAME_SEPARATOR ,
152149 maxsplit = 1 )
153- self . _hash_list .append ((h , fl .strip ()))
150+ hash_list .append ((h , fl .strip ()))
154151 else :
155152 files = self .get_files ()
156153 func_args = zip (files , [self ._hash_algorithm ] * len (files ))
@@ -164,9 +161,9 @@ def generate(self, progress=None):
164161 progress (counter + 1 , len (files ),
165162 "{0}/{1}" .format (counter + 1 , len (files )))
166163 fl = os .path .relpath (rtn [1 ], self .data ).replace (os .path .sep ,"/" )
167- self . _hash_list .append ((rtn [0 ], fl ))
164+ hash_list .append ((rtn [0 ], fl ))
168165
169- self ._sort_hash_list ( )
166+ self ._hash_list = sorted ( hash_list , key = lambda x : x [ 0 ] + x [ 1 ] )
170167
171168 def save_checksums (self , filename = None ):
172169 """Save the checksums to a file.
0 commit comments