Skip to content

Commit

Permalink
Added script to generate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed May 18, 2024
1 parent b7a91a7 commit 7e30d11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 137 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ packages = find:
python_requires = >=3.8
scripts =
tools/check_artifacts.py
tools/export.py
tools/generate_docs.py

[options.package_data]
Expand Down
21 changes: 9 additions & 12 deletions tools/check_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@


def Main():
"""The main program function.
"""Entry point of console script to check artifact definitions.
Returns:
bool: True if successful or False if not.
int: exit code that is provided to sys.exit().
"""
argument_parser = argparse.ArgumentParser(description=(
'Checks artifact definitions on a storage media image.'))
Expand Down Expand Up @@ -82,14 +82,14 @@ def Main():
print('')
argument_parser.print_help()
print('')
return False
return 1

if not options.artifact_definitions:
print('Path to artifact definitions is missing.')
print('')
argument_parser.print_help()
print('')
return False
return 1

dfimagetools_helpers.SetDFVFSBackEnd(options.back_end)

Expand Down Expand Up @@ -127,7 +127,7 @@ def Main():
print((f'Unable to retrieve an operating system volume from: '
f'{options.source:s}.'))
print('')
return False
return 1

definitions_with_check_results = {}
for artifact_definition in registry.GetDefinitions():
Expand All @@ -149,12 +149,12 @@ def Main():
except dfvfs_errors.ScannerError as exception:
print(f'[ERROR] {exception!s}', file=sys.stderr)
print('')
return False
return 1

except KeyboardInterrupt:
print('Aborted by user.', file=sys.stderr)
print('')
return False
return 1

print('Aritfact definitions found:')
for name, check_result in sorted(definitions_with_check_results.items()):
Expand All @@ -166,11 +166,8 @@ def Main():
print(text)
print('')

return True
return 0


if __name__ == '__main__':
if not Main():
sys.exit(1)
else:
sys.exit(0)
sys.exit(Main())
124 changes: 0 additions & 124 deletions tools/export.py

This file was deleted.

0 comments on commit 7e30d11

Please sign in to comment.