mario package¶
Subpackages¶
Submodules¶
mario.app module¶
Command line pipes in python.
mario.asynch module¶
Command line pipes in python.
-
class
mario.asynch.
TerminatedFrameReceiver
(stream, terminator, max_frame_length=16384)[source]¶ Bases:
object
- Parse frames out of a Trio stream, where each frame is terminated by a
fixed byte sequence.
For example, you can parse newline-terminated lines by setting the terminator to b”
“.
This uses some tricks to protect against denial of service attacks:
It puts a limit on the maximum frame size, to avoid memory overflow; you
might want to adjust the limit for your situation.
It uses some algorithmic trickiness to avoid “slow loris” attacks. All algorithms are amortized O(n) in the length of the input.
mario.cli module¶
-
class
mario.cli.
SectionedFormatter
(*args, sections, **kwargs)[source]¶ Bases:
click.formatting.HelpFormatter
-
write_dl
(rows, *args, **kwargs)[source]¶ Writes a definition list into the buffer. This is how options and commands are usually formatted.
- Parameters
rows – a list of two item tuples for the terms and values.
col_max – the maximum width of the first column.
col_spacing – the number of spaces between the first and second column.
-
-
class
mario.cli.
SectionedGroup
(*args, sections, **kwargs)[source]¶ Bases:
click.core.Group
-
format_commands
(ctx, formatter)[source]¶ Extra format methods for multi methods that adds all the commands after the options.
-
make_context
(info_name, args, parent=None, **extra)[source]¶ This function when given an info name and arguments will kick off the parsing and create a new
Context
. It does not invoke the actual command callback though.- Parameters
info_name – the info name for this invokation. Generally this is the most descriptive name for the script or command. For the toplevel script it’s usually the name of the script, for commands below it it’s the name of the script.
args – the arguments to parse as list of strings.
parent – the parent context if available.
extra – extra keyword arguments forwarded to the context constructor.
-
mario.cli_tools module¶
-
class
mario.cli_tools.
CommandInSection
(*args, section=None, **kwargs)[source]¶ Bases:
click.core.Command
-
class
mario.cli_tools.
DocumentedCommand
(*args, section=None, **kwargs)[source]¶ Bases:
mario.cli_tools.ReSTCommand
,mario.cli_tools.CommandInSection
mario.config module¶
mario.declarative module¶
-
class
mario.declarative.
AnyField
(*, default=<marshmallow.missing>, missing=<marshmallow.missing>, data_key=None, attribute=None, validate=None, required=False, allow_none=None, load_only=False, dump_only=False, error_messages=None, **metadata)[source]¶ Bases:
marshmallow.fields.Field
-
class
mario.declarative.
ArgumentNameField
(*, default=<marshmallow.missing>, missing=<marshmallow.missing>, data_key=None, attribute=None, validate=None, required=False, allow_none=None, load_only=False, dump_only=False, error_messages=None, **metadata)[source]¶ Bases:
marshmallow.fields.Field
-
class
mario.declarative.
ArgumentSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
A command-line positional argument for a new command.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
mario.declarative.
CommandSpec
(name, short_help, help, arguments, options, stages, inject_values, tests, section, hidden)[source]¶ Bases:
object
-
class
mario.declarative.
CommandSpecSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
A new command.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
mario.declarative.
CommandStageSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
A single stage of a new command pipeline.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
mario.declarative.
CommandTestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
A test of a new command.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
mario.declarative.
OptionNameField
(*, default=<marshmallow.missing>, missing=<marshmallow.missing>, data_key=None, attribute=None, validate=None, required=False, allow_none=None, load_only=False, dump_only=False, error_messages=None, **metadata)[source]¶ Bases:
marshmallow.fields.Field
-
class
mario.declarative.
OptionSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
A command line named option for a new command.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
mario.declarative.
RemapParamSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Translation between the name of a base command’s parameter and the name of the new command’s parameter.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
mario.doc module¶
mario.exceptions module¶
mario.interfaces module¶
-
class
mario.interfaces.
Traversal
(global_invocation_options, specific_invocation_params, runtime_parameters=None, plugin_object=None)[source]¶ Bases:
object
-
global_invocation_options
= None¶ mario map –special reversed
-
runtime_parameters
= None¶ the actual traversal function
-
specific_invocation_params
= None¶ stack, items
-
mario.interpret module¶
Command line pipes in python.
-
class
mario.interpret.
HowCall
[source]¶ Bases:
enum.Enum
An enumeration.
-
NONE
= ''¶
-
SINGLE
= '(x)'¶
-
VARARGS
= '(*x)'¶
-
VARKWARGS
= '(**x)'¶
-
mario.plug module¶
-
class
mario.plug.
CommandCommand
(name, components, short_help, options=NOTHING, arguments=NOTHING)[source]¶ Bases:
object
-
class
mario.plug.
PluginObject
(name, traversal_function, required_parameters, calculate_more_params=<function PluginObject.<lambda>>)[source]¶ Bases:
object
mario.sphinx_click module¶
-
class
mario.sphinx_click.
ClickDirective
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
docutils.parsers.rst.Directive
-
has_content
= False¶
-
option_spec
= {'commands': <function unchanged>, 'prog': <function unchanged_required>, 'show-nested': <function flag>}¶
-
required_arguments
= 1¶
-
mario.sphinx_jsonschema module¶
-
class
mario.sphinx_jsonschema.
DefinitionJsonSchema
(directive, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
sphinx-jsonschema.JsonSchema
mario.sphinx_marshmallow module¶
-
class
mario.sphinx_marshmallow.
Field
(name, type, required, default)[source]¶ Bases:
object
-
default
¶
-
name
¶
-
required
¶
-
type
¶
-
-
class
mario.sphinx_marshmallow.
Marshmallow3JSONSchema
(*args, **kwargs)[source]¶ Bases:
marshmallow_jsonschema.base.JSONSchema
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
mario.sphinx_marshmallow.
SchemaDirective
(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶ Bases:
docutils.parsers.rst.Directive
-
has_content
= False¶
-
option_spec
= {'commands': <function unchanged>, 'prog': <function unchanged_required>, 'show-nested': <function flag>}¶
-
required_arguments
= 1¶
-
mario.traversals module¶
-
mario.traversals.
async_filter
(function, iterable, max_concurrent)[source]¶ - Return type
AsyncIterator
[AsyncIterable
[~T]]
-
mario.traversals.
async_map
(function, iterable, max_concurrent)[source]¶ - Return type
AsyncIterator
[AsyncIterable
[~U]]
-
mario.traversals.
async_map_unordered
(function, iterable, max_concurrent)[source]¶ - Return type
AsyncIterator
[AsyncIterable
[~U]]
-
mario.traversals.
async_reduce
(function, iterable, max_concurrent, initializer=<object object>)[source]¶ - Return type
AsyncIterator
[AsyncIterable
[~U]]
-
mario.traversals.
sync_filter
(function, iterable, max_concurrent)[source]¶ - Return type
AsyncIterator
[AsyncIterable
[~U]]