noc.core.management.base

Module Contents

exception noc.core.management.base.CommandError

Bases: exceptions.Exception

class noc.core.management.base.BaseCommand(stdout=sys.stdout, stderr=sys.stderr)

Bases: object

LOG_FORMAT
help =
print(self, *args, **kwargs)
run(self)

Execute command. Usually from script

if __name__ == “__main__”:
Command().run()
run_from_argv(self, argv)

Execute command. Usually from script

if __name__ == “__main__”:
import sys sys.exit(Command.run_from_argv())
create_parser(self)
handle(self, *args, **options)

Execute command

add_default_arguments(self, parser)

Apply default parser arguments

add_arguments(self, parser)

Apply additional parser arguments

die(self, msg)
setup_logging(self, loglevel)

Set loglevel

progress(self, iter, max_value=None)

Yield iterable and show progressbar :param iter: :param max_value: :return: