piwave 2.0.6__py3-none-any.whl → 2.0.7__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
@@ -49,8 +49,17 @@ class Log:
49
49
  'update': 'UPD',
50
50
  }
51
51
 
52
+ SILENT = False
53
+
54
+ @classmethod
55
+ def config(cls, silent: bool = False):
56
+ cls.SILENT = silent
57
+
52
58
  @classmethod
53
59
  def print(cls, message: str, style: str = '', icon: str = '', end: str = '\n'):
60
+
61
+ if cls.SILENT: return
62
+
54
63
  color = cls.COLORS.get(style, '')
55
64
  icon_char = cls.ICONS.get(icon, '')
56
65
  if icon_char:
@@ -111,6 +120,7 @@ class PiWave:
111
120
  pi: str = "FFFF",
112
121
  loop: bool = False,
113
122
  debug: bool = False,
123
+ silent: bool = False,
114
124
  on_track_change: Optional[Callable] = None,
115
125
  on_error: Optional[Callable] = None):
116
126
  """Initialize PiWave FM transmitter.
@@ -127,6 +137,8 @@ class PiWave:
127
137
  :type loop: bool
128
138
  :param debug: Enable debug logging
129
139
  :type debug: bool
140
+ :param silent: Removes every output log
141
+ :type silent: bool
130
142
  :param on_track_change: Callback function called when track changes
131
143
  :type on_track_change: Optional[Callable]
132
144
  :param on_error: Callback function called when an error occurs
@@ -159,12 +171,15 @@ class PiWave:
159
171
 
160
172
  self.temp_dir = tempfile.mkdtemp(prefix="piwave_")
161
173
  self.stream_process: Optional[subprocess.Popen] = None
174
+
175
+ Log.config(silent=silent)
162
176
 
163
177
  self.pi_fm_rds_path = self._find_pi_fm_rds_path()
164
178
 
165
179
  self._validate_environment()
166
180
 
167
181
  atexit.register(self.cleanup)
182
+
168
183
 
169
184
  Log.info(f"PiWave initialized - Frequency: {frequency}MHz, PS: {ps}, Loop: {loop}")
170
185
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: piwave
3
- Version: 2.0.6
3
+ Version: 2.0.7
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
@@ -122,6 +122,7 @@ To install PiWave manually, follow these steps:
122
122
  pi="ABCD",
123
123
  loop=True,
124
124
  debug=True,
125
+ silent=False,
125
126
  on_track_change=lambda file, index: print(f"Now playing: {file}"),
126
127
  on_error=lambda error: print(f"Error occurred: {error}")
127
128
  )
@@ -181,6 +182,7 @@ To install PiWave manually, follow these steps:
181
182
  - `pi`: Program Identifier (up to 4 characters, default: "FFFF").
182
183
  - `loop`: Whether to loop playback of files (default: False).
183
184
  - `debug`: Enable detailed debug logging (default: False).
185
+ - `silent`: Disables every log output (default: False).
184
186
  - `on_track_change`: Callback function when the track changes (default: None).
185
187
  - `on_error`: Callback function when an error occurs (default: None).
186
188
 
@@ -0,0 +1,7 @@
1
+ piwave/__init__.py,sha256=tAmruZvneieh6fgkf7chKzOX9Q6fEB-5Jt9FJ7Fl5xQ,74
2
+ piwave/piwave.py,sha256=GkhNuw_mZnEZbUf6AC4mx4QwYpeFsSDpj1RqXUTf3Ms,24613
3
+ piwave-2.0.7.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
4
+ piwave-2.0.7.dist-info/METADATA,sha256=7I5mVMuiAcAzklTaum2d7CqL_V4Z-urMPc6Vcgv4Cno,6845
5
+ piwave-2.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ piwave-2.0.7.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
7
+ piwave-2.0.7.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- piwave/__init__.py,sha256=tAmruZvneieh6fgkf7chKzOX9Q6fEB-5Jt9FJ7Fl5xQ,74
2
- piwave/piwave.py,sha256=SmBZmTW3NtJnHwCJcg1rLimSoYEOCZXRNrV7_3W5fPA,24307
3
- piwave-2.0.6.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
4
- piwave-2.0.6.dist-info/METADATA,sha256=ZLODMyeli7CeqRtkecDcDpBRXnXmZ5K8xaEVjc9NGmw,6768
5
- piwave-2.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- piwave-2.0.6.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
7
- piwave-2.0.6.dist-info/RECORD,,
File without changes