salabim 24.0.14.post3__py3-none-any.whl → 24.0.14.post4__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
@@ -11803,8 +11803,7 @@ class Environment:
11803
11803
  for ao in an_objects:
11804
11804
  ao.make_pil_image(self.t())
11805
11805
  if ao._image_visible and (include_topleft or not ao.getattr("in_topleft", False)):
11806
- image.paste(ao._image, (int(ao._image_x), int(self._height - ao._image_y - ao._image.size[1])),ao._image.convert("RGBA"),)
11807
-
11806
+ image.paste(ao._image, (int(ao._image_x), int(self._height - ao._image_y - ao._image.size[1])), ao._image.convert("RGBA"))
11808
11807
 
11809
11808
  return image.convert(mode)
11810
11809
 
@@ -12779,6 +12778,31 @@ class Environment:
12779
12778
  self.animation_parameters(synced=value, animate=None)
12780
12779
  return self._synced
12781
12780
 
12781
+ def minimized(self, value: bool=None)-> bool:
12782
+ """
12783
+ minimized
12784
+
12785
+ Parameters
12786
+ ----------
12787
+ value : bool
12788
+ if True, minimize the curent animation window
12789
+
12790
+ if False, (re)show the current animation window
12791
+
12792
+ if None (default): no action
12793
+
12794
+ Returns
12795
+ -------
12796
+ current state of the animation window : bool
12797
+ True if current animation windows is minimized, False otherwise
12798
+ """
12799
+ if value is not None:
12800
+ if value:
12801
+ self.root.withdraw()
12802
+ else:
12803
+ self.root.deiconify()
12804
+ return not bool(self.root.winfo_viewable())
12805
+
12782
12806
  def speed(self, value: float = None) -> float:
12783
12807
  """
12784
12808
  speed
@@ -25386,6 +25410,11 @@ class Animate3dObj(Animate3dBase):
25386
25410
  ):
25387
25411
  super().__init__(visible=visible, arg=arg, layer=layer, parent=parent, env=env, **kwargs)
25388
25412
 
25413
+ global pywavefront
25414
+ global visualization
25415
+ global pyglet
25416
+
25417
+
25389
25418
  self.x = x
25390
25419
  self.y = y
25391
25420
  self.z = z
@@ -25407,18 +25436,26 @@ class Animate3dObj(Animate3dBase):
25407
25436
  self.y_offset = 0
25408
25437
  self.z_offset = 0
25409
25438
 
25410
- if "pywavefront" not in sys.modules:
25411
- global pywavefront
25412
- global visualization
25413
- try:
25414
- import pywavefront
25415
- from pywavefront import visualization
25416
- except ImportError:
25417
- pywavefront = None
25439
+ try:
25440
+ import pywavefront
25441
+ except ImportError:
25442
+ pywavefront=None
25443
+
25444
+ try:
25445
+ import pyglet # this is a requirement for visualization!
25446
+ except ImportError:
25447
+ pyglet=None
25448
+
25449
+ from pywavefront import visualization
25418
25450
 
25419
25451
  def draw(self, t):
25452
+ global pywavefront
25453
+ global visualization
25454
+ global pyglet
25420
25455
  if pywavefront is None:
25421
25456
  raise ImportError("Animate3dObj requires pywavefront. Not found")
25457
+ if pyglet is None:
25458
+ raise ImportError("Animate3dObj requires pyglet. Not found")
25422
25459
 
25423
25460
  obj_filename = Path(self.filename(t))
25424
25461
  if not obj_filename.suffix:
@@ -27163,17 +27200,23 @@ def can_animate3d(try_only: bool = True) -> bool:
27163
27200
  import OpenGL.GL as gl
27164
27201
  import OpenGL.GLU as glu
27165
27202
  import OpenGL.GLUT as glut
27203
+ import OpenGL
27166
27204
  except ImportError:
27167
27205
  if try_only:
27168
27206
  return False
27169
27207
  else:
27170
27208
  raise ImportError("OpenGL is required for animation3d. Install with pip install PyOpenGL or see salabim manual")
27209
+ try:
27210
+ glut.glutInit()
27211
+ except OpenGL.error.NullFunctionError:
27212
+ raise ImportError("Installed OpenGL does not support glut. Try 'pip install OpenGL-glut' or see the salabim documentation")
27213
+
27171
27214
  return True
27172
27215
  else:
27173
27216
  if try_only:
27174
27217
  return False
27175
27218
  else:
27176
- raise ImportError("cannot even animate, let alone animate3d")
27219
+ raise ImportError("cannot animate, let alone animate3d")
27177
27220
 
27178
27221
 
27179
27222
  def can_video(try_only: bool = True) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: salabim
3
- Version: 24.0.14.post3
3
+ Version: 24.0.14.post4
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
@@ -46,7 +46,7 @@ In contrast to some other Python DES packages, salabim does not require the use
46
46
  ### Features and documentation
47
47
 
48
48
  - Cross-platform support: salabim runs on Windows, macOS, Linux, iOS/iPadOS (Pythonista), and can even be used with "Python In Excel".
49
- - Comprehensive documentation: Visit [www.salabim.org/manual](www.salabim.org/manual) for detailed documentation.
49
+ - Comprehensive documentation: Visit [www.salabim.org/manual](https://www.salabim.org/manual) for detailed documentation.
50
50
 
51
51
  ### Resources
52
52
 
@@ -3,8 +3,8 @@ salabim/LICENSE.txt,sha256=qHlBa-POyexatCxDTjSKMlYtkBFQDn9lu-YV_1L6V0U,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=LkXx4KGzg9FaYfe4NUBb2Zm2Iy4v1B2kyHks7cwsWoI,1113664
7
- salabim-24.0.14.post3.dist-info/METADATA,sha256=4yHEwkcBMUAj2CtFsi3y4s7zkJTzSvLkkm0h3g6vgiI,3456
8
- salabim-24.0.14.post3.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
9
- salabim-24.0.14.post3.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
- salabim-24.0.14.post3.dist-info/RECORD,,
6
+ salabim/salabim.py,sha256=g2f1Dxf-6GkrS2AvM6EJhV7dta33KFqvsrdUKVUQYNI,1114883
7
+ salabim-24.0.14.post4.dist-info/METADATA,sha256=atwt9cNwaB9q37H5sqAzSRavt-KnAUuCRozQyUPRIXE,3464
8
+ salabim-24.0.14.post4.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
9
+ salabim-24.0.14.post4.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
+ salabim-24.0.14.post4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5