Package wsatools :: Module FitsToDb :: Class FileErrorList
[hide private]

Class FileErrorList

source code


Container class for file errors associated with a single file. Construct an instance of this class for every file, append the error log for each file, and on destruction a total summary for the file will be reported. This reduces the total error log output by just providing one error report per file. Total statistics for all files (i.e. all instances of this class created) are maintained to provide final summary reports.

Instance Methods [hide private]
 
__init__(self, filePathName)
Constructs a FileError list for supplied file.
source code
 
__del__(self)
Outputs a warning if errors occurred, and maintains a count of every error for the final summary.
source code
 
append(self, fileError)
Associate another error type with this file.
source code

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

Static Methods [hide private]
 
logFinalSummary(filePath)
Logs the total number of files that failed for each type of error encountered.
source code
Class Variables [hide private]
  _errTypeCount = {}
Maintains total error count per error type for all files/FileErrorLists.
  _fileErrorHistory = {}
Keeps a record of every file error for summary.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filePathName)
(Constructor)

source code 

Constructs a FileError list for supplied file.

Parameters:
  • filePathName (str) - Full path to file.
Overrides: object.__init__

append(self, fileError)

source code 

Associate another error type with this file.

Parameters:
  • fileError (FileError) - The error type.

logFinalSummary(filePath)
Static Method

source code 

Logs the total number of files that failed for each type of error encountered.

Parameters:
  • filePath (str) - Full path to the log file where the problem files are listed.