File tree Expand file tree Collapse file tree 6 files changed +18
-9
lines changed
Expand file tree Collapse file tree 6 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ Marcel's broccoli module for simplifying his coding.
1010```
1111-marcelbroccoli
1212 |-functions.py Custom functions
13- |-load_env Load a `.env` file and log an error if any
1413 |-load_config_file Load a JSON configuration file and return config object
1514 |-starts_with Check if string starts with pattern (case sensitive or case insensitive)
1615 |-str2datetime Convert from all date and date time sources to date object
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ Marcel's broccoli module for simplifying his coding.
44
55## Functions
66
7- ### ` load_env() `
8-
9- Load ` .env ` secret file.
10-
117### ` load_config_file(cfg_file:str) `
128
139Load a JSON configuration and return a configuration object.
Original file line number Diff line number Diff line change 1111from . import logger
1212
1313
14+ '''
15+ Load configuration file.
16+ '''
17+ def load_config_file (cfg_file :str ):
18+ cfg = None
19+ try :
20+ with open (cfg_file ) as f :
21+ cfg = json .load (f )
22+ except Exception as e :
23+ logger .log ("Error: could not load configuration file '{}'. {}" .format (cfg_file , e ))
24+
25+ return cfg
26+
27+
1428'''
1529Set working dir to folder and return working_dir
1630'''
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def debug(self, msg:str):
156156 # start log
157157 logger .info ("Welcome to the Logger Test Script." )
158158 logger .info ("Log file is '{}'" .format (log_file ))
159- print ("Log level: {}" .format (marcellg . logger .level ))
159+ print ("Log level: {}" .format (logger .level ))
160160
161161 logger .info ("Script execution completed with exit code {}." .format (errorcode ))
162162 sys .exit (errorcode )
Original file line number Diff line number Diff line change 11# meta data
22__author__ = "Marcel Gerber"
3- __date__ = "2024-04-05 "
4- __version__ = "1.5.1 "
3+ __date__ = "2024-04-10 "
4+ __version__ = "1.6.0 "
Original file line number Diff line number Diff line change 22
33setup (
44 name = "marcelbroccoli" ,
5- version = "1.5.1 " ,
5+ version = "1.6.0 " ,
66 description = "Marcel's custom functions" ,
77 url = "https://github.com/chemage/marcelbroccoli" ,
88 author = "Marcel Gerber" ,
You can’t perform that action at this time.
0 commit comments