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
#1

Updated by Minxu YANG over 1 year ago

  • Tracker changed from Bug to Feature
#2

Updated by Minxu YANG over 1 year ago

  • Assignee changed from Baizid Al HAMID to Minxu YANG
#3

Updated by Minxu YANG over 1 year ago

  • Subject changed from Code Suggestion to Code Suggestion about feature no #753
#4

Updated by Minxu YANG over 1 year ago

  • Estimated time set to 2.00 h
#5

Updated by Baizid Al HAMID over 1 year ago

This was not an assigned task for this week. And refrain from making further Redmine issues without consulting the Project Leader as well.

-Project Manager

#6

Updated by Baizid Al HAMID over 1 year ago

  • Project changed from G11-2023 to Test Project
  • Parent task deleted (#753)

Also available in: Atom PDF