Bases: exceptions.Exception
Bases: opennode.oms.endpoint.ssh.cmdline.ArgumentParsingError
Bases: argparse.Action
Extends argparser with an action suited for key=value keyword arguments. Each arg declared with a KeywordAction, will be put inside a dictionary (by default called keywords) inside the resulting arg object.
This is particularly useful if you have a number of dynamically defined args which would otherwise end up in cluttering the resulting arg object without a clear way to enumerate them all.
You can override this grouping with the group parameter.
Bases: argparse.ArgumentParser
ArgumentParser subclass that raises an exception instead of exiting in case of errors, and allows all output to be redirected to a custom output stream.
Bases: argparse.Action
Custom argparse action which allows multiple occurrences of multivalued optional arguments, e.g. -x a b -x c d will yield [‘a’, ‘b’, ‘c’, ‘d’].
Bases: opennode.oms.endpoint.ssh.cmdline.VirtualConsoleArgumentParser
Use this if you want to avoid printing error messages and retry on partial arglists.
Bases: opennode.oms.endpoint.ssh.cmdline.InstrumentableArgumentParser
This parser avoids using the argparse help action, since it fires during the parsing, We want to pospone the handling of help until after the args are parsed.
Declares the existence of an argument without adding a requirement and an option string for it.
It’s useful for GroupDictAction argument or other actions where multiple arguments store in the same value. The dest attribute for declared arguments will have its default value even if no argument was defined or matched.
Returns a compact set of columns as a string with newlines for an array of strings.
Adapted from the routine of the same name inside cmd.py
mmikulicic: taken from http://pypi.python.org/pypi/columnize and adapted for strings containing ANSI escapes (should work mostly for colors).
horizontally or vertically.
2 4 ‘
- or arranged horizontally:
- [‘1’, ‘2,’, ‘3’, ‘4’] => ‘1 2
3 4 ‘
Each column is only as wide as necessary. By default, columns are separated by two spaces - one was not legible enough. Set “colsep” to adjust the string separate columns. Set `displaywidth’ to set the line width.
Normally, consecutive items go down from the top to bottom from the left-most column to the right-most. If “arrange_vertical” is set false, consecutive items will go across, left to right, top to bottom.
Bases: opennode.oms.endpoint.ssh.terminal.InteractiveTerminal
The OMS virtual console over SSH.
Accepts lines of input and writes them back to its connection. If a line consisting solely of “quit” is received, the connection is dropped.
Bases: grokcore.component.components.Subscription
Executes protocol async callbacks while buffering next keystrokes during the execution of the callback. After the callback finishes the buffered keystrokes will be replayed back, but currently only non-special characters are replayed, since special characters could trigger a reentrant here which would inject keystrokes out of order.
Bases: opennode.oms.endpoint.ssh.protocol.OmsShellProtocol
Bases: twisted.conch.ssh.session.SSHSession
Bases: twisted.conch.manhole_ssh.TerminalRealm
Bases: twisted.conch.manhole_ssh.TerminalSession
Bases: twisted.conch.recvline.HistoricRecvLine
Advanced interactive terminal. Handles history, line editing, killing/yanking, line movement.
Prompt handling is delegated to subclasses.
Handles a ‘form feed’ byte - generally used to request a screen refresh/redraw.
Deletes the rest of the line (from the cursor right), and keeps the content in the kill ring for future pastes.