salabim 25.0.9__py3-none-any.whl → 25.0.9.post0__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 +16 -16
- {salabim-25.0.9.dist-info → salabim-25.0.9.post0.dist-info}/METADATA +1 -1
- salabim-25.0.9.post0.dist-info/RECORD +10 -0
- {salabim-25.0.9.dist-info → salabim-25.0.9.post0.dist-info}/WHEEL +1 -1
- salabim-25.0.9.dist-info/RECORD +0 -10
- {salabim-25.0.9.dist-info → salabim-25.0.9.post0.dist-info}/top_level.txt +0 -0
salabim/salabim.py
CHANGED
@@ -57,8 +57,8 @@ 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
|
-
|
61
|
-
|
60
|
+
Xlwings="xlwings" in sys.path
|
61
|
+
Embedded = (not ("__file__" in globals())) or ((sys.platform == "emscripten") and not Xlwings) # Python In Excel or pyoide (AnacondaCode or xlwings lite)
|
62
62
|
|
63
63
|
_color_name_to_ANSI = dict(
|
64
64
|
dark_black="\033[0;30m",
|
@@ -115,7 +115,7 @@ def a_log(*args):
|
|
115
115
|
class g: ...
|
116
116
|
|
117
117
|
|
118
|
-
if
|
118
|
+
if Embedded:
|
119
119
|
_pie_result = []
|
120
120
|
|
121
121
|
def pie_result():
|
@@ -190,7 +190,7 @@ if Pythonista:
|
|
190
190
|
inf = float("inf")
|
191
191
|
nan = float("nan")
|
192
192
|
|
193
|
-
if Pythonista or
|
193
|
+
if Pythonista or Embedded:
|
194
194
|
_yieldless = False
|
195
195
|
else:
|
196
196
|
_yieldless = True
|
@@ -10648,7 +10648,7 @@ class Environment:
|
|
10648
10648
|
self.stopped = False
|
10649
10649
|
self._paused = False
|
10650
10650
|
self.last_s0 = ""
|
10651
|
-
if
|
10651
|
+
if Embedded:
|
10652
10652
|
self._blind_animation = True
|
10653
10653
|
else:
|
10654
10654
|
self._blind_animation = blind_animation
|
@@ -11945,7 +11945,7 @@ class Environment:
|
|
11945
11945
|
if self._video_pingpong:
|
11946
11946
|
self._images.extend(self._images[::-1])
|
11947
11947
|
if self._video_repeat == 1: # in case of repeat == 1, loop should not be specified (otherwise, it might show twice)
|
11948
|
-
if
|
11948
|
+
if Embedded:
|
11949
11949
|
with b64_file_handler(self._video_name, mode="b", result=_pie_result) as f:
|
11950
11950
|
self._images[0].save(
|
11951
11951
|
f,
|
@@ -11972,7 +11972,7 @@ class Environment:
|
|
11972
11972
|
self._images = [image.convert("RGB") for image in self._images]
|
11973
11973
|
|
11974
11974
|
else:
|
11975
|
-
if
|
11975
|
+
if Embedded:
|
11976
11976
|
with b64_file_handler(self._video_name, mode="b", result=_pie_result) as f:
|
11977
11977
|
self._images[0].save(
|
11978
11978
|
f,
|
@@ -13589,7 +13589,7 @@ class Environment:
|
|
13589
13589
|
mode = "RGB"
|
13590
13590
|
else:
|
13591
13591
|
raise ValueError("extension " + extension + " not supported")
|
13592
|
-
if
|
13592
|
+
if Embedded:
|
13593
13593
|
with b64_file_handler(str(filename), mode="b", result=_pie_result) as f:
|
13594
13594
|
format = "jpeg" if extension == ".jpg" else extension[1:]
|
13595
13595
|
self._capture_image(mode, video_mode).save(f, format=format)
|
@@ -14606,15 +14606,15 @@ class Environment:
|
|
14606
14606
|
note that the header is only printed if trace=True
|
14607
14607
|
"""
|
14608
14608
|
len_s1 = len(self.time_to_str(0))
|
14609
|
-
self.print_trace((len_s1 - 4) * " " + "time", "current component", "action", "information", "" if (
|
14610
|
-
self.print_trace(len_s1 * "-", 20 * "-", 35 * "-", 48 * "-", "" if (
|
14609
|
+
self.print_trace((len_s1 - 4) * " " + "time", "current component", "action", "information", "" if (Embedded) else "line#")
|
14610
|
+
self.print_trace(len_s1 * "-", 20 * "-", 35 * "-", 48 * "-", "" if (Embedded) else 6 * "-")
|
14611
14611
|
for ref in range(len(self._source_files)):
|
14612
14612
|
for fullfilename, iref in self._source_files.items():
|
14613
14613
|
if ref == iref:
|
14614
14614
|
self._print_legend(iref)
|
14615
14615
|
|
14616
14616
|
def _print_legend(self, ref):
|
14617
|
-
if
|
14617
|
+
if Embedded:
|
14618
14618
|
return
|
14619
14619
|
if ref:
|
14620
14620
|
s = "line numbers prefixed by " + chr(ord("A") + ref - 1) + " refer to"
|
@@ -14632,7 +14632,7 @@ class Environment:
|
|
14632
14632
|
return self.filename_lineno_to_str(frameinfo.filename, frameinfo.lineno)
|
14633
14633
|
|
14634
14634
|
def filename_lineno_to_str(self, filename, lineno):
|
14635
|
-
if
|
14635
|
+
if Embedded:
|
14636
14636
|
return "n/a"
|
14637
14637
|
if Path(filename).name == Path(__file__).name: # internal salabim address
|
14638
14638
|
return "n/a"
|
@@ -25137,7 +25137,7 @@ def _check_overlapping_parameters(obj, method_name0, method_name1,process=None):
|
|
25137
25137
|
|
25138
25138
|
@functools.lru_cache()
|
25139
25139
|
def _screen_dimensions():
|
25140
|
-
if
|
25140
|
+
if Embedded:
|
25141
25141
|
return 1024, 768
|
25142
25142
|
if Pythonista:
|
25143
25143
|
screen_width, screen_height = ui.get_screen_size()
|
@@ -27165,7 +27165,7 @@ def _std_fonts():
|
|
27165
27165
|
|
27166
27166
|
|
27167
27167
|
def fonts():
|
27168
|
-
if
|
27168
|
+
if Embedded:
|
27169
27169
|
return []
|
27170
27170
|
if not hasattr(fonts, "font_list"):
|
27171
27171
|
fonts.font_list = []
|
@@ -27438,7 +27438,7 @@ def can_animate(try_only: bool = True) -> bool:
|
|
27438
27438
|
except ImportError:
|
27439
27439
|
ImageGrab = None
|
27440
27440
|
|
27441
|
-
if not Pythonista and not (
|
27441
|
+
if not Pythonista and not (Embedded):
|
27442
27442
|
from PIL import ImageTk
|
27443
27443
|
except ImportError:
|
27444
27444
|
if try_only:
|
@@ -27447,7 +27447,7 @@ def can_animate(try_only: bool = True) -> bool:
|
|
27447
27447
|
|
27448
27448
|
g.dummy_image = Image.new("RGBA", (1, 1), (0, 0, 0, 0))
|
27449
27449
|
|
27450
|
-
if not Pythonista and not (
|
27450
|
+
if not Pythonista and not (Embedded):
|
27451
27451
|
if PyDroid:
|
27452
27452
|
if not g.tkinter_loaded:
|
27453
27453
|
if try_only:
|
@@ -0,0 +1,10 @@
|
|
1
|
+
salabim/DejaVuSansMono.ttf,sha256=Z_oIXp5yp1Zaw2y2p3vaxwHhjHpG0MFbmwhxSh4aIEI,335068
|
2
|
+
salabim/LICENSE.txt,sha256=eTPlcDJz4G0096Qv-wfMjm1Wxbd4ilDlsYg5rN4HjWQ,1106
|
3
|
+
salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
|
4
|
+
salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
|
5
|
+
salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
|
6
|
+
salabim/salabim.py,sha256=xhJYFXHhW7tgkivID6pKL1sAG43F-sQK-CxfRX8U73o,1125271
|
7
|
+
salabim-25.0.9.post0.dist-info/METADATA,sha256=QAVd2_PWiTB9aP53ioD2fnXbuxwuhb7BT7LhCQZKuCk,3405
|
8
|
+
salabim-25.0.9.post0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
9
|
+
salabim-25.0.9.post0.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
|
10
|
+
salabim-25.0.9.post0.dist-info/RECORD,,
|
salabim-25.0.9.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
salabim/DejaVuSansMono.ttf,sha256=Z_oIXp5yp1Zaw2y2p3vaxwHhjHpG0MFbmwhxSh4aIEI,335068
|
2
|
-
salabim/LICENSE.txt,sha256=eTPlcDJz4G0096Qv-wfMjm1Wxbd4ilDlsYg5rN4HjWQ,1106
|
3
|
-
salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
|
4
|
-
salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
|
5
|
-
salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
|
6
|
-
salabim/salabim.py,sha256=vSMVcWlHrZKShotu15QJ_THLqTUbheGw5gsLnoDhca0,1125470
|
7
|
-
salabim-25.0.9.dist-info/METADATA,sha256=cJClhCPVdf31-iu49ZJwLmP1u43l6MFBUZBesLrf92s,3399
|
8
|
-
salabim-25.0.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
9
|
-
salabim-25.0.9.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
|
10
|
-
salabim-25.0.9.dist-info/RECORD,,
|
File without changes
|