matlab-proxy 0.5.3__py3-none-any.whl → 0.30.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matlab_proxy/app.py +578 -205
- matlab_proxy/app_state.py +1061 -431
- matlab_proxy/constants.py +37 -0
- matlab_proxy/default_configuration.py +39 -4
- matlab_proxy/devel.py +18 -22
- matlab_proxy/gui/index.html +20 -1
- matlab_proxy/gui/static/css/index.BedVwcEg.css +10 -0
- matlab_proxy/gui/static/js/index.pQwV1obF.js +64 -0
- matlab_proxy/gui/static/media/MATLAB-env-blur.NupTbPv_.png +0 -0
- matlab_proxy/matlab/evaluateUserMatlabCode.m +51 -0
- matlab_proxy/matlab/startup.m +3 -28
- matlab_proxy/settings.py +543 -112
- matlab_proxy/util/__init__.py +187 -59
- matlab_proxy/util/cookie_jar.py +72 -0
- matlab_proxy/util/event_loop.py +28 -10
- matlab_proxy/util/list_servers.py +71 -26
- matlab_proxy/util/mw.py +16 -15
- matlab_proxy/util/mwi/download.py +136 -0
- matlab_proxy/util/mwi/embedded_connector/__init__.py +1 -1
- matlab_proxy/util/mwi/embedded_connector/helpers.py +12 -4
- matlab_proxy/util/mwi/embedded_connector/request.py +78 -12
- matlab_proxy/util/mwi/environment_variables.py +120 -27
- matlab_proxy/util/mwi/exceptions.py +63 -9
- matlab_proxy/util/mwi/logger.py +141 -27
- matlab_proxy/util/mwi/session_name.py +28 -0
- matlab_proxy/util/mwi/token_auth.py +264 -121
- matlab_proxy/util/mwi/validators.py +231 -88
- matlab_proxy/util/system.py +9 -0
- matlab_proxy/util/windows.py +32 -6
- {matlab_proxy-0.5.3.dist-info → matlab_proxy-0.30.1.dist-info}/METADATA +94 -49
- matlab_proxy-0.30.1.dist-info/RECORD +88 -0
- {matlab_proxy-0.5.3.dist-info → matlab_proxy-0.30.1.dist-info}/WHEEL +1 -2
- {matlab_proxy-0.5.3.dist-info → matlab_proxy-0.30.1.dist-info}/entry_points.txt +1 -1
- matlab_proxy_manager/README.md +85 -0
- matlab_proxy_manager/__init__.py +6 -0
- matlab_proxy_manager/lib/README.md +53 -0
- matlab_proxy_manager/lib/__init__.py +1 -0
- matlab_proxy_manager/lib/api.py +419 -0
- matlab_proxy_manager/storage/README.md +54 -0
- matlab_proxy_manager/storage/__init__.py +1 -0
- matlab_proxy_manager/storage/file_repository.py +144 -0
- matlab_proxy_manager/storage/interface.py +62 -0
- matlab_proxy_manager/storage/server.py +172 -0
- matlab_proxy_manager/utils/__init__.py +1 -0
- matlab_proxy_manager/utils/auth.py +77 -0
- matlab_proxy_manager/utils/constants.py +8 -0
- matlab_proxy_manager/utils/decorators.py +37 -0
- matlab_proxy_manager/utils/environment_variables.py +51 -0
- matlab_proxy_manager/utils/exceptions.py +45 -0
- matlab_proxy_manager/utils/helpers.py +314 -0
- matlab_proxy_manager/utils/logger.py +76 -0
- matlab_proxy_manager/web/README.md +37 -0
- matlab_proxy_manager/web/__init__.py +1 -0
- matlab_proxy_manager/web/app.py +536 -0
- matlab_proxy_manager/web/monitor.py +45 -0
- matlab_proxy_manager/web/watcher.py +65 -0
- matlab_proxy/gui/asset-manifest.json +0 -23
- matlab_proxy/gui/authorization.html +0 -115
- matlab_proxy/gui/bootstrap.3.4.1.min.css +0 -6
- matlab_proxy/gui/navbar.css +0 -8
- matlab_proxy/gui/signin.css +0 -42
- matlab_proxy/gui/static/css/main.d890078a.chunk.css +0 -13
- matlab_proxy/gui/static/css/main.d890078a.chunk.css.map +0 -1
- matlab_proxy/gui/static/js/2.13be6544.chunk.js +0 -3
- matlab_proxy/gui/static/js/2.13be6544.chunk.js.LICENSE.txt +0 -59
- matlab_proxy/gui/static/js/2.13be6544.chunk.js.map +0 -1
- matlab_proxy/gui/static/js/main.c311d854.chunk.js +0 -2
- matlab_proxy/gui/static/js/main.c311d854.chunk.js.map +0 -1
- matlab_proxy/gui/static/js/runtime-main.f70e4d5f.js +0 -2
- matlab_proxy/gui/static/js/runtime-main.f70e4d5f.js.map +0 -1
- matlab_proxy/gui/static/media/arrow.0c2968b9.svg +0 -4
- matlab_proxy/gui/static/media/feedback.6e8d50eb.svg +0 -1
- matlab_proxy/gui/static/media/gripper.9defbc5e.svg +0 -1
- matlab_proxy/gui/static/media/help.15e5bfab.svg +0 -1
- matlab_proxy/gui/static/media/ico-header-contact-hover.0958c442.svg +0 -17
- matlab_proxy/gui/static/media/ico-header-contact.ae9169c8.svg +0 -17
- matlab_proxy/gui/static/media/restart.7987508a.svg +0 -1
- matlab_proxy/gui/static/media/sign-out.08356b67.svg +0 -1
- matlab_proxy/gui/static/media/start.50c4596f.svg +0 -1
- matlab_proxy/gui/static/media/stop.30c9a9ab.svg +0 -1
- matlab_proxy/gui/static/media/terminate.7ea1363e.svg +0 -1
- matlab_proxy/gui/token.html +0 -123
- matlab_proxy-0.5.3.dist-info/RECORD +0 -84
- matlab_proxy-0.5.3.dist-info/top_level.txt +0 -1
- /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.82b1212e.woff → glyphicons-halflings-regular.BKjkU69z.woff} +0 -0
- /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.5be1347c.eot → glyphicons-halflings-regular.BUJKDMgK.eot} +0 -0
- /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.060b2710.svg → glyphicons-halflings-regular.CSehLiBc.svg} +0 -0
- /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.4692b9ec.ttf → glyphicons-halflings-regular.DrwTMapi.ttf} +0 -0
- /matlab_proxy/gui/static/media/{glyphicons-halflings-regular.be810be3.woff2 → glyphicons-halflings-regular.DzqM6ju8.woff2} +0 -0
- /matlab_proxy/gui/static/media/{ico-header-account-hover.89438e91.svg → ico-header-account-hover.-jQHo6Wx.svg} +0 -0
- /matlab_proxy/gui/static/media/{ico-header-account.86b10d7b.svg → ico-header-account.CJCFoo5a.svg} +0 -0
- /matlab_proxy/gui/static/media/{ico-sprite.cbdb66c0.png → ico-sprite.DXGLgzq9.png} +0 -0
- /matlab_proxy/gui/static/media/{mathworks-eps.4d20e0ee.ttf → mathworks-eps.CGNQALa9.ttf} +0 -0
- /matlab_proxy/gui/static/media/{mathworks-eps.df1428df.svg → mathworks-eps.DrkCtQtG.svg} +0 -0
- /matlab_proxy/gui/static/media/{mathworks-eps.e5c41e84.woff → mathworks-eps.Ds7lQbql.woff} +0 -0
- /matlab_proxy/gui/static/media/{mathworks-pictograms.3fc6513a.woff → mathworks-pictograms.BdqxEfBR.woff} +0 -0
- /matlab_proxy/gui/static/media/{mathworks-pictograms.f6f087b0.svg → mathworks-pictograms.CCLweoD4.svg} +0 -0
- /matlab_proxy/gui/static/media/{mathworks-pictograms.6e128c0e.ttf → mathworks-pictograms.DZhFdRSm.ttf} +0 -0
- /matlab_proxy/gui/static/media/{mathworks.80a3218e.svg → mathworks.C-qsbhDy.svg} +0 -0
- /matlab_proxy/gui/static/media/{mathworks.c422935b.ttf → mathworks.Ceplx86V.ttf} +0 -0
- /matlab_proxy/gui/static/media/{mathworks.37a563ef.woff → mathworks.D08X1Vp8.woff} +0 -0
- /matlab_proxy/gui/static/media/{trigger-error.3f1c4ef2.svg → trigger-error.QEdsGL-m.svg} +0 -0
- /matlab_proxy/gui/static/media/{trigger-ok.7b9c238b.svg → trigger-ok.Dzg8OIrk.svg} +0 -0
- {matlab_proxy-0.5.3.dist-info → matlab_proxy-0.30.1.dist-info/licenses}/LICENSE.md +0 -0
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
% Copyright 2024 The MathWorks, Inc.
|
|
2
|
+
|
|
3
|
+
% Note:
|
|
4
|
+
% Any extra variable we are creating begins with `mwiInternal` to prevent
|
|
5
|
+
% potential conflicts with variables created by user code evaluated using evalc.
|
|
6
|
+
% Since evalc("user code") is executed in the base workspace, it might create
|
|
7
|
+
% variables that could overwrite our internal variables. To avoid polluting the
|
|
8
|
+
% user's workspace when MATLAB starts, we ensure to clear any internal variable
|
|
9
|
+
% that we create in the base workspace. We do not need to be concerned about
|
|
10
|
+
% variables in the function's workspace.
|
|
11
|
+
|
|
12
|
+
if ~isempty(getenv('MWI_MATLAB_STARTUP_SCRIPT')) && ~all(isspace(getenv('MWI_MATLAB_STARTUP_SCRIPT')))
|
|
13
|
+
try
|
|
14
|
+
% Evaluate the code from the environment variable and capture the output
|
|
15
|
+
mwiInternalResults = evalc(getenv('MWI_MATLAB_STARTUP_SCRIPT'));
|
|
16
|
+
% Write the results to the file
|
|
17
|
+
logOutputOrError(mwiInternalResults);
|
|
18
|
+
clear mwiInternalResults;
|
|
19
|
+
catch mwiInternalException
|
|
20
|
+
% Log the error message to the file
|
|
21
|
+
logOutputOrError(" ", mwiInternalException);
|
|
22
|
+
clear mwiInternalResults mwiInternalException;
|
|
23
|
+
error("Unable to run the startup code you specified. For details of the error, see the output file at " + fullfile(getenv('MATLAB_LOG_DIR'), "startup_code_output.txt"));
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
function logOutputOrError(userCodeResults, mwiInternalException)
|
|
29
|
+
% Logs the results of the user code execution if successful, otherwise logs the
|
|
30
|
+
% error information. It then closes the file handle.
|
|
31
|
+
%
|
|
32
|
+
% Inputs:
|
|
33
|
+
% userCodeResults - String containing the output from the user code.
|
|
34
|
+
% mwiInternalException - (Optional) MException object containing error details.
|
|
35
|
+
filePath = fullfile(getenv('MATLAB_LOG_DIR'), "startup_code_output.txt");
|
|
36
|
+
[fileHandle, ~] = fopen(filePath, 'w');
|
|
37
|
+
if nargin < 2
|
|
38
|
+
% Log the successful output of the user code
|
|
39
|
+
fprintf(fileHandle, " ");
|
|
40
|
+
fprintf(fileHandle, userCodeResults);
|
|
41
|
+
else
|
|
42
|
+
% Log the error information
|
|
43
|
+
fprintf(fileHandle, 'An error occurred in the following code:\n');
|
|
44
|
+
fprintf(fileHandle, getenv('MWI_MATLAB_STARTUP_SCRIPT'));
|
|
45
|
+
fprintf(fileHandle, '\n\nMessage: %s\n', mwiInternalException.message);
|
|
46
|
+
fprintf(fileHandle, '\nError Identifier: %s\n', mwiInternalException.identifier);
|
|
47
|
+
end
|
|
48
|
+
% Close the file handle
|
|
49
|
+
fclose(fileHandle);
|
|
50
|
+
end
|
|
51
|
+
|
matlab_proxy/matlab/startup.m
CHANGED
|
@@ -1,39 +1,14 @@
|
|
|
1
|
-
% Copyright
|
|
1
|
+
% Copyright 2020-2025 The MathWorks, Inc.
|
|
2
2
|
|
|
3
|
-
% Ensures figures are docked
|
|
4
|
-
set(0,'DefaultFigureWindowStyle','docked')
|
|
5
|
-
|
|
6
|
-
% Configure logged in user if possible
|
|
7
|
-
if ~isempty(getenv('MW_LOGIN_USER_ID'))
|
|
8
|
-
user_id = getenv('MW_LOGIN_USER_ID');
|
|
9
|
-
first_name = getenv('MW_LOGIN_FIRST_NAME');
|
|
10
|
-
last_name = getenv('MW_LOGIN_LAST_NAME');
|
|
11
|
-
email_address = getenv('MW_LOGIN_EMAIL_ADDRESS');
|
|
12
|
-
profile_id = getenv('MW_LOGIN_PROFILE_ID');
|
|
13
|
-
display_name = getenv('MW_LOGIN_DISPLAY_NAME');
|
|
14
|
-
|
|
15
|
-
li = com.mathworks.matlab_login.MatlabLogin.isUserLoggedIn(2, 'DESKTOP');
|
|
16
|
-
token = li.getToken();
|
|
17
|
-
login_level = 2;
|
|
18
|
-
remember_me = true;
|
|
19
|
-
li = com.mathworks.matlab_login.MatlabLogin.saveCacheLoginInfo(first_name, ...
|
|
20
|
-
last_name, email_address, user_id, token, profile_id, login_level, ...
|
|
21
|
-
remember_me, email_address, display_name);
|
|
22
|
-
% Clear all local variables from users workspace.
|
|
23
|
-
clear li login_level user_id first_name last_name email_address profile_id display_name token remember_me
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
if (strlength(getenv('MWI_BASE_URL')) > 0)
|
|
27
|
-
connector.internal.setConfig('contextRoot', getenv('MWI_BASE_URL'));
|
|
28
|
-
end
|
|
29
3
|
evalc('connector.internal.Worker.start');
|
|
30
4
|
|
|
31
5
|
% Add-on explorer is not supported in this environment.
|
|
32
6
|
% The following settings instructs it to display appropriate error messages when used.
|
|
33
7
|
matlab_settings = settings;
|
|
34
8
|
if ~matlab_settings.matlab.addons.explorer.hasSetting('isExplorerSupported')
|
|
35
|
-
matlab_settings.matlab.addons.explorer.addSetting('isExplorerSupported');
|
|
9
|
+
matlab_settings.matlab.addons.explorer.addSetting('isExplorerSupported', 'PersonalValue', true);
|
|
36
10
|
end
|
|
37
11
|
matlab_settings.matlab.addons.explorer.isExplorerSupported.TemporaryValue = false;
|
|
38
12
|
|
|
39
13
|
clear
|
|
14
|
+
clc
|