salabim 24.0.11__py3-none-any.whl → 24.0.11.post1__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 CHANGED
@@ -60,7 +60,7 @@ PyDroid = sys.platform == "linux" and any("pydroid" in v for v in os.environ.val
60
60
  PyPy = platform.python_implementation() == "PyPy"
61
61
  Chromebook = "penguin" in platform.uname()
62
62
  PythonInExcel = not ("__file__" in globals())
63
- AnacondaCode = "pyscript" in sys.modules
63
+ AnacondaCode = sys.platform=="emscripten"
64
64
 
65
65
 
66
66
  def a_log(*args):
@@ -151,9 +151,11 @@ if Pythonista:
151
151
  inf = float("inf")
152
152
  nan = float("nan")
153
153
 
154
- _yieldless = not Pythonista # True, unless running under Pythonista
155
-
156
-
154
+ if Pythonista or AnacondaCode or PythonInExcel:
155
+ _yieldless = False
156
+ else:
157
+ _yieldless=True
158
+
157
159
  class QueueFullError(Exception):
158
160
  pass
159
161
 
@@ -26942,6 +26944,7 @@ def reset() -> None:
26942
26944
  g.tkinter_loaded = "?"
26943
26945
  g.image_container_cache = {}
26944
26946
  g._default_cap_now = False
26947
+ g._captured_stdout=[]
26945
26948
 
26946
26949
  random_seed() # always start with seed 1234567
26947
26950
 
@@ -26999,15 +27002,11 @@ Environment.{name}.__doc__ = {name}.__doc__"""
26999
27002
  exec(f"Environment.{name}={name}")
27000
27003
 
27001
27004
 
27002
- _captured_store = []
27003
-
27004
-
27005
27005
  def clear_captured_stdout():
27006
27006
  """
27007
27007
  empties the captured stdout
27008
27008
  """
27009
- global _captured_store
27010
- _captured_store.clear()
27009
+ g._captured_stdout.clear()
27011
27010
 
27012
27011
 
27013
27012
  def captured_stdout_as_str() -> str:
@@ -27019,7 +27018,7 @@ def captured_stdout_as_str() -> str:
27019
27018
  captured stdout : str
27020
27019
  """
27021
27020
 
27022
- return "".join(_captured_store)
27021
+ return "".join(g._captured_stdout)
27023
27022
 
27024
27023
 
27025
27024
  def captured_stdout_as_file(file: Union[str, Path, "file"], mode: str = None):
@@ -27097,16 +27096,14 @@ class capture_stdout:
27097
27096
  sys.stdout = self.stdout
27098
27097
 
27099
27098
  def write(self, data):
27100
- global _captured_store
27101
- _captured_store.append(data)
27099
+ g._captured_stdout.append(data)
27102
27100
  if self.include_print:
27103
27101
  self.stdout.write(data)
27104
27102
 
27105
27103
  def flush(self):
27106
- global _captured_store
27107
27104
  if self.include_print:
27108
27105
  self.stdout.flush()
27109
- _captured_store.append("\n")
27106
+ g._captured_stdout.append("\n")
27110
27107
 
27111
27108
 
27112
27109
  class redirect_stdout:
@@ -27164,7 +27161,7 @@ class redirect_stdout:
27164
27161
  self.close()
27165
27162
 
27166
27163
  def write(self, data):
27167
- global _captured_store
27164
+ global _captured_stdout
27168
27165
  self.file.write(data)
27169
27166
  if self.include_print:
27170
27167
  self.stdout.write(data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: salabim
3
- Version: 24.0.11
3
+ Version: 24.0.11.post1
4
4
  Summary: salabim - discrete event simulation in Python
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://salabim.org
@@ -0,0 +1,10 @@
1
+ salabim/DejaVuSansMono.ttf,sha256=Z_oIXp5yp1Zaw2y2p3vaxwHhjHpG0MFbmwhxSh4aIEI,335068
2
+ salabim/LICENSE.txt,sha256=qHlBa-POyexatCxDTjSKMlYtkBFQDn9lu-YV_1L6V0U,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=8dANioKbD1covX06fZohLeNttQVbalrN6q8eODdZYTU,1097286
7
+ salabim-24.0.11.post1.dist-info/METADATA,sha256=g39m6E1GfEa8lmL3Ji7vWbz2MpGvYClI1oedRWT2zQc,3456
8
+ salabim-24.0.11.post1.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
9
+ salabim-24.0.11.post1.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
+ salabim-24.0.11.post1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (73.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- salabim/DejaVuSansMono.ttf,sha256=Z_oIXp5yp1Zaw2y2p3vaxwHhjHpG0MFbmwhxSh4aIEI,335068
2
- salabim/LICENSE.txt,sha256=qHlBa-POyexatCxDTjSKMlYtkBFQDn9lu-YV_1L6V0U,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=4_MnkDN-cbMTmgGsSe0GVWTMDO1Bwk9tzArOUmdx8Yg,1097327
7
- salabim-24.0.11.dist-info/METADATA,sha256=GvOkBsH4ol5LofjZg7u_Qe4ZakqGpoIULeHC676vAe0,3450
8
- salabim-24.0.11.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
9
- salabim-24.0.11.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
- salabim-24.0.11.dist-info/RECORD,,