webchanges.main module
The main class.
For the entry point, see main() in the cli module.
- class webchanges.main.Urlwatch(urlwatch_config, config_storage, ssdb_storage, jobs_storage)
Bases:
objectThe main class.
- Parameters:
urlwatch_config (CommandConfig) – The CommandConfig object containing the program run information.
config_storage (YamlConfigStorage) – The YamlConfigStorage object containing the configuration information.
ssdb_storage (SsdbStorage) – The CacheStorage object containing snapshot database information
jobs_storage (YamlJobsStorage) – The YamlJobsStorage object containing information about the jobs.
- config_storage: YamlConfigStorage
- ssdb_storage: SsdbStorage
- jobs_storage: YamlJobsStorage
- jobs: list[JobBase]
- check_directories()
Check whether the configuration and jobs files directories exist. Create them and write default configuration files if one not found.
- Return type:
None
- load_jobs()
Load jobs from the file(s) into self.jobs.
- Raises:
SystemExit – If job is not found, setting argument to 1.
- Return type:
None
- get_new_release_version(timeout=None)
Check PyPi to see if we’re running the latest version. Memoized.
- Returns:
Empty string if no higher version is available, otherwise the new version number.
- Parameters:
timeout (float | None)
- Return type:
str | bool
- run_jobs(read_only=False)
Run all jobs.
- Parameters:
read_only (bool) – If True, do not persist new snapshots to the database. Used by
--test-reporterwhen combined with a joblist so that previewing a reporter does not pollute the snapshot history.- Return type:
None
- close()
Finalizer. Create reports ands close snapshots database.
- Return type:
None