Did I find the right examples for you? yes no

All Samples(23)  |  Call(18)  |  Derive(0)  |  Import(5)

        def _print(msg):
    line_buffer = readline.get_line_buffer()
    # Clearing prompt
    sys.stdout.write("\r")
    sys.stdout.write("\033[K")
    sys.stdout.write(str(msg))
    # Restoring prompt
    sys.stdout.write("\n%s" % ishell._current_prompt)
    if line_buffer:
        sys.stdout.write(" %s" % line_buffer)
    sys.stdout.flush()
        


src/i/s/ishell-HEAD/examples/cisco.py   ishell(Download)
from ishell.command import Command
from ishell.console import Console
from ishell.utils import _print
 
import getpass
    def set_address(self, line):
        addr = line.split()[-1]
        _print("Setting interface %s address %s" % (self.interface, addr))
 
 
    def run(self, line):
        _print("Route added!")
 
 
class ConfigureTerminal(Command):
    def run(self, line):
        arg = line.split()[-1]
        if arg not in self.args():
            _print("%% Invalid argument: %s" % arg)
            _print("\tUse:")

src/i/s/ishell-HEAD/ishell/command.py   ishell(Download)
from ishell import logger
from ishell.console import Console
from ishell.utils import _print
 
__all__ = ["Command"]
        if len(completions) > 2 and state == 0 and not buf:
            logger.debug("Showing all completions...")
            _print("Possible Completions:")
            for child in self.childs.keys():
                _print("  %s%s" % (child.ljust(16), self.childs[child].help))
            return None
        return completions[state]
 
    def run(self, line):
        _print("Exec %s(line=%s), overwrite this method!" % (self.name, line))

src/i/s/ishell-0.1.1/ishell/command.py   ishell(Download)
from ishell import logger
from ishell.console import Console
from ishell.utils import _print
 
__all__ = ["Command"]
        if len(completions) > 2 and state == 0 and not buf:
            logger.debug("Showing all completions...")
            _print("Possible Completions:")
            for child in self.childs.keys():
                _print("  %s%s" % (child.ljust(16), self.childs[child].help))
            return None
        return completions[state]
 
    def run(self, line):
        _print("Exec %s(line=%s), overwrite this method!" % (self.name, line))

src/i/s/ishell-HEAD/ishell/log.py   ishell(Download)
# -*- coding: utf-8 -*-
 
 
from ishell.utils import _print
import logging
 
 
class ConsoleLogHandler(logging.StreamHandler):
    def emit(self, record):
        _print(self.format(record))

src/i/s/ishell-0.1.1/ishell/log.py   ishell(Download)
# -*- coding: utf-8 -*-
 
 
from ishell.utils import _print
import logging
 
 
class ConsoleLogHandler(logging.StreamHandler):
    def emit(self, record):
        _print(self.format(record))