cement.ext.ext_scrub

Cement scrub extension module.

class cement.ext.ext_scrub.ScrubController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Add embedded options to the base controller to support scrubbing output.

_pre_argument_parsing()[source]

Called on every controller just before arguments are parsed. Provides an alternative means of adding arguments to the controller, giving more control than using Meta.arguments.

Example

class Base(ArgparseController):
    class Meta:
        label = 'base'

    def _pre_argument_parsing(self):
        p = self._parser
        p.add_argument('-f', '--foo',
                       help='my foo option',
                       dest='foo')

    def _post_argument_parsing(self):
        if self.app.pargs.foo:
            print('Got Foo Option Before Controller Dispatch')