matlab-proxy 0.27.0__tar.gz → 0.27.3__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.

Files changed (205) hide show
  1. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/PKG-INFO +2 -1
  2. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/index.jsx +0 -2
  3. matlab_proxy-0.27.3/gui/src/components/LicensingGatherer/MHLM.css +7 -0
  4. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/MHLM.jsx +2 -3
  5. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/MatlabJsd/index.jsx +0 -1
  6. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/hatch_build.py +3 -2
  7. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/app.py +40 -27
  8. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/app_state.py +20 -24
  9. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/settings.py +4 -6
  10. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/__init__.py +25 -44
  11. matlab_proxy-0.27.3/matlab_proxy/util/list_servers.py +89 -0
  12. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/environment_variables.py +10 -0
  13. matlab_proxy-0.27.3/matlab_proxy/util/mwi/logger.py +215 -0
  14. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/token_auth.py +2 -2
  15. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/validators.py +2 -2
  16. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/pyproject.toml +6 -5
  17. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_app.py +3 -2
  18. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/test_logger.py +17 -8
  19. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/test_util.py +1 -11
  20. matlab_proxy-0.27.0/matlab_proxy/util/list_servers.py +0 -44
  21. matlab_proxy-0.27.0/matlab_proxy/util/mwi/logger.py +0 -131
  22. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/.gitignore +0 -0
  23. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/LICENSE.md +0 -0
  24. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/README.md +0 -0
  25. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/.eslintrc.json +0 -0
  26. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/.gitignore +0 -0
  27. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/README.md +0 -0
  28. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/eslint.config.js +0 -0
  29. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/index.css +0 -0
  30. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/index.html +0 -0
  31. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/package-lock.json +0 -0
  32. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/package.json +0 -0
  33. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/public/favicon.ico +0 -0
  34. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/public/manifest.json +0 -0
  35. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/public/robots.txt +0 -0
  36. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/actionCreators/actionCreators.spec.js +0 -0
  37. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/actionCreators/index.js +0 -0
  38. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/actions/index.js +0 -0
  39. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/css/bootstrap.min.css +0 -0
  40. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/css/site7.min.css +0 -0
  41. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.eot +0 -0
  42. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.svg +0 -0
  43. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.ttf +0 -0
  44. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff +0 -0
  45. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff2 +0 -0
  46. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks-eps.svg +0 -0
  47. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks-eps.ttf +0 -0
  48. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks-eps.woff +0 -0
  49. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg +0 -0
  50. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf +0 -0
  51. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks-pictograms.woff +0 -0
  52. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks.svg +0 -0
  53. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks.ttf +0 -0
  54. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/fonts/mathworks.woff +0 -0
  55. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/images/bug_reports/workaround.gif +0 -0
  56. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/images/responsive/global/ico-header-account-hover.svg +0 -0
  57. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/images/responsive/global/ico-header-account.svg +0 -0
  58. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/images/responsive/global/ico-header-contact-hover.svg +0 -0
  59. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/images/responsive/global/ico-header-contact.svg +0 -0
  60. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/3p/images/responsive/global/ico-sprite.png +0 -0
  61. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/App.css +0 -0
  62. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/App.spec.jsx +0 -0
  63. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/IdleBufferTimeouts.spec.jsx +0 -0
  64. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/App/MATLAB-env-blur.png +0 -0
  65. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Confirmation/Confirmation.spec.jsx +0 -0
  66. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Confirmation/index.jsx +0 -0
  67. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/Controls.css +0 -0
  68. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/Controls.spec.jsx +0 -0
  69. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/feedback.svg +0 -0
  70. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/help.svg +0 -0
  71. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/index.jsx +0 -0
  72. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/restart.svg +0 -0
  73. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/sign-out.svg +0 -0
  74. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/start.svg +0 -0
  75. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/stop.svg +0 -0
  76. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Controls/terminate.svg +0 -0
  77. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/EntitlementSelector/EntitlementSelector.spec.jsx +0 -0
  78. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/EntitlementSelector/index.jsx +0 -0
  79. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Error/Error.css +0 -0
  80. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Error/Error.spec.jsx +0 -0
  81. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Error/index.jsx +0 -0
  82. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Help/Help.css +0 -0
  83. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Help/Help.spec.jsx +0 -0
  84. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Help/index.jsx +0 -0
  85. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Information/Information.css +0 -0
  86. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Information/Information.spec.jsx +0 -0
  87. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Information/index.jsx +0 -0
  88. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/ExistingLicense.css +0 -0
  89. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/ExistingLicense.jsx +0 -0
  90. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/LicenseGatherer.spec.jsx +0 -0
  91. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/LicensingGatherer.css +0 -0
  92. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/NLM.jsx +0 -0
  93. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/LicensingGatherer/index.jsx +0 -0
  94. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/MatlabJsd/MatlabJsd.css +0 -0
  95. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/MatlabJsd/MatlabJsd.spec.jsx +0 -0
  96. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Overlay/Overlay.css +0 -0
  97. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Overlay/Overlay.spec.jsx +0 -0
  98. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/Overlay/index.jsx +0 -0
  99. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/OverlayTrigger.css +0 -0
  100. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.jsx +0 -0
  101. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/ResizeOverlayTrigger.spec.jsx +0 -0
  102. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/arrow.svg +0 -0
  103. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/gripper.svg +0 -0
  104. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/index.jsx +0 -0
  105. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/trigger-error.svg +0 -0
  106. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/OverlayTrigger/trigger-ok.svg +0 -0
  107. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/ShutdownWarning/ShutdownWarning.css +0 -0
  108. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/components/ShutdownWarning/index.jsx +0 -0
  109. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/constants.js +0 -0
  110. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/main.jsx +0 -0
  111. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/reducers/index.js +0 -0
  112. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/reducers/reducers.spec.js +0 -0
  113. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/selectors/index.js +0 -0
  114. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/selectors/selectors.spec.js +0 -0
  115. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/setupTests.js +0 -0
  116. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/test/utils/react-test.jsx +0 -0
  117. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/test/utils/responses.js +0 -0
  118. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/src/test/utils/state.js +0 -0
  119. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/gui/vite.config.js +0 -0
  120. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/__init__.py +0 -0
  121. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/constants.py +0 -0
  122. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/default_configuration.py +0 -0
  123. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/devel.py +0 -0
  124. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/icons/matlab.svg +0 -0
  125. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/matlab/evaluateUserMatlabCode.m +0 -0
  126. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/matlab/startup.m +0 -0
  127. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/cookie_jar.py +0 -0
  128. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/event_loop.py +0 -0
  129. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mw.py +0 -0
  130. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/__init__.py +0 -0
  131. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/custom_http_headers.py +0 -0
  132. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/download.py +0 -0
  133. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/embedded_connector/__init__.py +0 -0
  134. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/embedded_connector/helpers.py +0 -0
  135. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/embedded_connector/request.py +0 -0
  136. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/exceptions.py +0 -0
  137. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/mwi/session_name.py +0 -0
  138. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/system.py +0 -0
  139. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy/util/windows.py +0 -0
  140. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/README.md +0 -0
  141. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/__init__.py +0 -0
  142. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/lib/README.md +0 -0
  143. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/lib/__init__.py +0 -0
  144. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/lib/api.py +0 -0
  145. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/storage/README.md +0 -0
  146. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/storage/__init__.py +0 -0
  147. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/storage/file_repository.py +0 -0
  148. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/storage/interface.py +0 -0
  149. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/storage/server.py +0 -0
  150. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/__init__.py +0 -0
  151. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/auth.py +0 -0
  152. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/constants.py +0 -0
  153. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/environment_variables.py +0 -0
  154. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/exceptions.py +0 -0
  155. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/helpers.py +0 -0
  156. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/utils/logger.py +0 -0
  157. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/web/README.md +0 -0
  158. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/web/__init__.py +0 -0
  159. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/web/app.py +0 -0
  160. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/web/monitor.py +0 -0
  161. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/matlab_proxy_manager/web/watcher.py +0 -0
  162. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/README.md +0 -0
  163. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/__init__.py +0 -0
  164. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/__init__.py +0 -0
  165. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/integration_tests_with_license/__init__.py +0 -0
  166. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/integration_tests_with_license/conftest.py +0 -0
  167. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/integration_tests_with_license/test_http_end_points.py +0 -0
  168. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/integration_tests_without_license/__init__.py +0 -0
  169. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/integration_tests_without_license/conftest.py +0 -0
  170. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +0 -0
  171. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/pytest.ini +0 -0
  172. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/utils/__init__.py +0 -0
  173. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/utils/integration_tests_utils.py +0 -0
  174. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/integration/utils/licensing.py +0 -0
  175. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/matlab-tests/TestEvaluateUserMatlabCodeScript.m +0 -0
  176. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/__init__.py +0 -0
  177. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/conftest.py +0 -0
  178. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/fixtures/fixture_auth.py +0 -0
  179. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/mocks/mock_client.py +0 -0
  180. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/proxy-manager/lib/test_api.py +0 -0
  181. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/proxy-manager/storage/test_file_repository.py +0 -0
  182. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/proxy-manager/storage/test_server.py +0 -0
  183. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/proxy-manager/web/test_app.py +0 -0
  184. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/proxy-manager/web/test_monitor.py +0 -0
  185. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/proxy-manager/web/test_watcher.py +0 -0
  186. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/pytest.ini +0 -0
  187. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_app_state.py +0 -0
  188. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_constants.py +0 -0
  189. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_ddux.py +0 -0
  190. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_devel.py +0 -0
  191. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_non_dev_mode.py +0 -0
  192. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/test_settings.py +0 -0
  193. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/__init__.py +0 -0
  194. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/__init__.py +0 -0
  195. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/embedded_connector/__init__.py +0 -0
  196. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/embedded_connector/test_helpers.py +0 -0
  197. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/embedded_connector/test_request.py +0 -0
  198. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/test_custom_http_headers.py +0 -0
  199. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/test_download.py +0 -0
  200. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/test_token_auth.py +0 -0
  201. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/mwi/test_validators.py +0 -0
  202. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/test_cookie_jar.py +0 -0
  203. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/unit/util/test_mw.py +0 -0
  204. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/utils/__init__.py +0 -0
  205. {matlab_proxy-0.27.0 → matlab_proxy-0.27.3}/tests/utils/logging_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matlab-proxy
