

@flow.StateHandler(next_state='HandleResults')
def StartRequests(self):
    'Generate and send the Find requests.'
    client = aff4.FACTORY.Open(self.client_id, token=self.token)
    if (self.runner.output is not None):
        self.runner.output.Set(self.runner.output.Schema.DESCRIPTION('CacheGrep for {0}'.format(self.args.data_regex)))
    usernames = [('%s\\%s' % (u.userdomain, u.username)) for u in self.state.users]
    usernames = [u.lstrip('\\') for u in usernames]
    condition = file_finder.FileFinderCondition(condition_type=file_finder.FileFinderCondition.Type.CONTENTS_REGEX_MATCH, contents_regex_match=file_finder.FileFinderContentsRegexMatchCondition(regex=self.args.data_regex, mode=file_finder.FileFinderContentsRegexMatchCondition.Mode.FIRST_HIT))
    for path in self.state.all_paths:
        full_paths = flow_utils.InterpolatePath(path, client, users=usernames)
        for full_path in full_paths:
            self.CallFlow('FileFinder', paths=[os.path.join(full_path, '**5')], pathtype=self.state.args.pathtype, conditions=[condition], action=file_finder.FileFinderAction(action_type=file_finder.FileFinderAction.Action.DOWNLOAD), next_state='HandleResults')

dataset/ETHPy150Open google/grr/grr/lib/flows/general/webhistory.py CacheGrep.StartRequests/original