Inspired by the Jonathan’s video tutorial, I wanted to try my hands on car-modeling as well. Not a big fan of supercars, I ended up picking something relatively mainstream: a BMW 335i coupe. How am I doing so far?
A few of you asked about how I got those statistics for my previous post about Blender SVN.
For the inquiring minds, I got the SVN log with the following command
svn log -r 25000:0 --xml https://svn.blender.org/svnroot/bf-blender/branches >> log.xml svn log -r 25000:0 --xml https://svn.blender.org/svnroot/bf-blender/trunk >> log.xml
These two SVN operation fetches the SVN logs for both the branches and the trunk of Blender and combine them into one 8 megabyte XML file. Please do not do this often as I imagine querying all the commit logs must put a heavy strain on the Blender SVN server.
Parsing the XML for the author commit frequency is done with the following python script:
import xml.sax
authorList= {}
# create document handler
class SVNXMLHandler(xml.sax.handler.ContentHandler):
def __init__(self):
pass
def startElement(self, name, attrs):
self.hasAuthor = 0
self.hasEntry = 0
if name == "logentry":
self.hasEntry = 1
#print attrs.get('revision', ""),
elif name == "author":
self.hasAuthor = 1
def characters(self, data):
if self.hasAuthor:
#print data
try:
authorList[data] += 1
except:
authorList[data] = 1
def endElement(self, name):
if name == "author": self.hasAuthor = 0
if name == "logentry": self.hasEntry = 0
# load and parse log
f = open('log.xml', 'r')
xml.sax.parseString(f.read(), SVNXMLHandler())
# print to console in comma delimited format
for i in authorList:
print i,",",authorList[i]
Run the above python script like so:
python logParser.py >> crunched.csv
After a few seconds, a CSV file should be created containing all the data you need, ready to be graphed in Microsoft Office. Yes I used Excel for the graph…