

@flow.StateHandler()
def ParseFiles(self, responses):
    'Take each file we retrieved and get the history from it.'
    if responses:
        for response in responses:
            fd = aff4.FACTORY.Open(response.stat_entry.aff4path, token=self.token)
            hist = chrome_history.ChromeParser(fd)
            count = 0
            for (epoch64, dtype, url, dat1, dat2, dat3) in hist.Parse():
                count += 1
                str_entry = ('%s %s %s %s %s %s' % (datetime.datetime.utcfromtimestamp((epoch64 / 1000000.0)), url, dat1, dat2, dat3, dtype))
                if (self.runner.output is not None):
                    self.runner.output.write((utils.SmartStr(str_entry) + '\n'))
            self.Log('Wrote %d Chrome History entries for user %s from %s', count, self.state.args.username, response.stat_entry.pathspec.Basename())
            self.state.hist_count += count

dataset/ETHPy150Open google/grr/grr/lib/flows/general/webhistory.py ChromeHistory.ParseFiles/original