Package invocations :: Package cu1 :: Module cu1Transfer :: Class MD5Checker
[hide private]

Class MD5Checker

source code


Class containing all MD5 related functions.

Instance Methods [hide private]
list(int, int), list
md5Run(self, dirStats, tfDict, outDirs)
md5 checking.
source code
dict(str: int)
_md5Calc(self, fileList)
md5 checksum calculation.
source code
int, list
_md5Compare(self, remList, locDict, missingFiles)
Test md5 checksums and move corrupted files to 'cor_dir'.
source code
list(list(str, int)), int
_readCamMd5(self, fileName)
Read camb md5 list.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  sysc = IngCuSession.sysc
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

md5Run(self, dirStats, tfDict, outDirs)

source code 

md5 checking.

Parameters:
  • dirStats (dict) - Directory statistics.
  • tfDict (dict) - Dictionary of transferred files.
Returns: list(int, int), list
Status of md5 checks on files here and at CASU, and list of files with missing md5 checks.

_md5Calc(self, fileList)

source code 

md5 checksum calculation.

Parameters:
  • fileList (list(str)) - List of files to check.
Returns: dict(str: int)
Dictionary of files and their checksums.

_md5Compare(self, remList, locDict, missingFiles)

source code 

Test md5 checksums and move corrupted files to 'cor_dir'.

Parameters:
  • remList (list) - File list from CASU.
  • locDict (dict) - Local file dict of transfered files.
  • missingFiles (list) - Missing (not downloaded) files.
Returns: int, list
Status of md5 check (0 OK, 1 missing/wrong checksum) and missingFiles list updated with files with different checksums.

_readCamMd5(self, fileName)

source code 

Read camb md5 list.

Parameters:
  • fileName (str) - File at CASU containing the md5 checksums there.
Returns: list(list(str, int)), int
List of [file name, checksum] pairs, and status of md5 checks.