3
- Version: 0.27.0
3
+ Version: 0.27.3
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Project-URL: Homepage, https://github.com/mathworks/matlab-proxy/
6
6
  Project-URL: Documentation, https://github.com/mathworks/matlab-proxy/blob/main/README.md
@@ -23,6 +23,7 @@ Requires-Dist: importlib-metadata
23
23
  Requires-Dist: importlib-resources
24
24
  Requires-Dist: psutil
25
25
  Requires-Dist: requests
26
+ Requires-Dist: rich
26
27
  Requires-Dist: watchdog
27
28
  Provides-Extra: dev
28
29
  Requires-Dist: aiohttp-devtools; extra == 'dev'
@@ -4,8 +4,6 @@ import React, { useState, useCallback, useEffect, useMemo, useRef } from 'react'
4
4
  import { useSelector, useDispatch } from 'react-redux';
5
5
  import { useInterval, useTimeoutFn } from 'react-use';
6
6
  import './App.css';
7
- import './3p/css/bootstrap.min.css';
8
- import './3p/css/site7.min.css';
9
7
  import Confirmation from '../Confirmation';
10
8
  import OverlayTrigger from '../OverlayTrigger';
11
9
  import Overlay from '../Overlay';
@@ -0,0 +1,7 @@
1
+ /* Copyright 2025 The MathWorks, Inc. */
2
+
3
+ iframe {
4
+ border: 0px;
5
+ height: 380px;
6
+ width: 100%;
7
+ }
@@ -13,6 +13,8 @@ import {
13
13
  fetchSetLicensing
14
14
  } from '../../actionCreators';
