piwave 2.1.2__py3-none-any.whl → 2.1.3__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.
piwave/piwave.py CHANGED
@@ -90,7 +90,6 @@ class PiWave:
90
90
  Log.config(silent=silent)
91
91
 
92
92
  self._validate_environment()
93
- atexit.register(self.cleanup)
94
93
 
95
94
  discover_backends()
96
95
 
@@ -465,11 +464,9 @@ class PiWave:
465
464
  def _stop_current_process(self):
466
465
  if self.current_process:
467
466
  try:
468
- Log.info("Stopping current process...")
469
467
  os.killpg(os.getpgid(self.current_process.pid), signal.SIGTERM)
470
468
  self.current_process.wait(timeout=5)
471
469
  except (ProcessLookupError, subprocess.TimeoutExpired):
472
- Log.warning("Forcing kill of current process")
473
470
  try:
474
471
  os.killpg(os.getpgid(self.current_process.pid), signal.SIGKILL)
475
472
  except ProcessLookupError:
@@ -505,11 +502,6 @@ class PiWave:
505
502
  self._log_debug("Playback worker finished")
506
503
 
507
504
 
508
- def _handle_interrupt(self, signum, frame):
509
- Log.warning("Interrupt received, stopping playback...")
510
- self.stop()
511
- os._exit(0)
512
-
513
505
  def play(self, source, sample_rate: int = 44100, channels: int = 2, chunk_size: int = 4096, blocking: bool = False):
514
506
  """Play audio from file or live source.
515
507
 
@@ -559,7 +551,8 @@ class PiWave:
559
551
  Example:
560
552
  >>> pw.stop()
561
553
  """
562
- if not self.is_playing and not self.is_live_streaming:
554
+
555
+ if not self.is_playing and not self.is_live_streaming and not self.current_process:
563
556
  return
564
557
 
565
558
  Log.warning("Stopping...")
@@ -825,8 +818,6 @@ class PiWave:
825
818
 
826
819
  Log.info("Cleanup completed")
827
820
 
828
- def __del__(self):
829
- self.cleanup()
830
821
 
831
822
  def send(self, file_path: str):
832
823
  """Alias for the play method.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: piwave
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: A python module to broadcast radio waves with your Raspberry Pi.
5
5
  Home-page: https://github.com/douxxtech/piwave
6
6
  Author: Douxx
@@ -518,8 +518,11 @@ status = pw.get_status()
518
518
  ##### `cleanup()`
519
519
  Clean up resources and temporary files.
520
520
 
521
+ > [!WARNING]
522
+ > Always clean up behind you! Dropped support of auto-cleanup on version > 2.1.2
523
+
521
524
  ```python
522
- pw.cleanup() # Called automatically on object destruction
525
+ pw.cleanup()
523
526
  ```
524
527
 
525
528
  ### Backend Management
@@ -1,13 +1,13 @@
1
1
  piwave/__init__.py,sha256=jz2r-qclltKTxJjlGnqhAwIlUgjvRTR31f4hjTHP5NA,230
2
2
  piwave/__main__.py,sha256=ygl6F8VmOZjsnnUbAbzLoA7_1qv18ruG6TW4EocSaQE,3927
3
3
  piwave/logger.py,sha256=lPG3cz3ByqC1p1UKpwlv3R9KgiAb0zzyu6c3bhTpST0,2766
4
- piwave/piwave.py,sha256=7gowAQxWco-ZYtf5O-8x1un0lCK4BeSkz1-gjwLpQF4,32750
4
+ piwave/piwave.py,sha256=f3v0n3RBr7sxQ7D1jXunAmplxe0D-6_mdaDLJmGwVpM,32423
5
5
  piwave/backends/__init__.py,sha256=DUbdyYf2V2XcDB05vmFWEkuJ292YTNiNJjzh1raJ5Cg,3756
6
6
  piwave/backends/base.py,sha256=amjdR3pwx-0XN2ngpwfYNt74j5kWrW1cI0zMOTMU-q8,7668
7
7
  piwave/backends/fm_transmitter.py,sha256=6CuYpkCgb40PEpemMlbTkQ6Gq8qFe3C1TSSLLnwXXX4,1338
8
8
  piwave/backends/pi_fm_rds.py,sha256=l1y9JUKjw-d9lh9X7HLQNEwbNVO-whYlzaYnqEfRviI,1429
9
- piwave-2.1.2.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
10
- piwave-2.1.2.dist-info/METADATA,sha256=xItxk81Sl2CLt2YIHw9kgG7Uv6oap_kqkQeDgReYnf0,20563
11
- piwave-2.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- piwave-2.1.2.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
13
- piwave-2.1.2.dist-info/RECORD,,
9
+ piwave-2.1.3.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
10
+ piwave-2.1.3.dist-info/METADATA,sha256=opQ0LdqJda66i1iaOGccjdw0gdZT9b7CKwDC1Ym_xWM,20612
11
+ piwave-2.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ piwave-2.1.3.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
13
+ piwave-2.1.3.dist-info/RECORD,,
File without changes