cement.ext.ext_scrub

Cement scrub extension module.

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

Bases: ArgparseController

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

class Meta[source]

Bases: object

argument_help = 'obfuscate sensitive data from rendered output'

Command line argument options help

argument_options = ['--scrub']

Command line argument options

label = 'scrub'

Controller label

stacked_on = 'base'

Parent controller to stack ontop of

stacked_type = 'embedded'

Stacking method

_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')