Skip to content

Commit

Permalink
Worked on script to check artifact definitions (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Feb 20, 2022
1 parent 9a0faf2 commit 0418143
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions artifactsrc/volume_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ArtifactDefinitionsVolumeScanner(dfvfs_volume_scanner.VolumeScanner):
}

def __init__(self, artifacts_registry, mediator=None):
"""Initializes a Windows Registry collector.
"""Initializes an artifact definitions volume scanner.
Args:
artifacts_registry (artifacts.ArtifactDefinitionsRegistry): artifact
Expand Down Expand Up @@ -96,7 +96,7 @@ def _DetermineDataFormat(self, names, file_object):
file_object (file): file-like object.
Returns:
str: data format identifier or None if the data format coudld not
str: data format identifier or None if the data format could not
be determined.
"""
for name in names:
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ def parse_requirements_from_file(path):
package_dir={
'artifactsrc': 'artifactsrc'
},
include_package_data=True,
package_data={
'artifactsrc': ['*.yaml']
},
zip_safe=False,
scripts=glob.glob(os.path.join('tools', '[a-z]*.py')),
data_files=[
('share/artifacts-kb/data', glob.glob(
Expand Down
8 changes: 4 additions & 4 deletions tools/check_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

from dfimagetools import helpers as dfimagetools_helpers

from dfvfs.helpers import command_line
from dfvfs.helpers import command_line as dfvfs_command_line
from dfvfs.helpers import volume_scanner as dfvfs_volume_scanner
from dfvfs.lib import errors
from dfvfs.lib import errors as dfvfs_errors

from artifactsrc import volume_scanner

Expand Down Expand Up @@ -103,7 +103,7 @@ def Main():
elif os.path.isfile(options.artifact_definitions):
registry.ReadFromFile(reader, options.artifact_definitions)

mediator = command_line.CLIVolumeScannerMediator()
mediator = dfvfs_command_line.CLIVolumeScannerMediator()
scanner = volume_scanner.ArtifactDefinitionsVolumeScanner(
registry, mediator=mediator)

Expand Down Expand Up @@ -134,7 +134,7 @@ def Main():
if check_result.number_of_file_entries:
definitions_with_check_results[artifact_definition.name] = check_result

except errors.ScannerError as exception:
except dfvfs_errors.ScannerError as exception:
print('[ERROR] {0!s}'.format(exception), file=sys.stderr)
print('')
return False
Expand Down

0 comments on commit 0418143

Please sign in to comment.