Пример #1
0
 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..."
Пример #2
0
 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..."
Пример #3
0
 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...')
Пример #4
0
    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
Пример #5
0
    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)
Пример #6
0
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()
Пример #7
0
 def postloop(self):
     """Finish up everything"""
     Cmd.postloop(self)  # Clean up command completion
     print("The application will now exit!")
Пример #8
0
 def postloop(self):
     self.save_history()
     Cmd.postloop(self)
Пример #9
0
 def postloop(self):
     Cmd.postloop(self)
Пример #10
0
 def postloop(self):
     """Finish up everything"""
     Cmd.postloop(self)
     print("The application will now exit!")
Пример #11
0
 def postloop(self):
     self.save_history()
     Cmd.postloop(self)
Пример #12
0
 def postloop(self):
     Cmd.postloop(self)