示例#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
文件: basic.py 项目: tgrosch/bacnet
    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
文件: cmd.py 项目: BoniLindsley/phile
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)