Skip to content

Commit

Permalink
Add API support and deprication notices for assets flags
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Aug 2, 2020
1 parent ebcf262 commit 61d48e3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -64,9 +64,10 @@ positional arguments:
source Path to source directory or disk image
destination Path to destination for reports
basename DEPRECATED. Accession number or identifier, used as
basename for outputs. Maintained and respected if used to
prevent breaking existing integrations. Prefer calling
Brunnhilde with `brunnhilde.py source destination`.
basename for outputs. Prefer using the new simpler
`brunnhilde.py source destination` syntax. The
basename argument is retained for API stability and
used when provided.
optional arguments:
-h, --help show this help message and exit
Expand Down
29 changes: 27 additions & 2 deletions brunnhilde.py
Expand Up @@ -1149,6 +1149,16 @@ def _make_parser():
help="Decompress and scan zip, tar, gzip, warc, arc with Siegfried",
action="store_true",
)
parser.add_argument(
"--save_assets",
help="DEPRECATED. Non-functional in Brunnhilde 1.9.1+ but retained for API stability",
action="store"
)
parser.add_argument(
"--load_assets",
help="DEPRECATED. Non-functional in Brunnhilde 1.9.1+ but retained for API stability",
action="store"
)
parser.add_argument(
"--csv",
help="Path to Siegfried CSV file to read as input (directories only)",
Expand All @@ -1174,8 +1184,8 @@ def _make_parser():
default=None,
help=(
"DEPRECATED. Accession number or identifier, used as basename for outputs. "
"Maintained and respected if used to prevent breaking existing integrations. "
"Prefer calling Brunnhilde with `brunnhilde.py source destination`."
"Prefer using the new simpler `brunnhilde.py source destination` syntax. "
"The basename argument is retained for API stability and used when provided."
),
)

Expand Down Expand Up @@ -1255,6 +1265,21 @@ def main():
)
sys.exit(1)

# Print warnings for deprecated flags.
if args.save_assets or args.load_assets:
logger.warning(
"DEPRECATION NOTICE: --save_assets and --load_assets options are "
"deprecated. In Brunnhilde 1.9+, the HTML report has no external "
"JavaScript or CSS dependencies to be managed. The flags are "
"retained for API stability but are no longer functional."
)
if args.basename:
logger.warning(
"DEPRECATION NOTICE: The basename argument is deprecated in Brunnhilde 1.9.0. "
"Prefer using the new simpler `brunnhilde.py source destination` syntax. "
"The basename argument is retained for API stability and used if provided."
)

log_info("Brunnhilde started. Source: {}.".format(source))

use_hash = True
Expand Down

0 comments on commit 61d48e3

Please sign in to comment.