Module ImportFrom alias Import alias Import alias Import alias Import alias Import alias Assign TupleStore NameStore NameStore Call NameLoad Num Assign NameStore Call NameLoad Str ListLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str For NameStore NameLoad body Assign TupleStore NameStore NameStore NameStore NameLoad AugAssignAdd NameStore BinOpAdd Call AttributeLoad Str attr NameLoad Str If NameLoad body AugAssignAdd NameStore BinOpAdd NameLoad Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str NameLoad Str Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Str body Expr Str Assign AttributeStore NameLoad attr NameLoad If Call NameLoad NameLoad BinOpAdd NameLoad Str body Assign AttributeStore NameLoad attr Call NameLoad NameLoad BinOpAdd NameLoad Str orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad Num body Return Call AttributeLoad NameLoad attr ListLoad Assign NameStore SubscriptLoad NameLoad Index Num If CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr If CompareIn NameLoad AttributeLoad NameLoad attr body Return Call Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Slice Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Return Str If CompareEq AttributeLoad NameLoad attr NameLoad body If CompareIn Call NameLoad AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr body Return Call NameLoad AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad For NameStore NameLoad body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body AugAssignAdd NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd Str Call AttributeLoad NameLoad attr NameLoad orelse AugAssignAdd NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return NameLoad orelse Return Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareEq AttributeLoad NameLoad attr NameLoad body TryExcept body Return Call NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Return Call NameLoad NameLoad Call NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad If BoolOpOr AttributeLoad NameLoad attr CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr keyword NameLoad If BoolOpOr NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad Return TupleLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Return TupleLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr orelse Return TupleLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad AttributeLoad NameLoad attr orelse Return ListLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call SubscriptLoad AttributeLoad NameLoad attr Index NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Assign TupleStore NameStore NameStore NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str If CompareEq NameLoad Str body If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad CompareNotIn NameLoad NameLoad orelse Assign NameStore Call NameLoad ListComp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareNotIn NameLoad NameLoad Return NameLoad orelse Raise Call NameLoad Str decorator_list NameLoad decorator_list ClassDef bases NameLoad body Pass decorator_list
N/A collections namedtuple N/A json N/A logging N/A pprint N/A re N/A six N/A N/A STATUS_OK STATUS_ERROR N/A range 2 N/A CommandsResponse N/A namedtuple CommandsResponse N/A status value N/A LOG N/A N/A logging getLogger bgpspeaker.operator.command default_help_formatter N/A N/A quick_helps N/A N/A N/A Apply default formatting for help messages

        :param quick_helps: list of tuples containing help info
      N/A ret N/A line quick_helps N/A N/A N/A cmd_path param_hlp cmd_hlp line N/A ret N/A N/A N/A join cmd_path N/A param_hlp N/A N/A ret N/A param_hlp N/A ret N/A N/A -  cmd_hlp N/A ret N/A Command N/A object N/A N/A Command class is used as a node in tree of commands.

    Each command can do some action or have some sub-commands, just like in IOS
    Command with it's sub-commands form tree.
    Each command can have one or more parameters. Parameters have to be
    distinguishable from sub-commands.
        One can inject dependency into command Cmd(api=my_object).
    This dependency will be injected to every sub-command. And can be used
    to interact with model/data etc.
        Example of path in command tree `show count all`.
     N/A help_msg N/A param_help_msg N/A command N/A cli_resp_line_template {0}: {1}
 __init__ N/A N/A self api parent help_formatter resp_formatter_name N/A None None default_help_formatter cli N/A N/A :param api: object which is saved as self.api
                 and re-injected to every sub-command. You can use it to
                 manipulate your model from inside Commands'
           :param parent: parent command instance.
           :param help_formatter: function used to format
                output of '?'command. Is re-injected to every
                sub-command as well.
           :param resp_formatter_name: used to select function to format
                output of _action. cli_resp_formatter and json_resp_formatter
                are defined by default, but you can define your own formatters.
                If you use custom formatter(not cli nor json) remember to
                implement it for every sub-command.
         N/A N/A self resp_formatter_name resp_formatter_name N/A N/A hasattr self N/A resp_formatter_name _resp_formatter N/A N/A N/A self resp_formatter N/A getattr self N/A resp_formatter_name _resp_formatter N/A N/A N/A self resp_formatter N/A self cli_resp_formatter N/A N/A self api api N/A N/A self parent_cmd parent N/A N/A self help_formatter help_formatter N/A N/A N/A hasattr self subcommands N/A N/A N/A self subcommands N/A N/A __call__ N/A N/A self params N/A N/A N/A You run command by calling it.

        :param params: As params you give list of subcommand names
            and params to final subcommand. Kind of like in
            cisco ios cli, ie. show int eth1 / 1, where show is command,
            int subcommand and eth1 / 1 is param for subcommand.
        :return: returns tuple of CommandsResponse and class of
            sub - command on which _action was called. (last sub - command)
            CommandsResposne.status is action status,
            and CommandsResponse.value is formatted response.
         N/A N/A N/A len params 0 N/A N/A N/A N/A self _action_wrapper N/A N/A first_param N/A params N/A 0 N/A N/A first_param ? N/A N/A N/A N/A self question_mark N/A N/A first_param N/A self subcommands N/A N/A N/A N/A N/A self _instantiate_subcommand first_param N/A params N/A 1 N/A N/A N/A self _action_wrapper params N/A cli_resp_formatter N/A N/A cls resp N/A N/A N/A Override this method to provide custom formatting of cli response.
         N/A N/A N/A resp value N/A N/A N/A N/A N/A resp status STATUS_OK N/A N/A N/A N/A type N/A resp value N/A str bool int float N/A six text_type N/A N/A N/A str N/A resp value N/A ret N/A val N/A resp value N/A N/A N/A isinstance val list N/A N/A val N/A val N/A line val N/A N/A N/A k v N/A N/A line items N/A N/A N/A isinstance v dict N/A N/A ret N/A N/A N/A cls cli_resp_line_template format k N/A N/A N/A pprint pformat v N/A N/A ret N/A N/A N/A cls cli_resp_line_template format k v N/A ret N/A N/A N/A N/A Error: {0} format N/A resp value N/A classmethod json_resp_formatter N/A N/A cls resp N/A N/A N/A Override this method to provide custom formatting of json response.
         N/A N/A N/A json dumps N/A resp value N/A classmethod dict_resp_formatter N/A N/A cls resp N/A N/A N/A N/A resp value N/A classmethod _action_wrapper N/A N/A self params N/A N/A N/A filter_params N/A N/A N/A | params N/A N/A ind N/A N/A params index | N/A new_params N/A params N/A ind N/A filter_params N/A params N/A ind N/A params new_params N/A action_resp N/A N/A self action params N/A N/A N/A len filter_params 1 N/A N/A action_resp N/A N/A self filter_resp action_resp N/A filter_params N/A 1 N/A action_resp N/A CommandsResponse N/A action_resp status N/A N/A self resp_formatter action_resp N/A N/A action_resp N/A self __class__ N/A action N/A N/A self params N/A N/A N/A Override this method to define what command should do.

        :param params: list of text parameters applied to this command.
        :return: returns CommandsResponse instance.
                 CommandsResposne.status can be STATUS_OK or STATUS_ERROR
                 CommandsResponse.value should be dict or str
         N/A N/A CommandsResponse STATUS_ERROR Not implemented N/A filter_resp N/A N/A self action_resp filter_params N/A N/A N/A Filter response of action. Used to make printed results more
        specific

        :param action_resp: named tuple (CommandsResponse)
            containing response from action.
        :param filter_params: params used after '|' specific for given filter
        :return: filtered response.
         N/A N/A N/A action_resp status STATUS_OK N/A N/A N/A N/A N/A CommandsResponse STATUS_OK N/A N/A TextFilter filter N/A action_resp value filter_params N/A N/A N/A FilterError N/A e N/A N/A N/A CommandsResponse STATUS_ERROR N/A str e N/A N/A action_resp N/A question_mark N/A N/A self N/A N/A N/A Shows help for this command and it's sub-commands.
         N/A ret N/A N/A N/A N/A self param_help_msg N/A N/A len N/A self subcommands 0 N/A N/A N/A N/A ret append N/A N/A self _quick_help N/A N/A N/A len N/A self subcommands 0 N/A N/A N/A k _ N/A sorted N/A N/A N/A self subcommands items N/A N/A N/A command_path param_help cmd_help N/A N/A N/A N/A self _instantiate_subcommand k _quick_help nested True N/A N/A command_path param_help cmd_help N/A N/A N/A N/A ret append N/A command_path param_help cmd_help N/A N/A N/A CommandsResponse STATUS_OK N/A N/A self help_formatter ret N/A self __class__ N/A _quick_help N/A N/A self nested N/A False N/A N/A :param nested: True if help is requested directly for this command
                    and False when help is requested for a list of possible
                    completions.
         N/A nested N/A N/A N/A N/A N/A self command_path None N/A self help_msg N/A N/A N/A N/A N/A self command_path N/A self param_help_msg N/A self help_msg N/A command_path N/A N/A self N/A N/A N/A N/A self parent_cmd N/A N/A N/A N/A N/A N/A self parent_cmd command_path N/A N/A self command N/A N/A N/A N/A self command N/A _instantiate_subcommand N/A N/A self key N/A N/A N/A N/A N/A N/A self subcommands N/A key api N/A self api parent self help_formatter N/A self help_formatter resp_formatter_name N/A self resp_formatter_name N/A N/A TextFilter N/A object N/A filter N/A N/A cls action_resp_value filter_params N/A N/A N/A N/A N/A N/A action expected_value filter_params N/A N/A N/A ValueError N/A N/A N/A FilterError Wrong number of filter parameters N/A N/A action regexp N/A N/A N/A isinstance action_resp_value list N/A N/A resp N/A list action_resp_value N/A iterator N/A enumerate action_resp_value N/A N/A resp N/A dict action_resp_value N/A iterator N/A iter N/A N/A action_resp_value items N/A remove N/A N/A N/A key value iterator N/A N/A N/A N/A N/A re search expected_value N/A str value N/A N/A N/A N/A remove append key N/A N/A isinstance resp list N/A N/A resp N/A N/A resp N/A key N/A N/A key value N/A enumerate resp N/A key remove N/A N/A resp N/A dict N/A N/A key value N/A N/A key value N/A N/A resp items N/A key remove N/A resp N/A N/A N/A FilterError Unknown filter N/A classmethod N/A FilterError N/A Exception N/A N/A N/A