Anonymous user
User:Bukzor: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 13:
== Automatic pylint ==
The current state of this project can be found here: [http://bukzor.hopto.org/svn/software/python/rosetta_pylint.py rosetta_pylint.py]
# use the MediaWiki API to grab a list of the pages in Category:Python
I feel done with that part, but I'm having trouble getting any of the builtin html or xml parsers to give me a DOM. htmlparser is just a ghetto little state machine, and the xml parsers are too strict ( is an 'unknown entity').▼
#*The mediawiki API is pretty straightforward. I feel done with that part.
# grab the HTML for those pages, put them into a DOM
▲
#*I've posted a stackoverflow question on this subject [http://stackoverflow.com/questions/2676872/how-to-parse-malformed-html-in-python-using-standard-libraries here]. --Bukzor 16:31, 20 April 2010 (UTC)
#*Despite everyone agreeing that Python doesn't have a builtin HTML->DOM parser, I've parsed the site A-Z with ElementTree with minimal effort. I had to fix a bunch of inavalid HTML though. Look at my edits for the previous couple days for details.
# select for "python" as a CSS class, and get lumps of Python code.
# automate feeding that code through pylint
# save a report of pages->scores
▲I've parsed the site A-Z and fixed all the html tag issues I found. Look at my edits for the previous couple days for details. Now I have ~700 python snippets that I'm working on pylint'ing and analyzing. --Bukzor 01:29, 24 April 2010 (UTC)
|