Commit c333760f authored by rniwa@webkit.org's avatar rniwa@webkit.org

Add a tool to analyze change logs

https://bugs.webkit.org/show_bug.cgi?id=72243

Reviewed by Eric Seidel.

Add the initial implementation of analyze-changelog command. This version supports parsing multiple changelogs
in a single directory and summarizes the result in json files. It also copies summary.html to the output directory
for visualizing json files.

Usage: webkit-patch analyze-changelog [--changelog-count N] <CHANGELOG_DIR> <OUTPUT_DIR>
where CHANGELOG_DIR is the directory to look for changelogs, OUTPUT_DIR is the directory into which the tool
generates json files, and N is the number of changelogs to parse.

* Scripts/webkitpy/common/config/contributionareas.py: Added names().
* Scripts/webkitpy/common/system/filesystem_mock.py: Added readline and iterator support to ReadableTextFileObject.
* Scripts/webkitpy/tool/commands/__init__.py:
* Scripts/webkitpy/tool/commands/analyzechangelog.py: Added.
* Scripts/webkitpy/tool/commands/analyzechangelog_unittest.py: Added.
* Scripts/webkitpy/tool/commands/data/summary.html: Added.
* Scripts/webkitpy/tool/steps/options.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bfdffec8
2012-01-03 Ryosuke Niwa <rniwa@webkit.org>
Add a tool to analyze change logs
https://bugs.webkit.org/show_bug.cgi?id=72243
Reviewed by Eric Seidel.
Add the initial implementation of analyze-changelog command. This version supports parsing multiple changelogs
in a single directory and summarizes the result in json files. It also copies summary.html to the output directory
for visualizing json files.
Usage: webkit-patch analyze-changelog [--changelog-count N] <CHANGELOG_DIR> <OUTPUT_DIR>
where CHANGELOG_DIR is the directory to look for changelogs, OUTPUT_DIR is the directory into which the tool
generates json files, and N is the number of changelogs to parse.
* Scripts/webkitpy/common/config/contributionareas.py: Added names().
* Scripts/webkitpy/common/system/filesystem_mock.py: Added readline and iterator support to ReadableTextFileObject.
* Scripts/webkitpy/tool/commands/__init__.py:
* Scripts/webkitpy/tool/commands/analyzechangelog.py: Added.
* Scripts/webkitpy/tool/commands/analyzechangelog_unittest.py: Added.
* Scripts/webkitpy/tool/commands/data/summary.html: Added.
* Scripts/webkitpy/tool/steps/options.py:
2012-01-03 Ryosuke Niwa <rniwa@webkit.org>
Add a tool to analyze change logs
https://bugs.webkit.org/show_bug.cgi?id=72243
Reviewed by Eric Seidel.
Add the initial implementation of analyze-changelog command. This version supports parsing multiple changelogs
in a single directory and summarizes the result in json files. It also copies summary.html to the output directory
for visualizing json files.
Usage: webkit-patch analyze-changelog [--changelog-count N] <CHANGELOG_DIR> <OUTPUT_DIR>
where CHANGELOG_DIR is the directory to look for changelogs, OUTPUT_DIR is the directory into which the tool
generates json files, and N is the number of changelogs to parse.
* Scripts/webkitpy/common/config/contributionareas.py: Added names().
* Scripts/webkitpy/common/system/filesystem_mock.py: Added readline and iterator support to ReadableTextFileObject.
* Scripts/webkitpy/tool/commands/__init__.py:
* Scripts/webkitpy/tool/commands/analyzechangelog.py: Added.
* Scripts/webkitpy/tool/commands/analyzechangelog_unittest.py: Added.
* Scripts/webkitpy/tool/commands/data/summary.html: Added.
* Scripts/webkitpy/tool/steps/options.py:
2012-01-03 Adam Roben <aroben@apple.com>
Make Port subclasses override the operating_system method rather than setting an attribute
......@@ -177,6 +177,12 @@ class ContributionAreas(object):
self._filesystem = filesystem
self._contribution_areas = table
def names(self):
return [area.name() for area in self._contribution_areas]
def names(self):
return [area.name() for area in self._contribution_areas]
def _split_path(self, path):
result = []
while path and len(path):
......
......@@ -398,5 +398,11 @@ class ReadableTextFileObject(ReadableBinaryFileObject):
def readline(self, length=None):
return self.data.readline(length)
def __iter__(self):
return self.data.__iter__()
def next(self):
return self.data.next()
def seek(self, offset, whence=os.SEEK_SET):
self.data.seek(offset, whence)
# Required for Python to search this directory for module files
from webkitpy.tool.commands.adduserstogroups import AddUsersToGroups
from webkitpy.tool.commands.analyzechangelog import AnalyzeChangeLog
from webkitpy.tool.commands.applywatchlistlocal import ApplyWatchListLocal
from webkitpy.tool.commands.bugfortest import BugForTest
from webkitpy.tool.commands.bugsearch import BugSearch
......
# Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import with_statement
import json
import re
import time
from webkitpy.common.checkout.scm.detection import SCMDetector
from webkitpy.common.checkout.changelog import ChangeLog
from webkitpy.common.config.contributionareas import ContributionAreas
from webkitpy.common.system.filesystem import FileSystem
from webkitpy.common.system.executive import Executive
from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
from webkitpy.tool import steps
class AnalyzeChangeLog(AbstractDeclarativeCommand):
name = "analyze-changelog"
help_text = "Experimental command for analyzing change logs."
long_help = "This command parses changelogs in a specified directory and summarizes the result as JSON files."
def __init__(self):
options = [
steps.Options.changelog_count,
]
AbstractDeclarativeCommand.__init__(self, options=options)
@staticmethod
def _enumerate_changelogs(filesystem, dirname, changelog_count):
changelogs = [filesystem.join(dirname, filename) for filename in filesystem.listdir(dirname) if re.match('^ChangeLog(-(\d{4}-\d{2}-\d{2}))?$', filename)]
# Make sure ChangeLog shows up before ChangeLog-2011-01-01
changelogs = sorted(changelogs, key=lambda filename: filename + 'X', reverse=True)
return changelogs[:changelog_count]
@staticmethod
def _generate_jsons(filesystem, jsons, output_dir):
for filename in jsons:
print ' Generating', filename
filesystem.write_text_file(filesystem.join(output_dir, filename), json.dumps(jsons[filename], indent=2))
def execute(self, options, args, tool):
filesystem = self._tool.filesystem
if len(args) < 1 or not filesystem.exists(args[0]):
print "Need the directory name to look for changelog as the first argument"
return
changelog_dir = filesystem.abspath(args[0])
if len(args) < 2 or not filesystem.exists(args[1]):
print "Need the output directory name as the second argument"
return
output_dir = args[1]
startTime = time.time()
print 'Enumerating ChangeLog files...'
changelogs = AnalyzeChangeLog._enumerate_changelogs(filesystem, changelog_dir, options.changelog_count)
analyzer = ChangeLogAnalyzer(tool, changelogs)
analyzer.analyze()
print 'Generating json files...'
json_files = {
'summary.json': analyzer.summary(),
'contributors.json': analyzer.contributors_statistics(),
'areas.json': analyzer.areas_statistics(),
}
AnalyzeChangeLog._generate_jsons(filesystem, json_files, output_dir)
commands_dir = filesystem.dirname(filesystem.path_to_module(self.__module__))
print commands_dir
filesystem.copyfile(filesystem.join(commands_dir, 'data/summary.html'), filesystem.join(output_dir, 'summary.html'))
tick = time.time() - startTime
print 'Finished in %02dm:%02ds' % (int(tick / 60), int(tick % 60))
class ChangeLogAnalyzer(object):
def __init__(self, host, changelog_paths):
self._changelog_paths = changelog_paths
self._filesystem = host.filesystem
self._contribution_areas = ContributionAreas(host.filesystem)
self._scm = host.scm()
self._parsed_revisions = {}
self._contributors_statistics = {}
self._areas_statistics = dict([(area, {'reviewed': 0, 'unreviewed': 0, 'contributors': {}}) for area in self._contribution_areas.names()])
self._summary = {'reviewed': 0, 'unreviewed': 0}
self._longest_filename = max([len(path) - len(self._scm.checkout_root) for path in changelog_paths])
self._filename = ''
self._length_of_previous_output = 0
def contributors_statistics(self):
return self._contributors_statistics
def areas_statistics(self):
return self._areas_statistics
def summary(self):
return self._summary
def _print_status(self, status):
if self._length_of_previous_output:
print "\r" + " " * self._length_of_previous_output,
new_output = ('%' + str(self._longest_filename) + 's: %s') % (self._filename, status)
print "\r" + new_output,
self._length_of_previous_output = len(new_output)
def _set_filename(self, filename):
if self._filename:
print
self._filename = filename
def analyze(self):
for path in self._changelog_paths:
self._set_filename(self._filesystem.relpath(path, self._scm.checkout_root))
with self._filesystem.open_text_file_for_reading(path) as changelog:
self._print_status('Parsing entries...')
number_of_parsed_entries = self._analyze_entries(ChangeLog.parse_entries_from_file(changelog), path)
self._print_status('Done (%d entries)' % number_of_parsed_entries)
print
self._summary['contributors'] = len(self._contributors_statistics)
self._summary['contributors_with_reviews'] = sum([1 for contributor in self._contributors_statistics.values() if contributor['reviews']['total']])
self._summary['contributors_without_reviews'] = self._summary['contributors'] - self._summary['contributors_with_reviews']
def _collect_statistics_for_contributor_area(self, area, contributor, contribution_type, reviewed):
area_contributors = self._areas_statistics[area]['contributors']
if contributor not in area_contributors:
area_contributors[contributor] = {'reviews': 0, 'reviewed': 0, 'unreviewed': 0}
if contribution_type == 'patches':
contribution_type = 'reviewed' if reviewed else 'unreviewed'
area_contributors[contributor][contribution_type] += 1
def _collect_statistics_for_contributor(self, contributor, contribution_type, areas, touched_files, reviewed):
if contributor not in self._contributors_statistics:
self._contributors_statistics[contributor] = {
'reviews': {'total': 0, 'areas': {}, 'files': {}},
'patches': {'reviewed': 0, 'unreviewed': 0, 'areas': {}, 'files': {}}}
statistics = self._contributors_statistics[contributor][contribution_type]
if contribution_type == 'reviews':
statistics['total'] += 1
elif reviewed:
statistics['reviewed'] += 1
else:
statistics['unreviewed'] += 1
for area in areas:
self._increment_dictionary_value(statistics['areas'], area)
self._collect_statistics_for_contributor_area(area, contributor, contribution_type, reviewed)
for touchedfile in touched_files:
self._increment_dictionary_value(statistics['files'], touchedfile)
def _increment_dictionary_value(self, dictionary, key):
dictionary[key] = dictionary.get(key, 0) + 1
def _analyze_entries(self, entries, changelog_path):
dirname = self._filesystem.dirname(changelog_path)
for i, entry in enumerate(entries):
self._print_status('(%s) entries' % i)
assert(entry.authors())
touchedfiles_for_entry = [self._filesystem.relpath(self._filesystem.join(dirname, name), self._scm.checkout_root) for name in entry.touched_files()]
areas_for_entry = self._contribution_areas.areas_for_touched_files(touchedfiles_for_entry)
authors_for_entry = entry.authors()
reviewers_for_entry = entry.reviewers()
for reviewer in reviewers_for_entry:
self._collect_statistics_for_contributor(reviewer.full_name, 'reviews', areas_for_entry, touchedfiles_for_entry, reviewed=True)
for author in authors_for_entry:
self._collect_statistics_for_contributor(author['name'], 'patches', areas_for_entry, touchedfiles_for_entry,
reviewed=bool(reviewers_for_entry))
for area in areas_for_entry:
self._areas_statistics[area]['reviewed' if reviewers_for_entry else 'unreviewed'] += 1
self._summary['reviewed' if reviewers_for_entry else 'unreviewed'] += 1
i += 1
self._print_status('(%s) entries' % i)
return i
# Cpyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import json
import sys
from webkitpy.common.config.contributionareas import ContributionAreas
from webkitpy.common.host_mock import MockHost
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.executive import Executive
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.tool.commands.analyzechangelog import AnalyzeChangeLog
from webkitpy.tool.commands.analyzechangelog import ChangeLogAnalyzer
from webkitpy.tool.commands.commandtest import CommandsTest
from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
class AnalyzeChangeLogTest(CommandsTest):
def test_enumerate_enumerate_changelogs(self):
filesystem = MockFileSystem({
'foo/ChangeLog': '',
'foo/ChangeLog-2010-06-23': '',
'foo/ChangeLog-2010-12-31': '',
'foo/ChangeLog-x': '',
'foo/ChangeLog-2011-01-01': '',
})
changelogs = AnalyzeChangeLog._enumerate_changelogs(filesystem, 'foo/', None)
self.assertEqual(changelogs, ['foo/ChangeLog', 'foo/ChangeLog-2011-01-01', 'foo/ChangeLog-2010-12-31', 'foo/ChangeLog-2010-06-23'])
changelogs = AnalyzeChangeLog._enumerate_changelogs(filesystem, 'foo/', 2)
self.assertEqual(changelogs, ['foo/ChangeLog', 'foo/ChangeLog-2011-01-01'])
def test_generate_jsons(self):
filesystem = MockFileSystem()
test_json = {'array.json': [1, 2, 3, {'key': 'value'}], 'dictionary.json': {'somekey': 'somevalue', 'array': [4, 5]}}
capture = OutputCapture()
capture.capture_output()
AnalyzeChangeLog._generate_jsons(filesystem, test_json, 'bar')
self.assertEqual(set(filesystem.files.keys()), set(['bar/array.json', 'bar/dictionary.json']))
capture.restore_output()
self.assertEqual(json.loads(filesystem.files['bar/array.json']), test_json['array.json'])
self.assertEqual(json.loads(filesystem.files['bar/dictionary.json']), test_json['dictionary.json'])
class ChangeLogAnalyzerTest(CommandsTest):
def test_analyze_one_changelog(self):
host = MockHost()
host.filesystem.files['mock-checkout/foo/ChangeLog'] = u"""2011-11-17 Mark Rowe <mrowe@apple.com>
<http://webkit.org/b/72646> Disable deprecation warnings around code where we cannot easily
switch away from the deprecated APIs.
Reviewed by Sam Weinig.
* platform/mac/WebCoreNSStringExtras.mm:
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::reportErrorToClient):
2011-11-19 Kevin Ollivier <kevino@theolliviers.com>
[wx] C++ bindings build fix for move of array classes to WTF.
* bindings/scripts/CodeGeneratorCPP.pm:
(GetCPPTypeGetter):
(GetNamespaceForClass):
(GenerateHeader):
(GenerateImplementation):
2011-10-27 Philippe Normand <pnormand@igalia.com> and Zan Dobersek <zandobersek@gmail.com>
[GStreamer] WebAudio AudioFileReader implementation
https://bugs.webkit.org/show_bug.cgi?id=69834
Reviewed by Martin Robinson.
Basic FileReader implementation, supporting one or 2 audio
channels. An empty AudioDestination is also provided, its complete
implementation is handled in bug 69835.
* GNUmakefile.am:
* GNUmakefile.list.am:
* platform/audio/gstreamer/AudioDestinationGStreamer.cpp: Added.
(WebCore::AudioDestination::create):
(WebCore::AudioDestination::hardwareSampleRate):
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
(WebCore::AudioDestinationGStreamer::~AudioDestinationGStreamer):
(WebCore::AudioDestinationGStreamer::start):
(WebCore::AudioDestinationGStreamer::stop):
* platform/audio/gstreamer/AudioDestinationGStreamer.h: Added.
(WebCore::AudioDestinationGStreamer::isPlaying):
(WebCore::AudioDestinationGStreamer::sampleRate):
(WebCore::AudioDestinationGStreamer::sourceProvider):
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: Added.
(WebCore::getGStreamerAudioCaps):
(WebCore::getFloatFromByteReader):
(WebCore::copyGstreamerBuffersToAudioChannel):
(WebCore::onAppsinkNewBufferCallback):
(WebCore::messageCallback):
(WebCore::onGStreamerDeinterleavePadAddedCallback):
(WebCore::onGStreamerDeinterleaveReadyCallback):
(WebCore::onGStreamerDecodebinPadAddedCallback):
(WebCore::AudioFileReader::AudioFileReader):
(WebCore::AudioFileReader::~AudioFileReader):
(WebCore::AudioFileReader::handleBuffer):
(WebCore::AudioFileReader::handleMessage):
(WebCore::AudioFileReader::handleNewDeinterleavePad):
(WebCore::AudioFileReader::deinterleavePadsConfigured):
(WebCore::AudioFileReader::plugDeinterleave):
(WebCore::AudioFileReader::createBus):
(WebCore::createBusFromAudioFile):
(WebCore::createBusFromInMemoryAudioFile):
* platform/audio/gtk/AudioBusGtk.cpp: Added.
(WebCore::AudioBus::loadPlatformResource):
"""
capture = OutputCapture()
capture.capture_output()
analyzer = ChangeLogAnalyzer(host, ['mock-checkout/foo/ChangeLog'])
analyzer.analyze()
capture.restore_output()
self.assertEqual(analyzer.summary(),
{'reviewed': 2, 'unreviewed': 1, 'contributors': 6, 'contributors_with_reviews': 2, 'contributors_without_reviews': 4})
self.assertEqual(set(analyzer.contributors_statistics().keys()),
set(['Sam Weinig', u'Mark Rowe', u'Kevin Ollivier', 'Martin Robinson', u'Philippe Normand', u'Zan Dobersek']))
self.assertEqual(analyzer.contributors_statistics()['Sam Weinig'],
{'reviews': {'files': {u'foo/platform/mac/WebCoreNSStringExtras.mm': 1, u'foo/platform/network/cf/SocketStreamHandleCFNet.cpp': 1},
'total': 1, 'areas': {'Network': 1}}, 'patches': {'files': {}, 'areas': {}, 'unreviewed': 0, 'reviewed': 0}})
self.assertEqual(analyzer.contributors_statistics()[u'Mark Rowe'],
{'reviews': {'files': {}, 'total': 0, 'areas': {}}, 'patches': {'files': {u'foo/platform/mac/WebCoreNSStringExtras.mm': 1,
u'foo/platform/network/cf/SocketStreamHandleCFNet.cpp': 1}, 'areas': {'Network': 1}, 'unreviewed': 0, 'reviewed': 1}})
self.assertEqual(analyzer.contributors_statistics()[u'Kevin Ollivier'],
{'reviews': {'files': {}, 'total': 0, 'areas': {}}, 'patches': {'files': {u'foo/bindings/scripts/CodeGeneratorCPP.pm': 1},
'areas': {'Bindings': 1}, 'unreviewed': 1, 'reviewed': 0}})
files_for_audio_patch = {u'foo/GNUmakefile.am': 1, u'foo/GNUmakefile.list.am': 1, 'foo/platform/audio/gstreamer/AudioDestinationGStreamer.cpp': 1,
'foo/platform/audio/gstreamer/AudioDestinationGStreamer.h': 1, 'foo/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp': 1,
'foo/platform/audio/gtk/AudioBusGtk.cpp': 1}
author_expectation_for_audio_patch = {'reviews': {'files': {}, 'total': 0, 'areas': {}},
'patches': {'files': files_for_audio_patch, 'areas': {'The WebKitGTK+ Port': 1}, 'unreviewed': 0, 'reviewed': 1}}
self.assertEqual(analyzer.contributors_statistics()[u'Martin Robinson'],
{'reviews': {'files': files_for_audio_patch, 'total': 1, 'areas': {'The WebKitGTK+ Port': 1}},
'patches': {'files': {}, 'areas': {}, 'unreviewed': 0, 'reviewed': 0}})
self.assertEqual(analyzer.contributors_statistics()[u'Philippe Normand'], author_expectation_for_audio_patch)
self.assertEqual(analyzer.contributors_statistics()[u'Zan Dobersek'], author_expectation_for_audio_patch)
areas_statistics = analyzer.areas_statistics()
areas_with_patches = [area for area in areas_statistics if areas_statistics[area]['reviewed'] or areas_statistics[area]['unreviewed']]
self.assertEqual(set(areas_with_patches), set(['Bindings', 'Network', 'The WebKitGTK+ Port']))
self.assertEqual(areas_statistics['Bindings'], {'unreviewed': 1, 'reviewed': 0, 'contributors':
{u'Kevin Ollivier': {'reviews': 0, 'unreviewed': 1, 'reviewed': 0}}})
self.assertEqual(areas_statistics['Network'], {'unreviewed': 0, 'reviewed': 1, 'contributors':
{'Sam Weinig': {'reviews': 1, 'unreviewed': 0, 'reviewed': 0}, u'Mark Rowe': {'reviews': 0, 'unreviewed': 0, 'reviewed': 1}}})
<!DOCTYPE html>
<html>
<head>
<title>ChangeLog Analysis</title>
<style type="text/css">
body {
font-family: 'Helvetica' 'Segoe UI Light' sans-serif;
font-weight: 200;
padding: 20px;
min-width: 1200px;
}
* {
padding: 0px;
margin: 0px;
border: 0px;
}
h1, h2, h3 {
font-weight: 200;
}
h1 {
margin: 0 0 1em 0;
}
h2 {
font-size: 1.2em;
text-align: center;
margin-bottom: 1em;
}
h3 {
font-size: 1em;
}
.view {
margin: 0px;
width: 600px;
float: left;
}
.graph-container p {
width: 200px;
text-align: right;
margin: 20px 0 20px 0;
padding: 5px;
border-right: solid 1px black;
}
.graph-container table {
width: 100%;
}
.graph-container table, .graph-container td {
border-collapse: collapse;
border: none;
}
.graph-container td {
padding: 5px;
vertical-align: center;
}
.graph-container td:first-child {
width: 200px;
text-align: right;
border-right: solid 1px black;
}
.graph-container .selected {
background: #eee;
}
#reviewers .selected td:first-child {
border-radius: 10px 0px 0px 10px;
}
#areas .selected td:last-child {
border-radius: 0px 10px 10px 0px;
}
.graph-container .bar {
display: inline-block;
min-height: 1em;
background: #9f6;
margin-right: 0.4ex;
}
.graph-container .reviewed-patches {
background: #3cf;
margin-right: 1px;
}
.graph-container .unreviewed-patches {
background: #f99;
}
.constrained {
background: #eee;
border-radius: 10px;
}
.constrained .vertical-bar {
border-right: solid 1px #eee;
}
#header {
border-spacing: 5px;
}
#header section {
display: table-cell;
width: 200px;
vertical-align: top;
border: solid 2px #ccc;
border-collapse: collapse;
padding: 5px;
font-size: 0.8em;
}
#header dt {
float: left;
}
#header dt:after {
content: ': ';
}