-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for TMPDIR and Update to v0.3.2
- Loading branch information
1 parent
1bee67b
commit 789bbdd
Showing
10 changed files
with
120 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2020-2021 The MathWorks, Inc. | ||
"""Functions to related to embedded connector access and configuration""" | ||
|
||
from jupyter_matlab_proxy import mwi_environment_variables as mwi_env | ||
from jupyter_matlab_proxy import settings as mwi_settings | ||
from pathlib import Path | ||
|
||
# TODO Write tests | ||
|
||
|
||
def get_matlab_ready_file(connector_port): | ||
"""Returns the name and location of the file that is used by MATLAB | ||
embedded connector to signal its readiness to begin serving content""" | ||
ready_file_dir = __create_folder_to_hold_matlab_ready_file(connector_port) | ||
ready_file = ready_file_dir / "connector.securePort" | ||
return ready_file, ready_file_dir | ||
|
||
|
||
def __create_folder_to_hold_matlab_ready_file(connector_port): | ||
"""MWI creates the location into which the spawned MATLAB connector can create the ready file""" | ||
|
||
if mwi_env.is_development_mode_enabled(): | ||
return mwi_settings.get_test_temp_dir() | ||
|
||
matlab_tempdir = Path(mwi_settings.get_matlab_tempdir()) | ||
matlab_ready_file_dir = matlab_tempdir / "MWI" / str(connector_port) | ||
matlab_ready_file_dir.mkdir(parents=True, exist_ok=True) | ||
return matlab_ready_file_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.