Lines Matching full:context
28 def _output_bug_report_message(context):
32 context.o.red(
78 def _set_auto_highlights(context):
80 context.o.auto_reds.extend(
87 context.o.auto_yellows.extend(
96 def _get_options_and_args(context):
98 parser = argparse.ExtArgumentParser(context, add_help=False)
141 def tool_main(context, tool, args):
146 Timer.fn = context.o.blue
147 context.options = options
148 context.version = version(tool.name)
151 context.o.green("{}\n".format(context.version))
155 context.logger.verbosity = 2
157 context.logger.verbosity = 0
159 if options.unittest != "off" and not unit_tests_ok(context):
163 context.o.colortest()
171 dir_ = context.options.working_directory
172 with WorkingDirectory(context, dir=dir_) as context.working_directory:
178 class Context(object):
179 """Context encapsulates globally useful objects and data; passed to many
193 context = Context()
194 with PrettyOutput() as context.o:
195 context.logger = Logger(context.o)
197 context.root_directory = get_root_directory()
199 _set_auto_highlights(context)
200 options, args = _get_options_and_args(context)
204 return tool_main(context, module.Tool(context), args)
206 context.logger.error(str(e))
208 if context.options.error_debug:
216 _output_bug_report_message(context)