Refactoring CLI, processing and searching
This commit is contained in:
parent
7ac54eccc2
commit
c8e0089ce6
1 changed files with 4 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import textwrap
|
||||||
|
|
||||||
from dfvfs.lib import errors as dfvfs_errors
|
from dfvfs.lib import errors as dfvfs_errors
|
||||||
import pytsk3
|
import pytsk3
|
||||||
|
@ -170,7 +171,7 @@ class IndexSearcher():
|
||||||
filesystem, mft_record_size)
|
filesystem, mft_record_size)
|
||||||
|
|
||||||
inode_filenames = self._get_filenames_from_inode(inode, hit_location)
|
inode_filenames = self._get_filenames_from_inode(inode, hit_location)
|
||||||
filename = ' | '.join(inode_filenames)
|
filename = '\n'.join(inode_filenames)
|
||||||
filenames.append('{0:s} ({1:d})'.format(filename, inode))
|
filenames.append('{0:s} ({1:d})'.format(filename, inode))
|
||||||
|
|
||||||
return filenames
|
return filenames
|
||||||
|
@ -276,7 +277,8 @@ class IndexSearcher():
|
||||||
filenames = self._get_filename_from_offset(
|
filenames = self._get_filename_from_offset(
|
||||||
image_path, image_hash, result['_source']['offset'])
|
image_path, image_hash, result['_source']['offset'])
|
||||||
hit.filename = '\n'.join(filenames)
|
hit.filename = '\n'.join(filenames)
|
||||||
hit.data = result['_source']['data'].strip()
|
hit.data = textwrap.wrap(result['_source']['data'].strip())
|
||||||
|
hit.data = '\n'.join(hit.data)
|
||||||
hits.append(hit.copy_to_dict())
|
hits.append(hit.copy_to_dict())
|
||||||
output = tabulate(hits, headers='keys', tablefmt='simple')
|
output = tabulate(hits, headers='keys', tablefmt='simple')
|
||||||
log.info(
|
log.info(
|
||||||
|
|
Loading…
Reference in a new issue