Closed deepanjanroy closed 11 years ago
Also, maybe this is not the place to discuss this, but pybagit goes on an infinite loop if there is an empty directory in the data. Do you mind if I add some code to traverse the file tree and then raise an error if the directory is empty? Or I could also preserve the directory by creating an empty file there. The bagit specs say something like this: http://tools.ietf.org/html/draft-kunze-bagit-06#section-2.1.3
Could you also verify that this passes the test, or see if there is a test case that would cover this and supply one? You can attach that to this pull request and I'll merge them both in at the same time.
For the other question, you should detect an empty directory and, if it is empty, add a .keep file. (It may be that the directory is kept purposefully empty to be filled by downloaded content.
Unit tests pass and new tests have been added. One outdated test was fixed. The .keep files are now also automatically generated.
I believe this is what you had in mind when you wrote the is_valid method.