edsu/bagit — pull request #25 by jobyh (2013-04-22 10:06:40+00:00)
Title: is_valid() patch

The else block illustrated in README.md validate() usage example doesn't execute e.g.

```python
import bagit
bag = bagit.Bag('testbag')
if bag.validate():
... print "yay :)"
... else:
... print "boo :("
...
Traceback (most recent call last):
File "", line 1, in
File "bagit.py", line 280, in validate
raise e
bagit.BagValidationError: Oxum error. Found 1 files and 0 bytes on disk; expected 0 files and 0 bytes.
```
The above exception is expected behaviour where validate() is called inside the library.

Rather than altering validate() provide a method is_valid() implemented specifically to return only a boolean value suitable for use in the case illustrated by the README.md example e.g.
```python
import bagit
bag = bagit.Bag('testbag')
if bag.is_valid():
... print "whoop :)"
... else:
... print "poop :("
...
poop :(
```