matlab-proxy 0.10.0__py3-none-any.whl → 0.10.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.

Potentially problematic release.


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

matlab_proxy/settings.py CHANGED
@@ -369,6 +369,14 @@ def get_matlab_settings():
369
369
  f"Set {mwi_env.get_env_name_custom_matlab_root()} to a valid MATLAB root path"
370
370
  )
371
371
 
372
+ mpa_flags = (
373
+ mwi_env.Experimental.get_mpa_flags()
374
+ if mwi_env.Experimental.is_mpa_enabled()
375
+ else ""
376
+ )
377
+ profile_matlab_startup = (
378
+ "-timing" if mwi_env.Experimental.is_matlab_startup_profiling_enabled() else ""
379
+ )
372
380
  return {
373
381
  "matlab_path": matlab_root_path,
374
382
  "matlab_version": matlab_version,
@@ -377,7 +385,10 @@ def get_matlab_settings():
377
385
  "-nosplash",
378
386
  *flag_to_hide_desktop,
379
387
  "-softwareopengl",
388
+ # " v=mvm ",
380
389
  *matlab_lic_mode,
390
+ *mpa_flags,
391
+ profile_matlab_startup,
381
392
  "-r",
382
393
  f"try; run('{matlab_startup_file}'); catch ME; disp(ME.message); end;",
383
394
  ],
@@ -1,9 +1,21 @@
1
- # Copyright (c) 2020-2023 The MathWorks, Inc.
1
+ # Copyright 2020-2023 The MathWorks, Inc.
2
2
  """This file lists and exposes the environment variables which are used by the integration."""
3
3
 
4
4
  import os
5
5
 
6
6
 
7
+ def _is_env_set_to_true(env_name: str) -> bool:
8
+ """Helper function that returns True if the environment variable specified is set to True.
9
+
10
+ Args:
11
+ env_name (str): Name of the environment variable to check the state for.
12
+
13
+ Returns:
14
+ bool: True if the value of the environment variable is a case insensitive match to the string "True"
15
+ """
16
+ return os.environ.get(env_name, "false").lower() == "true"
17
+
18
+
7
19
  def get_env_name_network_license_manager():
8
20
  """Specifies the path to valid license file or address of a network license server"""
9
21
  return "MLM_LICENSE_FILE"
@@ -20,19 +32,10 @@ def get_env_name_logging_level():
20
32
 
21
33
 
22
34
  def get_env_name_enable_web_logging():
23
- """wef > v0.2.10 Enable the logging of asyncio web traffic by setting to true"""
35
+ """Enable the logging of asyncio web traffic by setting to true"""
24
36
  return "MWI_ENABLE_WEB_LOGGING"
25
37
 
26
38
 
27
- def get_old_env_name_enable_web_logging():
28
- """
29
- Enable the logging of asyncio web traffic by setting to true
30
- This name is deprecated and was last published in version v0.2.10 of matlab-proxy.
31
- """
32
-
33
- return "MWI_WEB_LOGGING_ENABLED"
34
-
35
-
36
39
  def get_env_name_log_file():
37
40
  """Specifies a file into which logging content is directed"""
38
41
  return "MWI_LOG_FILE"
@@ -89,32 +92,17 @@ def get_env_name_matlab_tempdir():
89
92
 
90
93
  def is_development_mode_enabled():
91
94
  """Returns true if the app is in development mode."""
92
- return os.environ.get(get_env_name_development(), "false").lower() == "true"
95
+ return _is_env_set_to_true(get_env_name_development())
93
96
 
94
97
 
95
98
  def is_testing_mode_enabled():
96
99
  """Returns true if the app is in testing mode."""
97
- return (
98
- is_development_mode_enabled()
99
- and os.environ.get(get_env_name_testing(), "false").lower() == "true"
100
- )
100
+ return is_development_mode_enabled() and _is_env_set_to_true(get_env_name_testing())
101
101
 
102
102
 
103
103
  def is_web_logging_enabled():
