buriy/python-readability — pull request #15 by mitechie (2012-04-17 01:33:03+00:00)
Title: Start fixing <body/> bug, end up doing a bit more

This is an initial start at working with the code base.

First, I've fixed the bug with the `

` tag. It was due to the

```python
if append:
output.append...
````

It should have only been appending to the `div` element that's actually the third child in the document.

Next, since I want to embed the results of the parsing in my own documents, I added a `document_only` option that will not try to build a full document out of the results, but return just a div I can place as I wish in an existing document. This defaults to `False` so it should be completely backwards compatible.

Next up is just a bunch of cleanup. In going through the code I noted in some docs things I wasn't aware of. Things like the url option would be very handy!

I also worked on pep8'ing the code. I didn't get all the way there due to the long lines, but it's something I'd like to tackle as a pep8 proponent.

Finally, I started up a structure for tests. I added tests and a sample html document for the `body` tag and the `document_only` features.

I've run the tests and run manually tests from the command line to make sure things are working out ok.

If you can take a peek, let me know what you think I'd appreciate it.

I'm rick_h in #freenode irc if you have any questions and am always idling in the #bookie channel.