Project

General

Profile

Feature #761

Code Suggestion about feature no #753

Added by Minxu YANG over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
Start date:
10/25/2023
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:

Description

Suggested changes

If the configuration file (config.ini by default) does not exist or is not in the specified path, the config.read(config_path) line will not raise an error, but any subsequent attempts to access keys in the configuration file will.

If the expected keys (like imageWidthPx, imageWidthCm, etc.) are not found in the configuration file, the methods will raise a KeyError.

If the values in the configuration file are not of the expected format (e.g., a non-numeric value for imageWidthPx), the type conversion (like int() or float()) will raise a ValueError.

Modified code
See the file config_reader_plus.py


Files

config_reader plus.py (1.92 KB) config_reader plus.py Minxu YANG, 10/25/2023 11:49 PM

Also available in: Atom PDF