Пример #1
0
def send_command(session, command: str, prompt=r"\S+#"):
    return sendcmd(
        session,
        command,
        prompt,
        expect_command=False,
        space_prompt=
        r"-- MORE --, next page: Space, next line: Enter, quit: Control-C")
Пример #2
0
def send_command(session,
                 command: str,
                 prompt: str = r'\S+#\s*$',
                 next_catch: str = None):
    return sendcmd(session,
                   command,
                   prompt,
                   space_prompt=r'Press any key to continue \(Q to quit\)',
                   before_catch=next_catch)
Пример #3
0
def send_command(session,
                 command: str,
                 prompt: str = r'\S+#$',
                 next_catch: str = None):
    return sendcmd(session,
                   command,
                   prompt,
                   space_prompt='---More---',
                   before_catch=next_catch)
Пример #4
0
def send_command(session,
                 command: str,
                 prompt: str = r'\S+\s*#\s*$',
                 next_catch: str = None) -> str:
    return sendcmd(session,
                   command,
                   prompt,
                   space_prompt="Press <SPACE> to continue or <Q> to quit:",
                   before_catch=next_catch)
Пример #5
0
def send_command(session,
                 command: str,
                 prompt: str = r'\S+#\s*$',
                 next_catch: str = None):
    return sendcmd(
        session,
        command,
        prompt,
        space_prompt=r"More: <space>,  Quit: q or CTRL\+Z, One line: <return> |"
        r"More\? Enter - next line; Space - next page; Q - quit; R - show the rest\.",
        before_catch=next_catch)
Пример #6
0
def send_command(session, command: str, prompt: str = r'\S+#\s*$', next_catch: str = None):
    return sendcmd(session, command, prompt, space_prompt=r'More: <space>,  Quit: q, One line: <return> ',
                   before_catch=next_catch)
Пример #7
0
def send_command(session, command: str, next_catch=None):
    return sendcmd(session,
                   command,
                   prompt=r'\S+\(cfg\)#|\S+>',
                   space_prompt="----- more -----",
                   before_catch=next_catch)
Пример #8
0
def send_command(session, command: str, privilege_mode_password: str, prompt: str = r'\S+#', next_catch: str = None):
    if not enable_admin(session, privilege_mode_password):
        return ''
    return sendcmd(session, command, prompt, before_catch=next_catch)