def postloop(self): """Take care of any unfinished business. Despite the claims in the Cmd documentaion, Cmd.postloop() is not a stub. """ self.write_history() Cmd.postloop(self) ## Clean up command completion print "Exiting..."
def postloop(self): """ Take care of any unfinished business. Despite the claims in the Cmd documentaion, Cmd.postloop() is not a stub. """ Cmd.postloop(self) ## Clean up command completion print "Exiting..."
def postloop(self): ''' Take care of any unfinished business. Despite the claims in the Cmd documentation, Cmd.postloop() is not a stub. ''' Cmd.postloop(self) # Clean up command completion print('Exiting...')
def postloop(self): _Cmd.postloop(self) ## Clean up command completion try: readline.set_history_length(_MAX_HISTORY) readline.write_history_file(_HISTORY_FILE) except: # readline is returning Exception for some reason pass
def postloop(self): """ This function wraps up readline history after loop has finished. :return: None """ try: # store history readline.write_history_file(sys.argv[0] + '.history') except Exception as error: self._error("history error: %s\n" % error) # call predecessor function Cmd.postloop(self)
async def async_cmdloop_threaded_stdin(looping_cmd: cmd.Cmd) -> None: stdin = phile.asyncio.ThreadedTextIOBase(looping_cmd.stdin) stdout = looping_cmd.stdout looping_cmd.preloop() if looping_cmd.intro: await asyncio.to_thread(stdout.write, looping_cmd.intro) await asyncio.to_thread(stdout.flush) is_stopping = False while not is_stopping: await asyncio.to_thread(stdout.write, looping_cmd.prompt) await asyncio.to_thread(stdout.flush) try: next_command = await stdin.readline() except (EOFError, ValueError): next_command = "EOF\n" is_stopping = process_command(looping_cmd, next_command) looping_cmd.postloop()
def postloop(self): """Finish up everything""" Cmd.postloop(self) # Clean up command completion print("The application will now exit!")
def postloop(self): self.save_history() Cmd.postloop(self)
def postloop(self): Cmd.postloop(self)
def postloop(self): """Finish up everything""" Cmd.postloop(self) print("The application will now exit!")