matlab-proxy 0.17.0__tar.gz → 0.18.0__tar.gz
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.
Potentially problematic release.
This version of matlab-proxy might be problematic. Click here for more details.
- {matlab-proxy-0.17.0/matlab_proxy.egg-info → matlab-proxy-0.18.0}/PKG-INFO +1 -1
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/app.py +7 -7
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/app_state.py +27 -4
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/constants.py +1 -0
- matlab-proxy-0.18.0/matlab_proxy/matlab/evaluateUserMatlabCode.m +51 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/matlab/startup.m +2 -2
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/settings.py +18 -2
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/__init__.py +16 -7
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/environment_variables.py +5 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/validators.py +13 -11
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/windows.py +6 -2
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0/matlab_proxy.egg-info}/PKG-INFO +1 -1
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy.egg-info/SOURCES.txt +1 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy.egg-info/requires.txt +3 -1
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/setup.py +8 -2
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_app_state.py +34 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_settings.py +35 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/test_util.py +4 -1
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/LICENSE.md +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/MANIFEST.in +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/README.md +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/.eslintrc.json +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/.gitignore +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/README.md +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/package-lock.json +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/package.json +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/public/favicon.ico +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/public/index.html +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/public/manifest.json +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/public/robots.txt +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/actionCreators/actionCreators.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/actionCreators/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/actions/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/css/bootstrap.min.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/css/site7.min.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.eot +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.ttf +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff2 +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-eps.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-eps.ttf +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-eps.woff +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-pictograms.woff +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks.ttf +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks.woff +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/images/bug_reports/workaround.gif +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/images/responsive/global/ico-header-account-hover.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/images/responsive/global/ico-header-account.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/images/responsive/global/ico-header-contact-hover.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/images/responsive/global/ico-header-contact.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/images/responsive/global/ico-sprite.png +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/App.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/App.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/MATLAB-env-blur.png +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Confirmation/Confirmation.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Confirmation/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/Controls.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/Controls.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/feedback.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/help.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/restart.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/sign-out.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/start.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/stop.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Controls/terminate.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/EntitlementSelector/EntitlementSelector.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/EntitlementSelector/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Error/Error.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Error/Error.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Error/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Help/Help.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Help/Help.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Help/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Information/Information.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Information/Information.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Information/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/ExistingLicense.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/ExistingLicense.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/LicenseGatherer.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/LicensingGatherer.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/MHLM.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/NLM.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/MatlabJsd/MatlabJsd.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/MatlabJsd/MatlabJsd.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/MatlabJsd/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Overlay/Overlay.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Overlay/Overlay.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Overlay/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/OverlayTrigger.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/ResizeOverlayTrigger.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/arrow.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/gripper.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/trigger-error.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/trigger-ok.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/constants.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/index.css +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/jest.config.json +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/logo.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/reducers/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/reducers/reducers.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/selectors/index.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/selectors/selectors.spec.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/serviceWorker.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/setupTests.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/test/utils/react-test.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/test/utils/state.js +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/default_configuration.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/devel.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/icons/matlab.svg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/event_loop.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/list_servers.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mw.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/custom_http_headers.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/download.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/embedded_connector/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/embedded_connector/helpers.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/embedded_connector/request.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/exceptions.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/logger.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/token_auth.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/system.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy.egg-info/dependency_links.txt +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy.egg-info/entry_points.txt +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy.egg-info/not-zip-safe +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy.egg-info/top_level.txt +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/setup.cfg +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/integration_tests_with_license/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/integration_tests_with_license/conftest.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/integration_tests_with_license/test_http_end_points.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/integration_tests_without_license/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/integration_tests_without_license/conftest.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/utils/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/utils/integration_tests_utils.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/utils/licensing.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/conftest.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_app.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_constants.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_ddux.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_devel.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/test_non_dev_mode.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/embedded_connector/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/embedded_connector/test_helpers.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/embedded_connector/test_request.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/test_custom_http_headers.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/test_logger.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/test_token_auth.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/test_validators.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/test_mw.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/utils/__init__.py +0 -0
- {matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/utils/logging_util.py +0 -0
|
@@ -16,12 +16,11 @@ from cryptography import fernet
|
|
|
16
16
|
import matlab_proxy
|
|
17
17
|
from matlab_proxy import constants, settings, util
|
|
18
18
|
from matlab_proxy.app_state import AppState
|
|
19
|
+
from matlab_proxy.constants import IS_CONCURRENCY_CHECK_ENABLED
|
|
19
20
|
from matlab_proxy.util import mwi
|
|
21
|
+
from matlab_proxy.util.mwi import download, token_auth
|
|
20
22
|
from matlab_proxy.util.mwi import environment_variables as mwi_env
|
|
21
|
-
from matlab_proxy.util.mwi import token_auth, download
|
|
22
23
|
from matlab_proxy.util.mwi.exceptions import AppError, InvalidTokenError, LicensingError
|
|
23
|
-
from matlab_proxy.constants import IS_CONCURRENCY_CHECK_ENABLED
|
|
24
|
-
|
|
25
24
|
|
|
26
25
|
mimetypes.add_type("font/woff", ".woff")
|
|
27
26
|
mimetypes.add_type("font/woff2", ".woff2")
|
|
@@ -422,7 +421,7 @@ async def termination_integration_delete(req):
|
|
|
422
421
|
await req.app.cleanup()
|
|
423
422
|
"""When testing with pytest, its not possible to catch sys.exit(0) using the construct
|
|
424
423
|
'with pytest.raises()', there by causing the test : test_termination_integration_delete()
|
|
425
|
-
to fail.
|
|
424
|
+
to fail. In order to avoid this, adding the below if condition to check to skip sys.exit(0) when testing
|
|
426
425
|
"""
|
|
427
426
|
logger.debug("Exiting with return code 0")
|
|
428
427
|
if not mwi_env.is_testing_mode_enabled():
|
|
@@ -475,7 +474,7 @@ def make_static_route_table(app):
|
|
|
475
474
|
Returns:
|
|
476
475
|
Dict: Containing information about the static files and header information.
|
|
477
476
|
"""
|
|
478
|
-
|
|
477
|
+
import importlib_resources
|
|
479
478
|
|
|
480
479
|
from matlab_proxy import gui
|
|
481
480
|
from matlab_proxy.gui import static
|
|
@@ -492,8 +491,9 @@ def make_static_route_table(app):
|
|
|
492
491
|
(gui.static.js.__name__, "/static/js"),
|
|
493
492
|
(gui.static.media.__name__, "/static/media"),
|
|
494
493
|
]:
|
|
495
|
-
for
|
|
496
|
-
|
|
494
|
+
for entry in importlib_resources.files(mod).iterdir():
|
|
495
|
+
name = entry.name
|
|
496
|
+
if not importlib_resources.files(mod).joinpath(name).is_dir():
|
|
497
497
|
if name != "__init__.py":
|
|
498
498
|
# Special case for manifest.json
|
|
499
499
|
if "manifest.json" in name:
|
|
@@ -16,10 +16,11 @@ from matlab_proxy.constants import (
|
|
|
16
16
|
CONNECTOR_SECUREPORT_FILENAME,
|
|
17
17
|
MATLAB_LOGS_FILE_NAME,
|
|
18
18
|
IS_CONCURRENCY_CHECK_ENABLED,
|
|
19
|
+
USER_CODE_OUTPUT_FILE_NAME,
|
|
19
20
|
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
|
|
22
|
+
from matlab_proxy.settings import get_process_startup_timeout
|
|
23
|
+
|
|
23
24
|
from matlab_proxy.util import mw, mwi, system, windows
|
|
24
25
|
from matlab_proxy.util.mwi import environment_variables as mwi_env
|
|
25
26
|
from matlab_proxy.util.mwi import token_auth
|
|
@@ -594,6 +595,24 @@ class AppState:
|
|
|
594
595
|
self.matlab_session_files["matlab_ready_file"] = matlab_ready_file
|
|
595
596
|
|
|
596
597
|
logger.debug(f"matlab_session_files:{self.matlab_session_files}")
|
|
598
|
+
|
|
599
|
+
# check if the user has provided any code or not
|
|
600
|
+
if self.settings.get("has_custom_code_to_execute"):
|
|
601
|
+
# Keep a reference to the user code output file in the matlab_session_files for cleanup
|
|
602
|
+
user_code_output_file = mwi_logs_dir / USER_CODE_OUTPUT_FILE_NAME
|
|
603
|
+
self.matlab_session_files["startup_code_output_file"] = (
|
|
604
|
+
user_code_output_file
|
|
605
|
+
)
|
|
606
|
+
logger.info(
|
|
607
|
+
util.prettify(
|
|
608
|
+
boundary_filler="*",
|
|
609
|
+
text_arr=[
|
|
610
|
+
f"When MATLAB starts, you can see the output for your startup code at:",
|
|
611
|
+
f"{self.matlab_session_files.get('startup_code_output_file', ' ')}",
|
|
612
|
+
],
|
|
613
|
+
)
|
|
614
|
+
)
|
|
615
|
+
|
|
597
616
|
return
|
|
598
617
|
|
|
599
618
|
def create_server_info_file(self):
|
|
@@ -846,6 +865,10 @@ class AppState:
|
|
|
846
865
|
|
|
847
866
|
return matlab
|
|
848
867
|
|
|
868
|
+
except UIVisibleFatalError as e:
|
|
869
|
+
self.error = e
|
|
870
|
+
log_error(logger, e)
|
|
871
|
+
|
|
849
872
|
except Exception as err:
|
|
850
873
|
self.error = err
|
|
851
874
|
log_error(logger, err)
|
|
@@ -972,7 +995,7 @@ class AppState:
|
|
|
972
995
|
)
|
|
973
996
|
await self.stop_matlab(force_quit=True)
|
|
974
997
|
self.error = MatlabError(
|
|
975
|
-
"
|
|
998
|
+
"MATLAB startup has timed out. Click Start MATLAB to try again."
|
|
976
999
|
)
|
|
977
1000
|
|
|
978
1001
|
async def __read_matlab_ready_file(self, delay):
|
|
@@ -7,6 +7,7 @@ CONNECTOR_SECUREPORT_FILENAME: Final[str] = "connector.securePort"
|
|
|
7
7
|
VERSION_INFO_FILE_NAME: Final[str] = "VersionInfo.xml"
|
|
8
8
|
MAX_HTTP_REQUEST_SIZE: Final[int] = 500_000_000 # 500MB
|
|
9
9
|
MATLAB_LOGS_FILE_NAME: Final[str] = "matlab_logs.txt"
|
|
10
|
+
USER_CODE_OUTPUT_FILE_NAME: Final[str] = "startup_code_output.txt"
|
|
10
11
|
|
|
11
12
|
# Max startup duration in seconds for processes launched by matlab-proxy
|
|
12
13
|
# This constant is meant for internal use within matlab-proxy
|
|
@@ -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
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% Copyright
|
|
1
|
+
% Copyright 2020-2024 The MathWorks, Inc.
|
|
2
2
|
|
|
3
3
|
% Configure logged in user if possible
|
|
4
4
|
if ~isempty(getenv('MW_LOGIN_USER_ID'))
|
|
@@ -34,4 +34,4 @@ end
|
|
|
34
34
|
matlab_settings.matlab.addons.explorer.isExplorerSupported.TemporaryValue = false;
|
|
35
35
|
|
|
36
36
|
clear
|
|
37
|
-
clc
|
|
37
|
+
clc
|
|
@@ -366,7 +366,10 @@ def get_matlab_settings():
|
|
|
366
366
|
flag_to_hide_desktop = ["-nodesktop"]
|
|
367
367
|
if system.is_windows():
|
|
368
368
|
flag_to_hide_desktop.extend(["-noDisplayDesktop", "-wait", "-log"])
|
|
369
|
-
|
|
369
|
+
|
|
370
|
+
matlab_code_dir = Path(__file__).resolve().parent / "matlab"
|
|
371
|
+
matlab_startup_file = str(matlab_code_dir / "startup.m")
|
|
372
|
+
matlab_code_file = str(matlab_code_dir / "evaluateUserMatlabCode.m")
|
|
370
373
|
|
|
371
374
|
matlab_version = get_matlab_version(matlab_root_path)
|
|
372
375
|
|
|
@@ -388,6 +391,18 @@ def get_matlab_settings():
|
|
|
388
391
|
profile_matlab_startup = (
|
|
389
392
|
"-timing" if mwi_env.Experimental.is_matlab_startup_profiling_enabled() else ""
|
|
390
393
|
)
|
|
394
|
+
|
|
395
|
+
has_custom_code_to_execute = (
|
|
396
|
+
len(os.getenv(mwi_env.get_env_name_custom_matlab_code(), "").strip()) > 0
|
|
397
|
+
)
|
|
398
|
+
mp_code_to_execute = f"try; run('{matlab_startup_file}'); catch MATLABProxyInitializationError; disp(MATLABProxyInitializationError.message); end;"
|
|
399
|
+
custom_code_to_execute = f"try; run('{matlab_code_file}'); catch MATLABCustomStartupCodeError; disp(MATLABCustomStartupCodeError.message); end;"
|
|
400
|
+
code_to_execute = (
|
|
401
|
+
mp_code_to_execute + custom_code_to_execute
|
|
402
|
+
if has_custom_code_to_execute
|
|
403
|
+
else mp_code_to_execute
|
|
404
|
+
)
|
|
405
|
+
|
|
391
406
|
return {
|
|
392
407
|
"matlab_path": matlab_root_path,
|
|
393
408
|
"matlab_version": matlab_version,
|
|
@@ -402,13 +417,14 @@ def get_matlab_settings():
|
|
|
402
417
|
*mpa_flags,
|
|
403
418
|
profile_matlab_startup,
|
|
404
419
|
"-r",
|
|
405
|
-
|
|
420
|
+
code_to_execute,
|
|
406
421
|
],
|
|
407
422
|
"ws_env": ws_env,
|
|
408
423
|
"mwa_api_endpoint": f"https://login{ws_env_suffix}.mathworks.com/authenticationws/service/v4",
|
|
409
424
|
"mhlm_api_endpoint": f"https://licensing{ws_env_suffix}.mathworks.com/mls/service/v1/entitlement/list",
|
|
410
425
|
"mwa_login": f"https://login{ws_env_suffix}.mathworks.com",
|
|
411
426
|
"nlm_conn_str": nlm_conn_str,
|
|
427
|
+
"has_custom_code_to_execute": has_custom_code_to_execute,
|
|
412
428
|
}
|
|
413
429
|
|
|
414
430
|
|
|
@@ -11,6 +11,9 @@ import matlab_proxy
|
|
|
11
11
|
from matlab_proxy.util import mwi, system
|
|
12
12
|
from matlab_proxy.util.event_loop import *
|
|
13
13
|
from matlab_proxy.util.mwi import environment_variables as mwi_env
|
|
14
|
+
from matlab_proxy.util.mwi.exceptions import (
|
|
15
|
+
UIVisibleFatalError,
|
|
16
|
+
)
|
|
14
17
|
|
|
15
18
|
logger = mwi.logger.get()
|
|
16
19
|
|
|
@@ -181,7 +184,7 @@ def prettify(boundary_filler=" ", text_arr=[]):
|
|
|
181
184
|
return result
|
|
182
185
|
|
|
183
186
|
|
|
184
|
-
def get_child_processes(parent_process):
|
|
187
|
+
def get_child_processes(parent_process, max_attempts=10, sleep_interval=1):
|
|
185
188
|
"""Get list of child processes from a parent process.
|
|
186
189
|
|
|
187
190
|
Args:
|
|
@@ -199,7 +202,6 @@ def get_child_processes(parent_process):
|
|
|
199
202
|
# to get hold child processes
|
|
200
203
|
parent_process_psutil = psutil.Process(parent_process.pid)
|
|
201
204
|
|
|
202
|
-
max_attempts = 10
|
|
203
205
|
child_processes = None
|
|
204
206
|
for _ in range(max_attempts):
|
|
205
207
|
try:
|
|
@@ -212,17 +214,24 @@ def get_child_processes(parent_process):
|
|
|
212
214
|
|
|
213
215
|
if not child_processes:
|
|
214
216
|
logger.debug("Waiting for the child processes to be created...")
|
|
217
|
+
time.sleep(sleep_interval)
|
|
215
218
|
continue
|
|
216
219
|
|
|
220
|
+
else:
|
|
221
|
+
logger.debug(f"Found the child process: {child_processes[0]}")
|
|
222
|
+
break
|
|
223
|
+
|
|
217
224
|
except AssertionError as err:
|
|
218
225
|
raise err
|
|
219
226
|
|
|
220
|
-
if child_processes:
|
|
221
|
-
break
|
|
222
|
-
time.sleep(0.1)
|
|
223
|
-
|
|
224
227
|
if not child_processes:
|
|
225
|
-
|
|
228
|
+
logger.debug(
|
|
229
|
+
f"MATLAB process was not found while searching for the child processes."
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
raise UIVisibleFatalError(
|
|
233
|
+
"Unable to create MATLAB process. Click Start MATLAB to try again."
|
|
234
|
+
)
|
|
226
235
|
|
|
227
236
|
return child_processes
|
|
228
237
|
|
|
@@ -162,6 +162,11 @@ def get_env_name_process_startup_timeout():
|
|
|
162
162
|
return "MWI_PROCESS_START_TIMEOUT"
|
|
163
163
|
|
|
164
164
|
|
|
165
|
+
def get_env_name_custom_matlab_code():
|
|
166
|
+
"""User specified MATLAB code that will be executed by matlab-proxy upon its start"""
|
|
167
|
+
return "MWI_MATLAB_STARTUP_SCRIPT"
|
|
168
|
+
|
|
169
|
+
|
|
165
170
|
class Experimental:
|
|
166
171
|
"""This class houses functions which are undocumented APIs and Environment variables.
|
|
167
172
|
Note: Never add any state to this class. Its only intended for use as an abstraction layer
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
# Copyright 2020-2024 The MathWorks, Inc.
|
|
2
2
|
"""This file contains validators for various runtime artifacts.
|
|
3
|
-
A validator is defined as a function which verifies the input and
|
|
4
|
-
returns it unchanged if validation passes.
|
|
3
|
+
A validator is defined as a function which verifies the input and
|
|
4
|
+
returns it unchanged if validation passes.
|
|
5
5
|
Returning inputs allows validators to be used inline with the input.
|
|
6
6
|
|
|
7
|
-
Example:
|
|
7
|
+
Example:
|
|
8
8
|
Original code: if( input ):
|
|
9
9
|
With validator: if (valid(input)):
|
|
10
10
|
|
|
11
11
|
Exceptions are thrown to signal failure.
|
|
12
12
|
"""
|
|
13
|
+
|
|
13
14
|
import errno
|
|
14
15
|
import os
|
|
15
|
-
from pathlib import Path
|
|
16
|
-
import pkg_resources
|
|
17
16
|
import socket
|
|
17
|
+
from pathlib import Path
|
|
18
18
|
from typing import List
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
import matlab_proxy
|
|
22
21
|
from matlab_proxy import util
|
|
23
|
-
from matlab_proxy.util import system
|
|
24
22
|
from matlab_proxy.constants import VERSION_INFO_FILE_NAME
|
|
23
|
+
from matlab_proxy.util import system
|
|
25
24
|
|
|
26
25
|
from . import environment_variables as mwi_env
|
|
27
26
|
from . import logger as mwi_logger
|
|
28
|
-
from .exceptions import
|
|
27
|
+
from .exceptions import FatalError, MatlabInstallError
|
|
29
28
|
|
|
30
29
|
logger = mwi_logger.get()
|
|
31
30
|
|
|
@@ -213,10 +212,13 @@ def __get_configs():
|
|
|
213
212
|
Dict: Contains all the values present in 'matlab_web_desktop_configs' entry_point from all the packages
|
|
214
213
|
installed in the current environment.
|
|
215
214
|
"""
|
|
215
|
+
import importlib_metadata
|
|
216
|
+
|
|
217
|
+
matlab_proxy_eps = importlib_metadata.entry_points(
|
|
218
|
+
group=matlab_proxy.get_entrypoint_name()
|
|
219
|
+
)
|
|
216
220
|
configs = {}
|
|
217
|
-
for entry_point in
|
|
218
|
-
matlab_proxy.get_entrypoint_name()
|
|
219
|
-
):
|
|
221
|
+
for entry_point in matlab_proxy_eps:
|
|
220
222
|
configs[entry_point.name.lower()] = entry_point.load()
|
|
221
223
|
|
|
222
224
|
return configs
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
# Copyright 2022-
|
|
1
|
+
# Copyright 2022-2024 The MathWorks, Inc.
|
|
2
2
|
import asyncio
|
|
3
3
|
|
|
4
4
|
from matlab_proxy import util
|
|
5
5
|
from matlab_proxy.util import mwi
|
|
6
6
|
from matlab_proxy.util.mwi import environment_variables as mwi_env
|
|
7
|
+
from matlab_proxy.util.mwi.exceptions import (
|
|
8
|
+
UIVisibleFatalError,
|
|
9
|
+
)
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
""" This file contains methods specific to non-posix / windows OS.
|
|
@@ -77,8 +80,9 @@ async def start_matlab(matlab_cmd, matlab_env):
|
|
|
77
80
|
"MATLAB.exe" == matlab.name()
|
|
78
81
|
), "Expecting the child process name to be MATLAB.exe"
|
|
79
82
|
|
|
80
|
-
except AssertionError as err:
|
|
83
|
+
except (AssertionError, UIVisibleFatalError) as err:
|
|
81
84
|
raise err
|
|
85
|
+
|
|
82
86
|
except psutil.NoSuchProcess:
|
|
83
87
|
# We reach here when the intermediate process launched by matlab-proxy died
|
|
84
88
|
# before we can query for its child processes. Hence, to find the actual MATLAB
|
|
@@ -113,6 +113,7 @@ matlab_proxy.egg-info/not-zip-safe
|
|
|
113
113
|
matlab_proxy.egg-info/requires.txt
|
|
114
114
|
matlab_proxy.egg-info/top_level.txt
|
|
115
115
|
matlab_proxy/icons/matlab.svg
|
|
116
|
+
matlab_proxy/matlab/evaluateUserMatlabCode.m
|
|
116
117
|
matlab_proxy/matlab/startup.m
|
|
117
118
|
matlab_proxy/util/__init__.py
|
|
118
119
|
matlab_proxy/util/event_loop.py
|
|
@@ -63,14 +63,20 @@ TESTS_REQUIRES = [
|
|
|
63
63
|
"pytest-playwright",
|
|
64
64
|
]
|
|
65
65
|
|
|
66
|
-
INSTALL_REQUIRES = [
|
|
66
|
+
INSTALL_REQUIRES = [
|
|
67
|
+
"aiohttp>=3.7.4",
|
|
68
|
+
"aiohttp_session[secure]",
|
|
69
|
+
"importlib-metadata",
|
|
70
|
+
"importlib-resources",
|
|
71
|
+
"psutil",
|
|
72
|
+
]
|
|
67
73
|
|
|
68
74
|
HERE = Path(__file__).parent.resolve()
|
|
69
75
|
long_description = (HERE / "README.md").read_text()
|
|
70
76
|
|
|
71
77
|
setuptools.setup(
|
|
72
78
|
name="matlab-proxy",
|
|
73
|
-
version="0.
|
|
79
|
+
version="0.18.0",
|
|
74
80
|
url=config["doc_url"],
|
|
75
81
|
author="The MathWorks, Inc.",
|
|
76
82
|
author_email="cloud@mathworks.com",
|
|
@@ -7,6 +7,7 @@ from pathlib import Path
|
|
|
7
7
|
from typing import Optional
|
|
8
8
|
|
|
9
9
|
import pytest
|
|
10
|
+
from matlab_proxy import settings
|
|
10
11
|
|
|
11
12
|
from matlab_proxy import settings
|
|
12
13
|
from matlab_proxy.app_state import AppState
|
|
@@ -14,6 +15,11 @@ from matlab_proxy.constants import MWI_AUTH_TOKEN_NAME_FOR_HTTP
|
|
|
14
15
|
from matlab_proxy.util.mwi.exceptions import LicensingError, MatlabError
|
|
15
16
|
from tests.unit.util import MockResponse
|
|
16
17
|
|
|
18
|
+
from matlab_proxy.constants import (
|
|
19
|
+
CONNECTOR_SECUREPORT_FILENAME,
|
|
20
|
+
USER_CODE_OUTPUT_FILE_NAME,
|
|
21
|
+
)
|
|
22
|
+
|
|
17
23
|
|
|
18
24
|
@pytest.fixture
|
|
19
25
|
def sample_settings_fixture(tmp_path):
|
|
@@ -35,6 +41,7 @@ def sample_settings_fixture(tmp_path):
|
|
|
35
41
|
"mwi_logs_root_dir": Path(settings.get_mwi_config_folder(dev=True)),
|
|
36
42
|
"app_port": 12345,
|
|
37
43
|
"mwapikey": "asdf",
|
|
44
|
+
"has_custom_code_to_execute": False,
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
|
|
@@ -662,3 +669,30 @@ async def test_detect_active_client_status_can_reset_active_client(app_state_fix
|
|
|
662
669
|
assert (
|
|
663
670
|
app_state_fixture.active_client == None
|
|
664
671
|
), f"Expected the active_client to be None"
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
@pytest.mark.parametrize(
|
|
675
|
+
"session_file_count, has_custom_code_to_execute", [(2, True), (1, False)]
|
|
676
|
+
)
|
|
677
|
+
def test_create_logs_dir_for_MATLAB(
|
|
678
|
+
app_state_fixture, session_file_count, has_custom_code_to_execute
|
|
679
|
+
):
|
|
680
|
+
"""Test to check create_logs_dir_for_MATLAB()
|
|
681
|
+
|
|
682
|
+
Args:
|
|
683
|
+
app_state_fixture (AppState): Object of AppState class with defaults set
|
|
684
|
+
"""
|
|
685
|
+
# Arrange
|
|
686
|
+
app_state_fixture.settings["has_custom_code_to_execute"] = (
|
|
687
|
+
has_custom_code_to_execute
|
|
688
|
+
)
|
|
689
|
+
|
|
690
|
+
# Act
|
|
691
|
+
app_state_fixture.create_logs_dir_for_MATLAB()
|
|
692
|
+
|
|
693
|
+
# Assert
|
|
694
|
+
for _, session_file_path in app_state_fixture.matlab_session_files.items():
|
|
695
|
+
# Check session files are present in mwi logs directory
|
|
696
|
+
assert app_state_fixture.mwi_logs_dir == Path(session_file_path).parent
|
|
697
|
+
|
|
698
|
+
assert len(app_state_fixture.matlab_session_files) == session_file_count
|
|
@@ -458,3 +458,38 @@ def test_get_ssl_context_with_invalid_custom_ssl_files_raises_exception(
|
|
|
458
458
|
|
|
459
459
|
with pytest.raises(Exception, match=exception_msg):
|
|
460
460
|
settings._validate_ssl_files_and_get_ssl_context(mwi_certs_dir)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
@pytest.mark.parametrize(
|
|
464
|
+
"expected_value_for_has_custom_code, custom_code, has_custom_code_exception_matlab_cmd",
|
|
465
|
+
[(False, "", False), (True, "run(disp('MATLAB'))", True)],
|
|
466
|
+
ids=["No custom code to execute", "Has custom code to execute"],
|
|
467
|
+
)
|
|
468
|
+
def test_get_matlab_settings_custom_code(
|
|
469
|
+
monkeypatch,
|
|
470
|
+
mocker,
|
|
471
|
+
expected_value_for_has_custom_code,
|
|
472
|
+
custom_code,
|
|
473
|
+
has_custom_code_exception_matlab_cmd,
|
|
474
|
+
):
|
|
475
|
+
# Arrange
|
|
476
|
+
monkeypatch.setenv(mwi_env.get_env_name_custom_matlab_code(), custom_code)
|
|
477
|
+
mocker.patch(
|
|
478
|
+
"matlab_proxy.settings.get_matlab_executable_and_root_path",
|
|
479
|
+
return_value=("matlab", None),
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
# Act
|
|
483
|
+
matlab_settings = settings.get_matlab_settings()
|
|
484
|
+
exception_present_in_matlab_cmd = (
|
|
485
|
+
"MATLABCustomStartupCodeError" in matlab_settings["matlab_cmd"][-1]
|
|
486
|
+
)
|
|
487
|
+
print(matlab_settings)
|
|
488
|
+
|
|
489
|
+
# Assert
|
|
490
|
+
assert (
|
|
491
|
+
matlab_settings["has_custom_code_to_execute"]
|
|
492
|
+
== expected_value_for_has_custom_code
|
|
493
|
+
)
|
|
494
|
+
|
|
495
|
+
assert exception_present_in_matlab_cmd == has_custom_code_exception_matlab_cmd
|
|
@@ -6,6 +6,9 @@ import psutil
|
|
|
6
6
|
|
|
7
7
|
from matlab_proxy.util import get_child_processes, system, add_signal_handlers, prettify
|
|
8
8
|
from matlab_proxy.util import system
|
|
9
|
+
from matlab_proxy.util.mwi.exceptions import (
|
|
10
|
+
UIVisibleFatalError,
|
|
11
|
+
)
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
def test_get_supported_termination_signals():
|
|
@@ -90,7 +93,7 @@ def test_get_child_processes_no_children(mocker):
|
|
|
90
93
|
mock_parent_process_psutil.children.return_value = []
|
|
91
94
|
|
|
92
95
|
# Call the function with the mocked parent process
|
|
93
|
-
with pytest.raises(
|
|
96
|
+
with pytest.raises(UIVisibleFatalError):
|
|
94
97
|
get_child_processes(parent_process)
|
|
95
98
|
|
|
96
99
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-eps.svg
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-eps.ttf
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-eps.woff
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Confirmation/Confirmation.spec.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/Information/Information.spec.js
RENAMED
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/ExistingLicense.css
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/LicensingGatherer/ExistingLicense.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/OverlayTrigger.css
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/trigger-error.svg
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/gui/src/components/OverlayTrigger/trigger-ok.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/embedded_connector/__init__.py
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/embedded_connector/helpers.py
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/matlab_proxy/util/mwi/embedded_connector/request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/integration/utils/integration_tests_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/embedded_connector/__init__.py
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/embedded_connector/test_helpers.py
RENAMED
|
File without changes
|
{matlab-proxy-0.17.0 → matlab-proxy-0.18.0}/tests/unit/util/mwi/embedded_connector/test_request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|