Skip to content

Conversation

johnscancella
Copy link
Contributor

fixing the selection of tag files as reported by issue #75

acdha and others added 9 commits October 24, 2016 08:18
This broke bag validation on Windows when using multiprocessing.

Closes LibraryOfCongress#42
Similar to LibraryOfCongress#59 , large verifications of multiple files can take a long time, so having more status updates is more meaningful and reassuring. Let me know if I put this in the wrong place/function.
Reset self.entries to empty when (re)loading manifests to catch when files
have been deleted from the bag.
@johnscancella johnscancella merged commit 8038556 into LibraryOfCongress:master Oct 24, 2016
@ptrourke
Copy link

LGTM

Copy link
Member

@acdha acdha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor issues

p = join(dir_name, filename)
yield os.path.relpath(p, bag_dir)
for dir in os.listdir(bag_dir):
if dir != 'data':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally prefer an early exit (if dir == 'data': continue) rather than indenting a large block but I'm not sure how important that is

#remove everything up to the bag_dir directory
p = join(dir_name, filename)
yield os.path.relpath(p, bag_dir)
for dir in os.listdir(bag_dir):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dir is a builtin Python function - it probably won't break anything but I prefer not use redefine those names where possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants