Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeon committed Nov 21, 2024
1 parent 6b7e2d6 commit ae2742a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ocfl/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ def start_new_version(self, *,
raise ObjectException("Object at '%s' is not valid, aborting" % objdir)
inventory = self.parse_inventory()
# Object is valid, have inventory
# Is this a request to change the digest algorithm?
#
# Is this a request to change the digest algorithm? We implement this
# as part of the Object class because it requires access to all
# current object content files for potential recaclculation of digests
old_digest_algorithm = inventory.digest_algorithm
if digest_algorithm is None:
digest_algorithm = old_digest_algorithm
Expand Down Expand Up @@ -582,7 +585,6 @@ def start_new_version(self, *,
objdir=objdir,
srcdir=srcdir,
metadata=metadata,
content_directory=self.content_directory,
content_path_normalization=self.content_path_normalization,
forward_delta=self.forward_delta,
dedupe=self.dedupe,
Expand Down Expand Up @@ -860,7 +862,8 @@ def parse_inventory(self):
of the Object methods can assume correctness and matching string digests
between state and manifest blocks.
Returns and Inventory object for the parsed inventory.
Returns:
ocfl.Inventory: new Inventory object for the parsed inventory.
"""
with self.obj_fs.open(INVENTORY_FILENAME) as fh:
inventory = Inventory(json.load(fh))
Expand Down

0 comments on commit ae2742a

Please sign in to comment.