Open GoogleCodeExporter opened 8 years ago
Runar,
Thanks for the suggestion on SVG and sample code changes. i will add it in the
next version.
Also I am relatively new to python and SQL. So if you see something that can be
improved in code, please feel free to suggest the changes.
Original comment by nitinbh...@gmail.com
on 19 Nov 2009 at 3:12
Hi,
Some general notes to improve the readability:
Write sql query string like this
SQL = \
"""
SELECT ext, count(*)'num'
FROM (SELECT DISTINCT path, substr(path, length(path) - 3)'ext'
FROM details
WHERE path REGEXP '.*[.]\w+$')
GROUP BY ext
ORDER BY num DESC
"""
A common construct to extract one value from a query:
a = self.execute(SQL).next()[0]
can be replaced by:
a, = self.execute(SQL).fetchone()
where 'a,' is tuple unpacking with one value
Also I found that the method used here to find the number of
files is not correct. At least not for my adaptation of the
code. The number of files does not correspond to the number
of files in an updated working copy of the repository.
I suspect the way Subversion handles renames is the problem.
You should check this out.
Runar
Original comment by runar.te...@gmail.com
on 24 Nov 2009 at 7:41
Number of files and linecount related a issues are now fixed in /trunk.
Also I have added svnplot-js.py which generates graphs as client side
javascript. Hence it doesnot have any dependency on matplotlib or numpy. I
found this alternative to be better that SVG creation.
Original comment by nitinbh...@gmail.com
on 12 Mar 2010 at 5:00
Original issue reported on code.google.com by
runar.te...@gmail.com
on 16 Nov 2009 at 7:27