matlab-proxy 0.18.1__py3-none-any.whl → 0.18.2__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.

Potentially problematic release.


This version of matlab-proxy might be problematic. Click here for more details.

matlab_proxy/settings.py CHANGED
@@ -395,8 +395,10 @@ def get_matlab_settings():
395
395
  has_custom_code_to_execute = (
396
396
  len(os.getenv(mwi_env.get_env_name_custom_matlab_code(), "").strip()) > 0
397
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;"
398
+
399
+ # Sanitize file paths to avoid MATLAB not running the script due to early breakup of character array.
400
+ mp_code_to_execute = f"try; run('{_sanitize_file_path_for_matlab(matlab_startup_file)}'); catch MATLABProxyInitializationError; disp(MATLABProxyInitializationError.message); end;"
401
+ custom_code_to_execute = f"try; run('{_sanitize_file_path_for_matlab(matlab_code_file)}'); catch MATLABCustomStartupCodeError; disp(MATLABCustomStartupCodeError.message); end;"
400
402
  code_to_execute = (
401
403
  mp_code_to_execute + custom_code_to_execute
402
404
  if has_custom_code_to_execute
@@ -621,3 +623,11 @@ def generate_new_self_signed_certs(mwi_certs_dir):
621
623
  cert_file = priv_key_file = None
622
624
 
623
625
  return cert_file, priv_key_file
626
+
627
+
628
+ def _sanitize_file_path_for_matlab(filepath: str) -> str:
629
+ """
630
+ Replace single quotes in the filepath with double single quotes to preserve the quote when used in MATLAB code.
631
+ """
632
+ filepath_with_single_quotes_escaped = filepath.replace("'", "''")
633
+ return filepath_with_single_quotes_escaped
@@ -187,7 +187,7 @@ class Experimental:
187
187
  @staticmethod
188
188
  def should_use_mos_html():
189
189
  """Returns true if matlab-proxy should use MOS htmls to load MATLAB"""
190
- return _is_env_set_to_true("MWI_USE_MOS") or Experimental.is_simulink_enabled()
190
+ return _is_env_set_to_true("MWI_USE_MOS")
191
191
 
192
192
  @staticmethod
193
193
  def should_use_mre_html():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.18.1
3
+ Version: 0.18.2
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Home-page: https://github.com/mathworks/matlab-proxy/
6
6
  Author: The MathWorks, Inc.
@@ -4,7 +4,7 @@ matlab_proxy/app_state.py,sha256=i5AVaNroFSld4Y36BNil5lwS0PNrHnceYq7swXY5AI4,605
4
4
  matlab_proxy/constants.py,sha256=CrbIA098b5LMsqxY7nbap0_tqA2tIrIckGAffTgIkrA,1039
5
5
  matlab_proxy/default_configuration.py,sha256=DxQaHzAivzstiPl_nDfxs8SOyP9oaK9v3RP4LtroJl4,843
6
6
  matlab_proxy/devel.py,sha256=nR6XPVBUEdQ-RZGtYvX1YHTp8gj9cuw5Hp8ahasMBc8,14310
7
- matlab_proxy/settings.py,sha256=I4nvFZzACKx-JBlAFCFWHA60gg66bR4hrXj1f5awfbA,25616
7
+ matlab_proxy/settings.py,sha256=6KHKg96WjTz5xboBQllB6nDDTHhT9NBkWNGcWjwkJ6s,26096
8
8
  matlab_proxy/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  matlab_proxy/gui/asset-manifest.json,sha256=XqmLvi3DDOGSbBxNZwjuaNJXoYjZiG2HasxvZnEzPEo,3516
10
10
  matlab_proxy/gui/favicon.ico,sha256=7w7Ki1uQP2Rgwc64dOV4-NrTu97I3WsZw8OvRSoY1A0,130876
@@ -63,7 +63,7 @@ matlab_proxy/util/windows.py,sha256=J5O-wihOxEex43_AzwvFylNlN4hcZdO6KD5cpLv1FX8,
63
63
  matlab_proxy/util/mwi/__init__.py,sha256=zI-X1lafr8H3j17PyA0oSZ0q5nINfK-WDA7VmJKmSAQ,158
64
64
  matlab_proxy/util/mwi/custom_http_headers.py,sha256=kfDjSnEXEVzoF2pZuEn76LKayeD2WKoQEDu2Y9EMOAo,7154
65
65
  matlab_proxy/util/mwi/download.py,sha256=-GJj3yOsL4vF_9baqRXkgBI-vu_OwjZMQVkJXFS8GMc,4965
66
- matlab_proxy/util/mwi/environment_variables.py,sha256=SC5pMCs2EVWd9NrvA8yYbCOm998SXDhQCIG1h8Ilysc,7309
66
+ matlab_proxy/util/mwi/environment_variables.py,sha256=0B6rW1sMXGHmSTw6oPgOKz-QM40URIleO6d_zCTkkK8,7271
67
67
  matlab_proxy/util/mwi/exceptions.py,sha256=93HrHbOq24KI4Md2el23XN01wIqVShEK29Pbt2V0Jr8,4628
68
68
  matlab_proxy/util/mwi/logger.py,sha256=e7wTPclrtJ-aX5mPk_pUJMX7-1QD_snGBW1P2ks-ETE,3311
69
69
  matlab_proxy/util/mwi/token_auth.py,sha256=UbIWqo7qADaZdijFvorLYsZbxzaB8TycGP8nk305ru0,9997
@@ -104,9 +104,9 @@ tests/unit/util/mwi/embedded_connector/test_helpers.py,sha256=vYTWNUTuDeaygo16JG
104
104
  tests/unit/util/mwi/embedded_connector/test_request.py,sha256=PR-jddnXDEiip-lD7A_QSvRwEkwo3eQ8owZlk-r9vnk,1867
105
105
  tests/utils/__init__.py,sha256=ttzJ8xKWGxOJZz56qOiWOn6sp5LGomkZMn_w4KJLRMU,42
106
106
  tests/utils/logging_util.py,sha256=VBy_NRvwau3C_CVTBjK5RMROrQimnJYHO2U0aKSZiRw,2234
107
- matlab_proxy-0.18.1.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
108
- matlab_proxy-0.18.1.dist-info/METADATA,sha256=Q5A3PKIyRDzKYk96M5XLsxeh6vHUIl4mDubWPAQvock,10177
109
- matlab_proxy-0.18.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
110
- matlab_proxy-0.18.1.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
111
- matlab_proxy-0.18.1.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
112
- matlab_proxy-0.18.1.dist-info/RECORD,,
107
+ matlab_proxy-0.18.2.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
108
+ matlab_proxy-0.18.2.dist-info/METADATA,sha256=Jnbri3j-_H13v1Ly8LTT2vqwrm8SXPDpPkoQ9lZUvkE,10177
109
+ matlab_proxy-0.18.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
110
+ matlab_proxy-0.18.2.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
111
+ matlab_proxy-0.18.2.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
112
+ matlab_proxy-0.18.2.dist-info/RECORD,,