File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 2424
2525def read_config () -> configparser .ConfigParser :
2626 config = configparser .ConfigParser ()
27+
28+ # Look for 'MURFEY_CLIENT_CONFIGURATION' environment variable first
29+ mcc = os .environ .get ("MURFEY_CLIENT_CONFIGURATION" )
30+ if mcc :
31+ config_file = Path (mcc )
32+ # If not set, look for 'MURFEY_CLIENT_CONFIG_HOME' or '~', and then to look for '.murfey'
33+ else :
34+ mcch = os .environ .get ("MURFEY_CLIENT_CONFIG_HOME" )
35+ murfey_client_config_home = Path (mcch ) if mcch else Path .home ()
36+ config_file = murfey_client_config_home / ".murfey"
37+
38+ # Attempt to read the file and return the config
2739 try :
28- # Look for 'MURFEY_CLIENT_CONFIGURATION' environment variable first
29- mcc = os .environ .get ("MURFEY_CLIENT_CONFIGURATION" )
30- if mcc :
31- config_file = Path (mcc )
32- # If not set, look for 'MURFEY_CLIENT_CONFIG_HOME' or '~', and then to look for '.murfey'
33- else :
34- mcch = os .environ .get ("MURFEY_CLIENT_CONFIG_HOME" )
35- murfey_client_config_home = Path (mcch ) if mcch else Path .home ()
36- config_file = murfey_client_config_home / ".murfey"
3740 with open (config_file ) as file :
3841 config .read_file (file )
3942 except FileNotFoundError :
You can’t perform that action at this time.
0 commit comments