Best Python code snippet using localstack_python
tail.py
Source:tail.py
...16 self.thread: Optional[FuncThread] = None17 self.started = threading.Event()18 self.use_tail_command = not is_windows() and is_command_available("tail")19 def start(self):20 self.thread = self._do_start_thread()21 self.started.wait()22 if self.thread.result_future.done():23 # this will re-raise exceptions from the run command that occurred before started was set24 self.thread.result_future.result()25 def join(self, timeout=None):26 if self.thread:27 self.thread.join(timeout=timeout)28 def close(self):29 if self.thread and self.thread.running:30 self.thread.stop()31 self.started.clear()32 self.thread = None33 def _do_start_thread(self) -> FuncThread:34 if self.use_tail_command:35 thread = self._create_tail_command_thread()36 thread.start()37 thread.started.wait(5)38 self.started.set()39 else:40 thread = self._create_tailer_thread()41 thread.start()42 return thread43 def _create_tail_command_thread(self) -> ShellCommandThread:44 def _log_listener(line, *args, **kwargs):45 try:46 self.callback(line.rstrip("\r\n"))47 except Exception:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!