104
104
  """Returns true if the web logging is required to be enabled"""
105
-
106
- if os.environ.get(get_old_env_name_enable_web_logging(), None) is not None:
107
- from matlab_proxy.util import mwi
108
-
109
- logger = mwi.logger.get()
110
- logger.warning(
111
- f"Usage of {get_old_env_name_enable_web_logging()} is being deprecated from v0.2.10 and will be removed in a future release.\n Use {get_env_name_enable_web_logging()} instead. "
112
- )
113
- return (
114
- os.environ.get(get_old_env_name_enable_web_logging(), "false").lower()
115
- == "true"
116
- )
117
- return os.environ.get(get_env_name_enable_web_logging(), "false").lower() == "true"
105
+ return _is_env_set_to_true(get_env_name_enable_web_logging())
118
106
 
119
107
 
120
108
  def get_env_name_ssl_cert_file():
@@ -155,3 +143,56 @@ def get_env_name_custom_matlab_root():
155
143
  def get_env_name_process_startup_timeout():
156
144
  """User specified timeout in seconds for processes launched by matlab-proxy"""
157
145
  return "MWI_PROCESS_START_TIMEOUT"
146
+
147
+
148
+ class Experimental:
149
+ """This class houses functions which are undocumented APIs and Environment variables.
150
+ Note: Never add any state to this class. Its only intended for use as an abstraction layer
151
+ for functions which are not ready for prime time.
152
+ """
153
+
154
+ @staticmethod
155
+ def get_env_name_enable_simulink():
156
+ """Returns the environment variable name used to enable simulink support"""
157
+ ##NOTE: Simulink Online is unavailable for general use as of R2023b.
158
+ return "MWI_ENABLE_SIMULINK"
159
+
160
+ @staticmethod
161
+ def is_simulink_enabled():
162
+ """Returns true if the simulink online is enabled."""
163
+ return _is_env_set_to_true(Experimental.get_env_name_enable_simulink())
164
+
165
+ @staticmethod
166
+ def should_use_mos_html():
167
+ """Returns true if matlab-proxy should use MOS htmls to load MATLAB"""
168
+ return _is_env_set_to_true("MWI_USE_MOS") or Experimental.is_simulink_enabled()
169
+
170
+ @staticmethod
171
+ def should_use_mre_html():
172
+ """Returns true if matlab-proxy should provide MRE parameter to the htmls used to load MATLAB"""
173
+ return _is_env_set_to_true("MWI_USE_MRE")
174
+
175
+ @staticmethod
176
+ def get_env_name_enable_mpa():
177
+ """Returns the environment variable name used to enable MPA support"""
178
+ return "MWI_ENABLE_MPA"
179
+
180
+ @staticmethod
181
+ def is_mpa_enabled():
182
+ """Returns true if the simulink online is enabled."""
183
+ return _is_env_set_to_true(Experimental.get_env_name_enable_mpa())
184
+
185
+ @staticmethod
186
+ def get_env_name_profile_matlab_startup():
187
+ """Returns the environment variable name used to enable MPA support"""
188
+ return "MWI_PROFILE_MATLAB_STARTUP"
189
+
190
+ @staticmethod
191
+ def is_matlab_startup_profiling_enabled():
192
+ """Returns true if the simulink online is enabled."""
193
+ return _is_env_set_to_true(Experimental.get_env_name_profile_matlab_startup())
194
+
195
+ @staticmethod
196
+ def get_mpa_flags():
197
+ """Returns list of flags required to enable MPA"""
198
+ return ["-webui", "-externalUI"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.10.0
3
+ Version: 0.10.1
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.
@@ -1,14 +1,14 @@
1
1
  matlab_proxy/__init__.py,sha256=6cwi8buKCMtw9OeWaOYUHEoqwl5MyJ_s6GxgNuqPuNg,1673
2
- matlab_proxy/app.py,sha256=RXb45AniSi-6iZTKEZzjjLin1IaIqKeLAgfelsw2WHU,28548
3
- matlab_proxy/app_state.py,sha256=f5il5N48iCkeMbmD--vDuT7Gw0AVXngd0ditAPV3uMU,53991
2
+ matlab_proxy/app.py,sha256=pMLiSfUbes04boTqjmmV2OZrzTmIJA5wtn5mK8jQAnY,28681
3
+ matlab_proxy/app_state.py,sha256=OXk7-SR83CSn-BlZflu679TwuPDjviA6Vta5FvZqEF0,54552
4
4
  matlab_proxy/constants.py,sha256=mtIZmO8MVbKoHqu0jTDB0R3c8tNw_2csm4dM0vNRDIE,620
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=ptd4Bjc7tI9OClpFtsJUxnkNxqqeFD1UlGZFGNoR2S8,19394
7
+ matlab_proxy/settings.py,sha256=FyctpBa9SaQEnItfFi6gF4SZ_d2Qm1ojonGug4bwRt4,19738
8
8
  matlab_proxy/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- matlab_proxy/gui/asset-manifest.json,sha256=VH6xUEv0Fy6ULD8Ov5BmUtYMwK_LzTxNiB6CD3oQYko,3516
9
+ matlab_proxy/gui/asset-manifest.json,sha256=ULnp89obzlSF90igCa2cFhgmBTKJwe4WOeBhrlydUjs,3516
10
10
  matlab_proxy/gui/favicon.ico,sha256=7w7Ki1uQP2Rgwc64dOV4-NrTu97I3WsZw8OvRSoY1A0,130876
11
- matlab_proxy/gui/index.html,sha256=N6vbd0aZL4jEvqGduPB3MxGyjcapXx7MBqp2lK2jX-M,637
11
+ matlab_proxy/gui/index.html,sha256=PGUXqpG-bX2JI35hPaOsauUR6y1z84AQJPQTkRwI-ik,637
12
12
  matlab_proxy/gui/manifest.json,sha256=NwDbrALM5auYyj2bbEf4aGwAUDqNl1FzMFQpPiG2Ty4,286
13
13
  matlab_proxy/gui/robots.txt,sha256=kNJLw79pisHhc3OVAimMzKcq3x9WT6sF9IS4xI0crdI,67
14
14
  matlab_proxy/gui/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -16,9 +16,9 @@ matlab_proxy/gui/static/css/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
16
16
  matlab_proxy/gui/static/css/main.aa888962.css,sha256=pIXlQZlx2Xn0N5a7Wvh9UBBrKOZr0DOr9eEzmEAbAeM,274104
17
17
  matlab_proxy/gui/static/css/main.aa888962.css.map,sha256=8he7DI95fPkvfLbdbx77QEcqFjuNBz4YpX3HDzFNNGw,350274
18
18
  matlab_proxy/gui/static/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- matlab_proxy/gui/static/js/main.daea642c.js,sha256=5T2DwlpYAIwAWwzwAqR2lagRAZVqugzxUjdsy_pUebI,288122
20
- matlab_proxy/gui/static/js/main.daea642c.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
21
- matlab_proxy/gui/static/js/main.daea642c.js.map,sha256=-8rEAjFDDyEl1l7MGz5L7zuG89fihKyoNYQiXdRSAXU,911352
19
+ matlab_proxy/gui/static/js/main.fbc5c728.js,sha256=CTUnx095f0hFy9BKYU_IokVIRoIrNwu3BFVfWNzpmLo,288746
20
+ matlab_proxy/gui/static/js/main.fbc5c728.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
21
+ matlab_proxy/gui/static/js/main.fbc5c728.js.map,sha256=6JF-lxxluIkr1Cc8Teyf9SUzFfKBup1IV13KFuuxGac,913905
22
22
  matlab_proxy/gui/static/media/MATLAB-env-blur.4fc94edbc82d3184e5cb.png,sha256=QpmQTLDvBu2-b7ev83Rvpt0Q72R6wdQGkuJMPPpjv7M,220290
23
23
  matlab_proxy/gui/static/media/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  matlab_proxy/gui/static/media/arrow.0c2968b90bd9a64c8c3f.svg,sha256=XtmvDWzGZnwCZm08TKBnqt5hc1wphJnNupG0Fx_faAY,327
@@ -61,7 +61,7 @@ matlab_proxy/util/system.py,sha256=XoT3Rv5MwPkdfhk2oMvUwxxlzZmADMlxzi9IRQyGgbA,1
61
61
  matlab_proxy/util/windows.py,sha256=R9-VA7f0snVanSR7IgbHz3kvSnthZuUYe2UhBd5QWMQ,3440
62
62
  matlab_proxy/util/mwi/__init__.py,sha256=zI-X1lafr8H3j17PyA0oSZ0q5nINfK-WDA7VmJKmSAQ,158
63
63
  matlab_proxy/util/mwi/custom_http_headers.py,sha256=kfDjSnEXEVzoF2pZuEn76LKayeD2WKoQEDu2Y9EMOAo,7154
64
- matlab_proxy/util/mwi/environment_variables.py,sha256=tb1aoqxbI8BjGg9pqc0XTY-6NCVXOih_2GHAc2tmrqM,4961
64
+ matlab_proxy/util/mwi/environment_variables.py,sha256=BrG7FeXZ3nTE7BGFmItdNXRYpcfRMdIBaJCvj8llle0,6554
65
65
  matlab_proxy/util/mwi/exceptions.py,sha256=93HrHbOq24KI4Md2el23XN01wIqVShEK29Pbt2V0Jr8,4628
66
66
  matlab_proxy/util/mwi/logger.py,sha256=e7wTPclrtJ-aX5mPk_pUJMX7-1QD_snGBW1P2ks-ETE,3311
67
67
  matlab_proxy/util/mwi/token_auth.py,sha256=2HiLmfvi_ejTJAEyV0_Unt-CK_osZTwfROp6yQ6SGfY,9844
@@ -69,9 +69,9 @@ matlab_proxy/util/mwi/validators.py,sha256=Do0w8pjzCpYg9EiWqUtDojnBw8iwqkMR7K3ZQ
69
69
  matlab_proxy/util/mwi/embedded_connector/__init__.py,sha256=SVSckEJ4zQQ2KkNPT_un8ndMAImcMOTrai7ShAbmFY4,114
70
70
  matlab_proxy/util/mwi/embedded_connector/helpers.py,sha256=SfrwpCnZ6QGJBko-sR2bIG4-_qZOn29zCZV9qwVBnkM,3395
71
71
  matlab_proxy/util/mwi/embedded_connector/request.py,sha256=0NyfnE7-0g3BBPTPmjbkDrTOGiTNqFDrqKDObcRc2Jw,3716
72
- matlab_proxy-0.10.0.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
73
- matlab_proxy-0.10.0.dist-info/METADATA,sha256=luuD7KIiwtOWRz7QiSQv5WncsuPU2UeYjXwToqPwGXc,9780
74
- matlab_proxy-0.10.0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
75
- matlab_proxy-0.10.0.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
76
- matlab_proxy-0.10.0.dist-info/top_level.txt,sha256=3-Lxje1LZvSfK__TVoRksU4th_PCj6cMMJwhH8P0_3I,13
77
- matlab_proxy-0.10.0.dist-info/RECORD,,
72
+ matlab_proxy-0.10.1.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
73
+ matlab_proxy-0.10.1.dist-info/METADATA,sha256=cgDn7iW9yn-jCdRhfdspK5Ne7Xj1NM3aZIMBFJNXs-k,9780
74
+ matlab_proxy-0.10.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
75
+ matlab_proxy-0.10.1.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
76
+ matlab_proxy-0.10.1.dist-info/top_level.txt,sha256=3-Lxje1LZvSfK__TVoRksU4th_PCj6cMMJwhH8P0_3I,13
77
+ matlab_proxy-0.10.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.3)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5