bin Package

base Module

class thriftpool.bin.base.BaseCommand(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: object

Abstract command. Other commands should be subclass of this.

Parser

Specify parser class.

alias of ArgumentParser

args = ''

Argument list used in help.

create_parser(prog_name)[source]

Create new parser.

description[source]

Shortcut for class doc-string.

die(msg, status=1)[source]

Print message and exit with given status.

error(msg)[source]

Print given error.

execute(argv=None)[source]

Execute application from command line.

handle_argv(prog_name, argv)[source]

Parses command line arguments from argv and dispatches to __call__().

options = ()

Specify options for this command.

out(msg, fh=None)[source]

Print some output to text.

parse_options(prog_name, arguments)[source]

Parse the available options.

parser_options()[source]

Additional parser options.

prepare_parser(parser)[source]

Prepare parser for work.

run(*args, **options)[source]

This is the body of the command called by handle_argv().

usage[source]

Returns the command-line usage string for this app.

version = '0.2.7'

Application version.

exception thriftpool.bin.base.Error(reason, status=1)[source]

Bases: exceptions.Exception

class thriftpool.bin.base.Option(*args, **kwargs)[source]

Bases: object

Describe an option for parser.

apply(parser)[source]

thriftpoolctl Module

class thriftpool.bin.thriftpoolctl.Formatter(prog, indent_increment=2, max_help_position=24, width=None)[source]

Bases: argparse.HelpFormatter

Print list of commands with help.

umbrella = None
class thriftpool.bin.thriftpoolctl.Parser(prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True)[source]

Bases: argparse.ArgumentParser

Overwrite default parser.

class thriftpool.bin.thriftpoolctl.SubCommandMeta[source]

Bases: type

Metaclass that register sub-commands.

class thriftpool.bin.thriftpoolctl.UmbrellaCommand(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: thriftpool.bin.base.BaseCommand, thriftpool.utils.mixin.SubclassMixin

Umbrella for all commands.

Formatter[source]

Create new Formatter bounded to this class.

class Parser(prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True)

Bases: argparse.ArgumentParser

Specify new parser.

UmbrellaCommand.parser_options()[source]
UmbrellaCommand.prepare_parser(parser)[source]

Prepare parser for work.

UmbrellaCommand.run(*args, **options)[source]
UmbrellaCommand.subcommand_classes = {'list_slots': <class 'thriftpool.bin.thriftpoolctl.list_slots'>, 'manager': <class 'thriftpool.bin.thriftpoolctl.manager'>, 'newbase': <class 'thriftpool.bin.thriftpoolctl.NewBase'>}

Dictionary that contains existed subcommands.

UmbrellaCommand.subcommands[source]

Initialize all subcommands.

class thriftpool.bin.thriftpoolctl.abstract(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: thriftpool.bin.thriftpoolctl.NewBase

Base class for sub-commands.

abstract = True

Register this command in umbrella?

thriftpool.bin.thriftpoolctl.indent(t, indent=0)[source]

Indent text.

class thriftpool.bin.thriftpoolctl.list_slots(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: thriftpool.bin.thriftpoolctl.abstract

Print all registered slots.

abstract = False
format_slot(slot)[source]
run(*args, **options)[source]
thriftpool.bin.thriftpoolctl.main()[source]
class thriftpool.bin.thriftpoolctl.manager(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: thriftpool.bin.thriftpoolctl.abstract, thriftpool.bin.thriftpoold.ManagerCommand

Run manager daemon. Same as thriftpoold.

abstract = False

thriftpoold Module

class thriftpool.bin.thriftpoold.ManagerCommand(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: thriftpool.bin.base.BaseCommand

Start ThiftPool daemon.

change_process_title(app)[source]

Set process title.

options = (<thriftpool.bin.base.Option object at 0x3c4fc10>, <thriftpool.bin.base.Option object at 0x3c78310>, <thriftpool.bin.base.Option object at 0x3c788d0>, <thriftpool.bin.base.Option object at 0x3c78890>, <thriftpool.bin.base.Option object at 0x3c78550>, <thriftpool.bin.base.Option object at 0x3c78850>, <thriftpool.bin.base.Option object at 0x3c783d0>, <thriftpool.bin.base.Option object at 0x3c78990>, <thriftpool.bin.base.Option object at 0x3c789d0>, <thriftpool.bin.base.Option object at 0x3c78a10>, <thriftpool.bin.base.Option object at 0x3c78a90>)
run(*args, **options)[source]
thriftpool.bin.thriftpoold.main()[source]

thriftworker Module

class thriftpool.bin.thriftworker.WorkerCommand(app=None, stdout=<open file '<stdout>', mode 'w' at 0x7f9d4552b1e0>, stderr=<open file '<stderr>', mode 'w' at 0x7f9d4552b270>)[source]

Bases: thriftpool.bin.base.BaseCommand

Start ThiftPool worker.

run(*args, **options)[source]
thriftpool.bin.thriftworker.main()[source]

Project Versions

Table Of Contents

Previous topic

app Package

Next topic

components Package

This Page