15
15
 
16
+ import './MHLM.css';
17
+
16
18
  // Send a generated nonce to the login iframe
17
19
  function setLoginNonce (username) {
18
20
  const clientNonce = (Math.random() + '').substr(2);
@@ -150,9 +152,6 @@ function MHLM ({ mhlmLicensingInfo = null }) {
150
152
  id="loginframe"
151
153
  title="MathWorks Embedded Login"
152
154
  type="text/html"
153
- height="380"
154
- width="100%"
155
- frameBorder="0"
156
155
  src={embeddedLoginUrl}
157
156
  onLoad={handleIFrameLoaded}
158
157
  >
@@ -39,7 +39,6 @@ function MatlabJsd ({ url, iFrameRef, shouldListenForEvents, handleUserInteracti
39
39
  ref={iFrameRef}
40
40
  title="MATLAB JSD"
41
41
  src={url}
42
- frameBorder="0"
43
42
  allowFullScreen />
44
43
  </div>
45
44
  );
@@ -3,7 +3,7 @@
3
3
  import os
4
4
  import subprocess
5
5
  from pathlib import Path
6
- from shutil import which, copytree
6
+ from shutil import copytree, which
7
7
  from typing import Any, Dict
8
8
 
9
9
  from hatchling.builders.hooks.plugin.interface import BuildHookInterface
@@ -23,7 +23,8 @@ class CustomBuildHook(BuildHookInterface):
23
23
  "npm must be installed and on the path during package build!"
24
24
  )
25
25
 
26
- npm_install = [npm_path, "install"]
26
+ # Adding retries to npm install to avoid transient rate limiting issues
27
+ npm_install = [npm_path, "install", "--fetch-retries", "10"]
27
28
  npm_build = [npm_path, "run", "build"]
28
29
 
29
30
  pwd = Path.cwd()
@@ -432,25 +432,38 @@ async def shutdown_integration_delete(req):
432
432
  req (HTTPRequest): HTTPRequest Object
433
433
  """
434
434
  state = req.app["state"]
435
-
436
435
  logger.info(f"Shutting down {state.settings['integration_name']}...")
437
436
 
438
- # Send response manually because this has to happen before the application exits
439
437
  res = create_status_response(req.app, "../")
440
- await res.prepare(req)
441
- await res.write_eof()
442
438
 
443
- # Gracefully shutdown the server
444
- await req.app.shutdown()
445
- await req.app.cleanup()
439
+ # Schedule the shutdown to happen after the response is sent
440
+ asyncio.create_task(_shutdown_after_response(req.app))
441
+
442
+ return res
443
+
444
+
445
+ async def _shutdown_after_response(app):
446
+ # Shutdown the application after a short delay to allow the response to be fully sent
447
+ # back to the client before the server is stopped
448
+ await asyncio.sleep(0.1)
449
+
450
+ # aiohttp shutdown to be invoked before cleanup -
451
+ # https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.Application.shutdown
452
+ await app.shutdown()
453
+ await app.cleanup()
446
454
 
447
455
  loop = util.get_event_loop()
448
- # Run the current batch of coroutines in the event loop and then exit.
449
- # This completes the loop.run_forever() blocking call and subsequent code
450
- # in create_and_start_app() resumes execution.
451
- loop.stop()
452
456
 
453
- return res
457
+ # Cancel remaining tasks (except this one: _shutdown_after_response)
458
+ running_tasks = asyncio.all_tasks(loop)
459
+ current_task = asyncio.current_task()
460
+ if current_task:
461
+ running_tasks.discard(current_task)
462
+
463
+ await util.cancel_tasks(running_tasks)
464
+
465
+ # Stop the event loop from this task
466
+ loop.call_soon_threadsafe(loop.stop)
454
467
 
455
468
 
456
469
  # @token_auth.authenticate_access_decorator
@@ -873,8 +886,6 @@ def configure_and_start(app):
873
886
  """
874
887
  loop = util.get_event_loop()
875
888
 
876
- web_logger = None if not mwi_env.is_web_logging_enabled() else logger
877
-
878
889
  # Setup the session storage,
879
890
  # Uniqified per session to prevent multiple proxy servers on the same FQDN from interfering with each other.
880
891
  uniqify_session_cookie = secrets.token_hex()
@@ -888,7 +899,9 @@ def configure_and_start(app):
888
899
  )
889
900
 
890
901
  # Setup runner
891
- runner = web.AppRunner(app, logger=web_logger, access_log=web_logger)
902
+ runner = web.AppRunner(
903
+ app, access_log=logger if mwi_env.is_web_logging_enabled() else None
904
+ )
892
905
  loop.run_until_complete(runner.setup())
893
906
 
894
907
  # Prepare site to start, then set port of the app.
@@ -961,7 +974,7 @@ def create_app(config_name=matlab_proxy.get_default_config_name()):
961
974
  app.router.add_route("*", f"{base_url}", root_redirect)
962
975
 
963
976
  app.router.add_route("*", f"{base_url}/{{proxyPath:.*}}", matlab_view)
964
- app.on_cleanup.append(cleanup_background_tasks)
977
+ app.on_shutdown.append(cleanup_background_tasks)
965
978
 
966
979
  return app
967
980
 
@@ -983,7 +996,7 @@ def configure_no_proxy_in_env():
983
996
  os.environ["no_proxy"] = ",".join(
984
997
  set(existing_no_proxy_env + no_proxy_whitelist)
985
998
  )
986
- logger.info(f"Setting no_proxy to: {os.environ.get('no_proxy')}")
999
+ logger.debug(f"Setting no_proxy to: {os.environ.get('no_proxy')}")
987
1000
 
988
1001
 
989
1002
  def create_and_start_app(config_name):
@@ -1011,15 +1024,15 @@ def create_and_start_app(config_name):
1011
1024
 
1012
1025
  # After handling the interrupt, proceed with shutting down the server gracefully.
1013
1026
  try:
1027
+ # aiohttp shutdown to be invoked before cleanup -
1028
+ # https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.Application.shutdown
1029
+ loop.run_until_complete(app.shutdown())
1030
+ loop.run_until_complete(app.cleanup())
1031
+
1014
1032
  running_tasks = asyncio.all_tasks(loop)
1015
- loop.run_until_complete(
1016
- asyncio.gather(
1017
- app.shutdown(),
1018
- app.cleanup(),
1019
- util.cancel_tasks(running_tasks),
1020
- return_exceptions=False,
1021
- )
1022
- )
1033
+
1034
+ # Gracefully cancel all running background tasks
1035
+ loop.run_until_complete(util.cancel_tasks(running_tasks))
1023
1036
 
1024
1037
  except Exception:
1025
1038
  pass
@@ -1040,12 +1053,12 @@ def print_version_and_exit():
1040
1053
 
1041
1054
  def main():
1042
1055
  """Starting point of the integration. Creates the web app and runs indefinitely."""
1043
- if util.parse_cli_args()["version"]:
1056
+ if util.parse_main_cli_args()["version"]:
1044
1057
  print_version_and_exit()
1045
1058
 
1046
1059
  # The integration needs to be called with --config flag.
1047
1060
  # Parse the passed cli arguments.
1048
- desired_configuration_name = util.parse_cli_args()["config"]
1061
+ desired_configuration_name = util.parse_main_cli_args()["config"]
1049
1062
 
1050
1063
  create_and_start_app(config_name=desired_configuration_name)
1051
1064
 
@@ -484,7 +484,7 @@ class AppState:
484
484
  "'busy' status endpoint returned an invalid response, falling back to using 'ping' endpoint to determine MATLAB state"
485
485
  )
