piwave 2.1.7__py3-none-any.whl → 2.1.8__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/backends/base.py CHANGED
@@ -232,9 +232,9 @@ class Backend(ABC):
232
232
  cmd = self.build_command(wav_file, loop)
233
233
  self.current_process = subprocess.Popen(
234
234
  cmd,
235
- stdout=subprocess.PIPE,
236
- stderr=subprocess.PIPE,
237
- preexec_fn=os.setpgrp()
235
+ stdout=subprocess.DEVNULL,
236
+ stderr=subprocess.DEVNULL,
237
+ stdin=subprocess.DEVNULL
238
238
  )
239
239
  return self.current_process
240
240
 
piwave/piwave.py CHANGED
@@ -2,11 +2,10 @@
2
2
  # Licensed under GPLv3.0, main GitHub repository at https://github.com/douxxtech/piwave/
3
3
  # piwave/piwave.py : main entry
4
4
 
5
+ import atexit
5
6
  import os
6
7
  import subprocess
7
- import signal
8
8
  import threading
9
- import time
10
9
 
11
10
  import tempfile
12
11
  import shutil
@@ -88,6 +87,7 @@ class PiWave:
88
87
  Log.config(silent=silent)
89
88
 
90
89
  self._validate_environment()
90
+ atexit.register(self._stop_curproc)
91
91
 
92
92
  discover_backends()
93
93
 
@@ -288,7 +288,8 @@ class PiWave:
288
288
  rds_info = f" (PS: {self.ps})" if self.backend.supports_rds and self.ps else ""
289
289
  Log.broadcast(f"Playing {wav_file} ({loop_status}) at {self.frequency}MHz{rds_info}")
290
290
 
291
- self.current_process = self.backend.play_file(wav_file, self.loop)
291
+ self.backend.play_file(wav_file, self.loop)
292
+ self.current_process = self.backend.current_process
292
293
 
293
294
  if self.on_track_change:
294
295
  self.on_track_change(wav_file)
@@ -301,7 +302,7 @@ class PiWave:
301
302
  self._stop_curproc()
302
303
  return False
303
304
 
304
- if self.current_process.poll() is not None:
305
+ if self.backend.current_process.poll() is not None:
305
306
  Log.error("Process ended unexpectedly while looping")
306
307
  return False
307
308
 
@@ -311,7 +312,7 @@ class PiWave:
311
312
  if self.stop_event.wait(timeout=0.1):
312
313
  self._stop_curproc()
313
314
  return False
314
- if not self.loop and self.current_process.poll() is not None:
315
+ if not self.loop and self.backend.current_process.poll() is not None:
315
316
  break
316
317
  return True
317
318
 
@@ -373,9 +374,8 @@ class PiWave:
373
374
  self.current_process = subprocess.Popen(
374
375
  cmd,
375
376
  stdin=subprocess.PIPE,
376
- stdout=subprocess.PIPE,
377
- stderr=subprocess.PIPE,
378
- preexec_fn=os.setpgrp()
377
+ stdout=subprocess.DEVNULL,
378
+ stderr=subprocess.DEVNULL
379
379
  )
380
380
  except Exception as e:
381
381
  Log.error(f"Failed to start live stream: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: piwave
3
- Version: 2.1.7
3
+ Version: 2.1.8
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
@@ -1,13 +1,13 @@
1
1
  piwave/__init__.py,sha256=jz2r-qclltKTxJjlGnqhAwIlUgjvRTR31f4hjTHP5NA,230
2
2
  piwave/__main__.py,sha256=-Z3RI7TiicE5UwWc4dZaHX82-MpwVXWkfMZXOC457_Q,4089
3
3
  piwave/logger.py,sha256=ipWzdNcEYob0xjXP8bbTq9enA3nryU-GKzAOKayRqlg,1149
4
- piwave/piwave.py,sha256=Pp5z-phr1rHJhmiTFeDYwSYVfNeK3yTsoZp2mtVRo2s,32239
4
+ piwave/piwave.py,sha256=6ns1VmQ8hZFwrI_8HTLwvSD_CwMCzzUWGqms0u1MKeQ,32293
5
5
  piwave/backends/__init__.py,sha256=DUbdyYf2V2XcDB05vmFWEkuJ292YTNiNJjzh1raJ5Cg,3756
6
- piwave/backends/base.py,sha256=NSxSvDkAcbgGcohU9LHVGpn2AdSW3XYM71PAdQXLKds,7811
6
+ piwave/backends/base.py,sha256=PJNXEEXZ8wgc343SO5FJ1oGOop--Y-7t01PUWSa5GuE,7818
7
7
  piwave/backends/fm_transmitter.py,sha256=Wzsoyi5hqLLZF5eNPmZ7WFvP27OMs2ywJlwrJVut-8w,1403
8
8
  piwave/backends/pi_fm_rds.py,sha256=VjcbFeje8LHVr4cBjlL36IcvA3WRfI1hHSGG2ui8Pb0,1467
9
- piwave-2.1.7.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
10
- piwave-2.1.7.dist-info/METADATA,sha256=BGga7VRHdaH2DBYBiA61Zd_6m-OaP7rD9wpSpF1rFjo,20890
11
- piwave-2.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- piwave-2.1.7.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
13
- piwave-2.1.7.dist-info/RECORD,,
9
+ piwave-2.1.8.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
10
+ piwave-2.1.8.dist-info/METADATA,sha256=eO1OgUr8q13UI5TVqcdzokAcUOZnh1WDFGXL5GtJItI,20890
11
+ piwave-2.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ piwave-2.1.8.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
13
+ piwave-2.1.8.dist-info/RECORD,,
File without changes