salabim 25.0.9.post0__py3-none-any.whl → 25.0.9.post2__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.
- salabim/salabim.py +25 -12
- {salabim-25.0.9.post0.dist-info → salabim-25.0.9.post2.dist-info}/METADATA +1 -1
- {salabim-25.0.9.post0.dist-info → salabim-25.0.9.post2.dist-info}/RECORD +5 -5
- {salabim-25.0.9.post0.dist-info → salabim-25.0.9.post2.dist-info}/WHEEL +1 -1
- {salabim-25.0.9.post0.dist-info → salabim-25.0.9.post2.dist-info}/top_level.txt +0 -0
salabim/salabim.py
CHANGED
@@ -57,8 +57,9 @@ Windows = sys.platform.startswith("win")
|
|
57
57
|
PyDroid = sys.platform == "linux" and any("pydroid" in v for v in os.environ.values())
|
58
58
|
PyPy = platform.python_implementation() == "PyPy"
|
59
59
|
Chromebook = "penguin" in platform.uname()
|
60
|
-
Xlwings="xlwings" in sys.
|
61
|
-
|
60
|
+
#Xlwings="xlwings" in sys.modules
|
61
|
+
Xlwings=sys.platform=="emscripten"
|
62
|
+
Embedded = False # (not ("__file__" in globals())) or ((sys.platform == "emscripten") and not Xlwings) # Python In Excel or pyoide (AnacondaCode or xlwings lite)
|
62
63
|
|
63
64
|
_color_name_to_ANSI = dict(
|
64
65
|
dark_black="\033[0;30m",
|
@@ -190,7 +191,7 @@ if Pythonista:
|
|
190
191
|
inf = float("inf")
|
191
192
|
nan = float("nan")
|
192
193
|
|
193
|
-
if Pythonista or Embedded:
|
194
|
+
if Pythonista or Embedded or Xlwings:
|
194
195
|
_yieldless = False
|
195
196
|
else:
|
196
197
|
_yieldless = True
|
@@ -228,6 +229,13 @@ def yieldless(value: bool = None) -> bool:
|
|
228
229
|
|
229
230
|
global _yieldless
|
230
231
|
if value is not None:
|
232
|
+
if value:
|
233
|
+
if Pythonista:
|
234
|
+
raise ValueError('yiedless mode is not allowed under Pythonista')
|
235
|
+
if Embedded:
|
236
|
+
raise ValueError('yiedless mode is not allowed under Python in Excel or Anaconda Code')
|
237
|
+
if Xlwings:
|
238
|
+
raise ValueError('yiedless mode is not allowed under xlwings lite')
|
231
239
|
_yieldless = value
|
232
240
|
return _yieldless
|
233
241
|
|
@@ -10551,7 +10559,7 @@ class Environment:
|
|
10551
10559
|
isdefault_env: bool = True,
|
10552
10560
|
retina: bool = False,
|
10553
10561
|
do_reset: bool = None,
|
10554
|
-
blind_animation: bool =
|
10562
|
+
blind_animation: bool = None,
|
10555
10563
|
yieldless: bool = None,
|
10556
10564
|
**kwargs,
|
10557
10565
|
):
|
@@ -10648,10 +10656,15 @@ class Environment:
|
|
10648
10656
|
self.stopped = False
|
10649
10657
|
self._paused = False
|
10650
10658
|
self.last_s0 = ""
|
10651
|
-
if Embedded:
|
10652
|
-
|
10659
|
+
if Embedded or Xlwings:
|
10660
|
+
if blind_animation is None:
|
10661
|
+
blind_animation=True
|
10662
|
+
if not blind_animation:
|
10663
|
+
raise ValueError("blind_animation may not be False under xlwings lite")
|
10653
10664
|
else:
|
10654
|
-
|
10665
|
+
if blind_animation is None:
|
10666
|
+
blind_animation=False
|
10667
|
+
self._blind_animation = blind_animation
|
10655
10668
|
|
10656
10669
|
if self._blind_animation:
|
10657
10670
|
with self.suppress_trace():
|
@@ -25137,7 +25150,7 @@ def _check_overlapping_parameters(obj, method_name0, method_name1,process=None):
|
|
25137
25150
|
|
25138
25151
|
@functools.lru_cache()
|
25139
25152
|
def _screen_dimensions():
|
25140
|
-
if Embedded:
|
25153
|
+
if Embedded or Xlwings:
|
25141
25154
|
return 1024, 768
|
25142
25155
|
if Pythonista:
|
25143
25156
|
screen_width, screen_height = ui.get_screen_size()
|
@@ -27165,7 +27178,7 @@ def _std_fonts():
|
|
27165
27178
|
|
27166
27179
|
|
27167
27180
|
def fonts():
|
27168
|
-
if Embedded:
|
27181
|
+
if Embedded or Xlwings:
|
27169
27182
|
return []
|
27170
27183
|
if not hasattr(fonts, "font_list"):
|
27171
27184
|
fonts.font_list = []
|
@@ -27438,7 +27451,7 @@ def can_animate(try_only: bool = True) -> bool:
|
|
27438
27451
|
except ImportError:
|
27439
27452
|
ImageGrab = None
|
27440
27453
|
|
27441
|
-
if not Pythonista and not (Embedded):
|
27454
|
+
if not Pythonista and not (Embedded or Xlwings):
|
27442
27455
|
from PIL import ImageTk
|
27443
27456
|
except ImportError:
|
27444
27457
|
if try_only:
|
@@ -27447,7 +27460,7 @@ def can_animate(try_only: bool = True) -> bool:
|
|
27447
27460
|
|
27448
27461
|
g.dummy_image = Image.new("RGBA", (1, 1), (0, 0, 0, 0))
|
27449
27462
|
|
27450
|
-
if not Pythonista and not (Embedded):
|
27463
|
+
if not Pythonista and not (Embedded or Xlwings):
|
27451
27464
|
if PyDroid:
|
27452
27465
|
if not g.tkinter_loaded:
|
27453
27466
|
if try_only:
|
@@ -27951,7 +27964,7 @@ def captured_stdout_as_file(file: Union[str, Path, "file"], mode: str = None):
|
|
27951
27964
|
file.write(captured_stdout_as_str())
|
27952
27965
|
|
27953
27966
|
|
27954
|
-
def captured_stdout_as_list(
|
27967
|
+
def captured_stdout_as_list() -> list:
|
27955
27968
|
"""
|
27956
27969
|
returns the captured stdout as a list of strings
|
27957
27970
|
|
@@ -3,8 +3,8 @@ salabim/LICENSE.txt,sha256=eTPlcDJz4G0096Qv-wfMjm1Wxbd4ilDlsYg5rN4HjWQ,1106
|
|
3
3
|
salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
|
4
4
|
salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
|
5
5
|
salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
|
6
|
-
salabim/salabim.py,sha256=
|
7
|
-
salabim-25.0.9.
|
8
|
-
salabim-25.0.9.
|
9
|
-
salabim-25.0.9.
|
10
|
-
salabim-25.0.9.
|
6
|
+
salabim/salabim.py,sha256=wNIHiSS93kWglqmU6jy6KQMZCLAUoaofvqsPUP_PvPE,1125989
|
7
|
+
salabim-25.0.9.post2.dist-info/METADATA,sha256=1OIHo3tsAKXsDxdo8x3g6_-fXs9Hhlvh0hYoECG3XPs,3405
|
8
|
+
salabim-25.0.9.post2.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
9
|
+
salabim-25.0.9.post2.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
|
10
|
+
salabim-25.0.9.post2.dist-info/RECORD,,
|
File without changes
|