88import socket
99import shutil
1010from .util import custom_http_headers , validators
11+ from jupyter_matlab_proxy import mw_environment_variables as mw_env
1112
1213
1314def get_matlab_path ():
@@ -57,13 +58,13 @@ def get_dev_settings():
5758 ],
5859 "create_xvfb_cmd" : create_xvfb_cmd ,
5960 "matlab_ready_file" : matlab_ready_file ,
60- "base_url" : os .environ .get ("BASE_URL" , "" ),
61- "app_port" : os .environ .get ("APP_PORT" , 8000 ),
62- "host_interface" : os .environ .get ("APP_HOST" , "127.0.0.1" ),
61+ "base_url" : os .environ .get (mw_env . get_env_name_base_url () , "" ),
62+ "app_port" : os .environ .get (mw_env . get_env_name_app_port () , 8000 ),
63+ "host_interface" : os .environ .get (mw_env . get_env_name_app_host () , "127.0.0.1" ),
6364 "mwapikey" : str (uuid .uuid4 ()),
6465 "matlab_protocol" : "http" ,
6566 "matlab_display" : ":1" ,
66- "nlm_conn_str" : os .environ .get ("MLM_LICENSE_FILE" ),
67+ "nlm_conn_str" : os .environ .get (mw_env . get_env_name_network_license_manager () ),
6768 "matlab_config_file" : matlab_temp_dir / "proxy_app_config.json" ,
6869 "ws_env" : ws_env ,
6970 "mwa_api_endpoint" : f"https://login{ ws_env_suffix } .mathworks.com/authenticationws/service/v4" ,
@@ -89,7 +90,7 @@ def get(dev=False):
8990
9091 # If running tests using Pytest, it will set environment variable TEST to true before running tests.
9192 # Will make test env specific changes before returning the settings.
92- if os . environ . get ( "TEST" , "False" ). lower () == "true" :
93+ if mw_env . is_testing_mode_enabled () :
9394
9495 # Set ready_delay value to 0 for faster fake MATLAB startup.
9596 ready_delay = ["--ready-delay" , "0" ]
@@ -127,13 +128,13 @@ def get(dev=False):
127128 ],
128129 "create_xvfb_cmd" : create_xvfb_cmd ,
129130 "matlab_ready_file" : Path (tempfile .gettempdir ()) / "connector.securePort" ,
130- "base_url" : os .environ ["BASE_URL" ],
131- "app_port" : os .environ ["APP_PORT" ],
132- "host_interface" : os .environ .get ("APP_HOST" ),
131+ "base_url" : os .environ [mw_env . get_env_name_base_url () ],
132+ "app_port" : os .environ [mw_env . get_env_name_app_port () ],
133+ "host_interface" : os .environ .get (mw_env . get_env_name_app_host () ),
133134 "mwapikey" : str (uuid .uuid4 ()),
134135 "matlab_protocol" : "https" ,
135136 "nlm_conn_str" : validators .validate_mlm_license_file (
136- os .environ .get ("MLM_LICENSE_FILE" )
137+ os .environ .get (mw_env . get_env_name_network_license_manager () )
137138 ),
138139 "matlab_config_file" : Path .home () / ".matlab" / "proxy_app_config.json" ,
139140 "ws_env" : ws_env ,
0 commit comments