Commit 6ed3ec6f authored by legoktm's avatar legoktm

Chart extensions

parent bbaf2e12
......@@ -46,10 +46,10 @@ def process_file(fname):
return [date, covered]
def main():
def make_chart(directory, name, save_fname):
x = []
y = []
path = os.path.expanduser('~/mediawiki')
path = os.path.expanduser(directory)
for fname in find_files(path):
date, covered = process_file(fname)
x.append(date)
......@@ -59,10 +59,19 @@ def main():
plot.plot(x, y)
plot.xlabel('Date')
plot.ylabel('Percentage covered')
plot.title('MediaWiki core code coverage')
chart = os.path.join(path, 'chart.png')
plot.title(name + ' code coverage')
chart = os.path.expanduser(os.path.join('~/charts', save_fname + '.png'))
plot.savefig(chart)
print('Created %s' % chart)
def main():
make_chart('~/mediawiki', 'MediaWiki core', 'mediawiki')
extension_dir = os.path.expanduser('~/extensions')
extensions = sorted(os.listdir(extension_dir))
for extension in extensions:
make_chart(os.path.join(extension_dir, extension), extension, extension)
if __name__ == '__main__':
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment