parsedmarc.source.file
🔗
DirectoriesAndFiles
🔗
DirectoriesAndFiles(
name: str = "default",
parser: ReportParser | None = None,
config: dict[str, Any] | None = None,
)
Bases: Source
Source for reading a static list of files and directories
This is intented for "one-shot" modes. For continuous collection and archiving use
the DirectoryWatcher
source.
This source will parse the following file types:
- Mailbox:
.mbox
- Email:
.eml
,.msg
New in 9.0.
PARAMETER | DESCRIPTION |
---|---|
name |
profile name for this instance, ideally should be unqiue to easily idenfity this instance and any log messages it produces
TYPE:
|
parser |
parser to use when generating reports
TYPE:
|
config |
config for this instance |
outstanding_jobs
property
🔗
outstanding_jobs: MappingProxyType[str, Job]
Read only view of outstanding jobs
ack_job
🔗
cleanup
🔗
Perform cleanup on this source.
This method is called as a part of self.shutdown
.
Child classes can override this method to implement their own logic.
It is still recomended to call super().cleanup()
.
register_job
🔗
register_job(job: Job) -> None
Register a job to this source so we can keep track of it
PARAMETER | DESCRIPTION |
---|---|
job |
the job to register
TYPE:
|
shutdown
🔗
validate_config
🔗
Validate the config of this instance
Child classes can override this method to implement their own logic.
It is still recomended to call super().validate_config()
.