def ParseHuntRunnerArgs(self): """Parse the hunt runner arguments, rules and output plugins.""" if self.hunt_runner_args is not None: return self.hunt_runner_args self.hunt_runner_args = forms.SemanticProtoFormRenderer( rdfvalue.HuntRunnerArgs(), prefix="hunt_runner").ParseArgs(self.request) self.hunt_runner_args.hunt_name = "GenericHunt" # Parse out the rules. self.ParseRules(self.hunt_runner_args) return self.hunt_runner_args
def Layout(self, request, response): """Layout the hunt flow form.""" self.flow_path = request.REQ.get("flow_path", "") self.flow_name = os.path.basename(self.flow_path) hunt_runner_form = forms.SemanticProtoFormRenderer( rdfvalue.HuntRunnerArgs(), id=self.id, supressions=self.suppressions, prefix="hunt_runner") self.hunt_params_form = hunt_runner_form.RawHTML(request) self.flow_description = flow_management.FlowInformation( id=self.id).RawHTML(request) if self.flow_name in flow.GRRFlow.classes: return super(HuntFlowForm, self).Layout(request, response) else: return self.RenderFromTemplate(self.nothing_selected_template, response)