MCPcopy Create free account
hub / github.com/audacity/audacity / write

Method write

scripts/piped-work/pipeclient.py:173–204  ·  view source on GitHub ↗

Write a command to _write_pipe. Parameters ---------- command : string The command to send to Audacity timer : bool, optional If true, time the execution of the command Example ------- write("GetInf

(self, command, timer=False)

Source from the content-addressed store, hash-verified

171 read_thread.start()
172
173 def write(self, command, timer=False):
174 """Write a command to _write_pipe.
175
176 Parameters
177 ----------
178 command : string
179 The command to send to Audacity
180 timer : bool, optional
181 If true, time the execution of the command
182
183 Example
184 -------
185 write("GetInfo: Type=Labels", timer=True):
186
187 """
188 self.timer = timer
189 print('Sending command:', command)
190 self._write_pipe.write(command + EOL)
191 # Check that read pipe is alive
192 if PipeClient.reader_pipe_broken.isSet():
193 sys.exit('PipeClient: Read-pipe error.')
194 try:
195 self._write_pipe.flush()
196 if self.timer:
197 self._start_time = time.time()
198 self.reply = ''
199 PipeClient.reply_ready.clear()
200 except IOError as err:
201 if err.errno == errno.EPIPE:
202 sys.exit('PipeClient: Write-pipe error.')
203 else:
204 raise
205
206 def _reader(self):
207 """Read FIFO in worker thread."""

Callers 6

mainFunction · 0.95
StartDownloadMethod · 0.45
UpdateManager.cppFile · 0.45
send_commandFunction · 0.45
sendCommandFunction · 0.45
send_commandFunction · 0.45

Calls 4

printFunction · 0.85
timeMethod · 0.80
flushMethod · 0.45
clearMethod · 0.45

Tested by 2

send_commandFunction · 0.36
send_commandFunction · 0.36