486
486
  warning = f"{mwi_env.get_env_name_shutdown_on_idle_timeout()} environment variable is supported only for MATLAB versions R2021a or later"
487
- logger.warn(warning)
487
+ logger.warning(warning)
488
488
  self.warnings.append(warning)
489
489
 
490
490
  else:
@@ -875,15 +875,8 @@ class AppState:
875
875
  user_code_output_file
876
876
  )
877
877
  logger.info(
878
- util.prettify(
879
- boundary_filler="*",
880
- text_arr=[
881
- f"When MATLAB starts, you can see the output for your startup code at:",
882
- f"{self.matlab_session_files.get('startup_code_output_file', ' ')}",
883
- ],
884
- )
878
+ f"The results of executing MWI_MATLAB_STARTUP_SCRIPT are stored at: {user_code_output_file} "
885
879
  )
886
-
887
880
  return
888
881
 
889
882
  def create_server_info_file(self):
@@ -909,16 +902,16 @@ class AppState:
909
902
 
910
903
  # By default mwi_server_url usually points to 0.0.0.0 as the hostname, but this does not work well
911
904
  # on some browsers. Specifically on Safari (MacOS)
912
- logger.info(
913
- util.prettify(
914
- boundary_filler="=",
915
- text_arr=[
916
- f"Access MATLAB at:",
917
- self.settings["mwi_server_url"].replace("0.0.0.0", "localhost")
918
- + mwi_auth_token_str,
919
- ],
920
- )
905
+ server_url = (
906
+ self.settings["mwi_server_url"].replace("0.0.0.0", "localhost")
907
+ + mwi_auth_token_str
908
+ )
909
+
910
+ mwi.logger.log_startup_info(
911
+ title=f"matlab-proxy-app running on {self.settings['app_port']}",
912
+ matlab_url=server_url,
921
913
  )
914
+ logger.info(f"MATLAB Root: {self.settings['matlab_path']}")
922
915
 
923
916
  def clean_up_mwi_server_session(self):
924
917
  # Clean up mwi_server_session_files
@@ -965,10 +958,11 @@ class AppState:
965
958
  matlab_env["MLM_LICENSE_FILE"] = self.licensing["conn_str"]
966
959
 
967
960
  # Env setup related to MATLAB
968
- matlab_env["MW_CRASH_MODE"] = "native"
969
- matlab_env["MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER"] = "true"
970
- matlab_env["PCT_ENABLED"] = "true"
971
- matlab_env["HTTP_MATLAB_CLIENT_GATEWAY_PUBLIC_PORT"] = "1"
961
+ ## Update the values only if it does not already exist in the environment
962
+ matlab_env["MW_CRASH_MODE"] = matlab_env.get("MW_CRASH_MODE", "native")
963
+ matlab_env["MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER"] = matlab_env.get(
964
+ "MATLAB_WORKER_CONFIG_ENABLE_LOCAL_PARCLUSTER", "true"
965
+ )
972
966
  matlab_env["MW_DOCROOT"] = os.path.join("ui", "webgui", "src")
973
967
  matlab_env["MWAPIKEY"] = self.settings["mwapikey"]
974
968
 
@@ -1003,7 +997,7 @@ class AppState:
1003
997
 
1004
998
  # Set MW_CONNECTOR_CONTEXT_ROOT
1005
999
  matlab_env["MW_CONNECTOR_CONTEXT_ROOT"] = self.settings.get("base_url", "/")
1006
- logger.info(
1000
+ logger.debug(
1007
1001
  f"MW_CONNECTOR_CONTEXT_ROOT is set to: {matlab_env['MW_CONNECTOR_CONTEXT_ROOT']}"
1008
1002
  )
1009
1003
 
@@ -1315,6 +1309,8 @@ class AppState:
1315
1309
  # to MATLAB state by other functions/tasks until the lock is released, ensuring consistency. It's released early only in case of exceptions.
1316
1310
  await self.matlab_state_updater_lock.acquire()
1317
1311
  self.set_matlab_state("starting")
1312
+ logger.info(f"Starting MATLAB...")
1313
+
1318
1314
  # Clear MATLAB errors and logging
1319
1315
  self.error = None
1320
1316
  self.logs["matlab"].clear()
@@ -1534,7 +1530,7 @@ class AppState:
1534
1530
  except:
1535
1531
  pass
1536
1532
 
1537
- logger.info("Stopped (any running) MATLAB process.")
1533
+ logger.debug("Stopped (any running) MATLAB process.")
1538
1534
 
1539
1535
  # Terminating Xvfb
1540
1536
  if system.is_posix():
@@ -53,7 +53,7 @@ def get_process_startup_timeout():
53
53
  )
54
54
  return constants.DEFAULT_PROCESS_START_TIMEOUT
55
55
 
56
- logger.info(
56
+ logger.debug(
57
57
  f"Using {constants.DEFAULT_PROCESS_START_TIMEOUT} seconds as the default timeout value"
58
58
  )
59
59
 
@@ -94,7 +94,7 @@ def get_matlab_executable_and_root_path():
94
94
 
95
95
  if matlab_executable_path:
96
96
  matlab_root_path = Path(matlab_executable_path).resolve().parent.parent
97
- logger.info(f"Found MATLAB executable at: {matlab_executable_path}")
97
+ logger.debug(f"MATLAB root folder: {matlab_root_path}")
98
98
  matlab_root_path = mwi.validators.validate_matlab_root_path(
99
99
  matlab_root_path, is_custom_matlab_root=False
100
100
  )
@@ -289,7 +289,6 @@ def get(config_name=matlab_proxy.get_default_config_name(), dev=False):
289
289
  if not settings["is_windowmanager_available"]:
290
290
  warning = " Unable to find fluxbox on the system PATH. To use Simulink Online, add Fluxbox to the system PATH and restart matlab-proxy. For details, see https://github.com/mathworks/matlab-proxy#requirements."
291
291
  logger.warning(warning)
292
- settings["warnings"].append(warning)
293
292
 
294
293
  settings.update(get_matlab_settings())
295
294
 
@@ -500,7 +499,7 @@ def _validate_ssl_files_and_get_ssl_context(mwi_config_folder):
500
499
  # Don't use SSL if the user has explicitly disabled SSL communication or not set the respective env var
501
500
  if not is_ssl_enabled:
502
501
  if ssl_cert_file:
503
- logger.warn(
502
+ logger.warning(
504
503
  f"Ignoring provided SSL files, as {env_name_enable_ssl} is either unset or set to false"
505
504
  )
506
505
  return None
@@ -597,7 +596,7 @@ def generate_new_self_signed_certs(mwi_certs_dir):
597
596
  f.write(cert.public_bytes(serialization.Encoding.PEM))
598
597
 
599
598
  except Exception as ex:
600
- logger.warn(
599
+ logger.warning(
601
600
  f"Failed to generate self-signed certificates, proceeding with non-secure mode! Error: {ex}"
602
601
  )
603
602
  cert_file = priv_key_file = None
@@ -699,7 +698,6 @@ def _get_matlab_cmd(matlab_executable_path, code_to_execute, nlm_conn_str):
699
698
  "-nosplash",
700
699
  *flag_to_hide_desktop,
701
700
  "-softwareopengl",
702
- # " v=mvm ",
703
701
  *matlab_lic_mode,
704
702
  "-externalUI",
705
703
  profile_matlab_startup,
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2024 The MathWorks, Inc.
1
+ # Copyright 2020-2025 The MathWorks, Inc.
2
2
  import argparse
3
3
  import inspect
4
4
  import os
@@ -26,7 +26,7 @@ logger = mwi.logger.get()
26
26
  interrupt_signal_caught = False
27
27
 
28
28
 
29
- def parse_cli_args():
29
+ def parse_main_cli_args():
30
30
  """Parses CLI arguments passed to the main() function.
31
31
 
32
32
  Returns:
@@ -56,6 +56,28 @@ def parse_cli_args():
56
56
  return parsed_args
57
57
 
58
58
 
59
+ def parse_list_cli_args():
60
+ """Parses CLI arguments passed to the matlab-proxy-app-list-servers entrypoint.
61
+
62
+ Returns:
63
+ dict: Containing the parsed arguments
64
+ """
65
+ # Parse the --config flag provided to the console script executable.
66
+ parsed_args = {}
67
+ parser = argparse.ArgumentParser()
68
+ parser.add_argument(
69
+ "-q",
70
+ "--quiet",
71
+ help="Return the server list without any additional text.",
72
+ action="store_true",
73
+ )
74
+ args = parser.parse_args()
75
+
76
+ parsed_args["quiet"] = args.quiet
77
+
78
+ return parsed_args
79
+
80
+
59
81
  def prepare_site(app, runner):
60
82
  """Prepares to launch a TCPSite. If MWI_APP_PORT env variable is set,
61
83
  it will setup a site to launch on that port, else will launch on a random available port.
@@ -148,47 +170,6 @@ def add_signal_handlers(loop):
148
170
  return loop
149
171
 
150
172
 
151
- def prettify(boundary_filler=" ", text_arr=[]):
152
- """Prettify array of strings with borders for stdout
153
-
154
- Args:
155
- boundary_filler (str, optional): Upper and lower border filler for text. Defaults to " ".
156
- text_arr (list, optional):The text array to prettify. Each element will be added to a newline. Defaults to [].
157
-
158
- Returns:
159
- [str]: Prettified String
160
- """
161
-
162
- import sys
163
-
164
- if not sys.stdout.isatty():
165
- return (
166
- "\n============================\n"
167
- + "\n".join(text_arr)
168
- + "\n============================\n"
169
- )
170
-
171
- size = os.get_terminal_size()
172
- cols, _ = size.columns, size.lines
173
-
174
- if any(len(text) > cols for text in text_arr):
175
- result = ""
176
- for text in text_arr:
177
- result += text + "\n"
178
- return result
179
-
180
- upper = "\n" + "".ljust(cols, boundary_filler) + "\n" if len(text_arr) > 0 else ""
181
- lower = "".ljust(cols, boundary_filler) if len(text_arr) > 0 else ""
182
-
183
- content = ""
184
- for text in text_arr:
185
- content += text.center(cols) + "\n"
186
-
187
- result = upper + content + lower
188
-
189
- return result
190
-
191
-
192
173
  def get_child_processes(parent_process, max_attempts=10, sleep_interval=1):
193
174
  """Get list of child processes from a parent process.
194
175
 
@@ -312,7 +293,7 @@ class TrackingLock:
312
293
  self._acquired_by = None
313
294
  self._lock = asyncio.Lock()
314
295
  if not purpose:
315
- logger.warn("Provide a purpose for this instance of TrackingLock")
296
+ logger.warning("Provide a purpose for this instance of TrackingLock")
316
297
  self._purpose = purpose
317
298
 
318
299
  @property
@@ -0,0 +1,89 @@
1
+ # Copyright (c) 2020-2025 The MathWorks, Inc.
2
+ # Script to print information about all running matlab-proxy servers for current user on current machine.
3
+
4
+ import glob
5
+ import os
6
+
7
+ import matlab_proxy.settings as mwi_settings
8
+ import matlab_proxy.util as mwi_util
9
+
10
+ from datetime import datetime
11
+ from rich.console import Console
12
+ from rich.table import Table
13
+
14
+ __NO_SERVERS_MSG = "No MATLAB-PROXY Servers are currently running."
15
+
16
+
17
+ def _extract_version_and_session(title):
18
+ """Extracts session name and MATLAB version from the title."""
19
+ parts = title.split("-")
20
+ if len(parts) < 2:
21
+ return title.replace("MATLAB ", ""), ""
22
+ session_name = parts[0].strip()
23
+ matlab_version = parts[1].strip().replace("MATLAB ", "")
24
+ return matlab_version, session_name
25
+
26
+
27
+ def _get_server_info(server):
28
+ """Helper function to parse info from server file."""
29
+ with open(server) as f:
30
+ # Assumes that the server file contains the address on the first line,
31
+ # the browser_title on the second line, and the timestamp is derived from the file's last modified time.
32
+ address = f.readline().strip()
33
+ browser_title = f.readline().strip()
34
+ matlab_version, session_name = _extract_version_and_session(browser_title)
35
+ timestamp = _get_timestamp(server)
36
+ return timestamp, matlab_version, session_name, address
37
+
38
+
39
+ def _print_server_info_as_table(servers):
40
+ console = Console()
41
+ table = Table(
42
+ title="MATLAB Proxy Servers",
43
+ title_style="cyan",
44
+ title_justify="center",
45
+ caption="No servers found." if not servers else "",
46
+ caption_style="bold red",
47
+ show_header=True,
48
+ header_style="yellow",
49
+ show_lines=True,
50
+ show_edge=True,
51
+ )
52
+ table.add_column("Created On")
53
+ table.add_column("MATLAB\nVersion")
54
+ table.add_column("Session Name")
55
+ table.add_column("Server URL", overflow="fold")
56
+
57
+ # Build server information
58
+ for server in servers:
59
+ table.add_row(*_get_server_info(server))
60
+
61
+ console.print(table)
62
+
63
+
64
+ def _get_timestamp(filename):
65
+ """Get the last modified timestamp of the file in a human-readable format."""
66
+ timestamp = os.path.getmtime(filename)
67
+ readable_time = datetime.fromtimestamp(timestamp).strftime("%d/%m/%y %H:%M:%S")
68
+ return readable_time
69
+
70
+
71
+ def print_server_info():
72
+ """Print information about all matlab-proxy servers (with version > 0.4.0) running on this machine"""
73
+ home_folder = mwi_settings.get_mwi_config_folder()
74
+
75
+ # Look for files in port folders
76
+ ports_folder = home_folder / "ports"
77
+ search_string = str(ports_folder) + "/**/mwi_server.info"
78
+ servers = sorted(glob.glob(search_string), key=os.path.getmtime)
79
+
80
+ args = mwi_util.parse_list_cli_args()
81
+
82
+ if args["quiet"]:
83
+ for server in servers:
84
+ with open(server) as f:
85
+ server_info = f.readline().strip()
86
+ print(f"{server_info}", end="\n")
87
+ else:
88
+ _print_server_info_as_table(servers)
89
+ return
@@ -213,3 +213,13 @@ class Experimental:
213
213
  def should_use_cookie_cache():
214
214
  """Returns true if the cookie jar support is enabled."""
215
215
  return _is_env_set_to_true(Experimental.get_env_name_use_cookie_cache())
216
+
217
+ @staticmethod
218
+ def get_env_name_use_rich_logging():
219
+ """Set to True to enable rich logging to console."""
220
+ return "MWI_USE_RICH_LOGGING"
221
+
222
+ @staticmethod
223
+ def use_rich_logger():
224
+ """Returns true if the cookie jar support is enabled."""
225
+ return _is_env_set_to_true(Experimental.get_env_name_use_rich_logging())