Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/stats/bin/pagegenerator.py

Issue 5182947690807296: Centralize stats processing, have the stats server pull in logs (Closed)
Patch Set: Fixed various issues Created Dec. 22, 2013, 4 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/stats/bin/logprocessor.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/bin/pagegenerator.py
===================================================================
--- a/sitescripts/stats/bin/pagegenerator.py
+++ b/sitescripts/stats/bin/pagegenerator.py
@@ -10,17 +10,17 @@
# Adblock Plus is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
-import os, re, codecs, simplejson, time, itertools
+import os, re, codecs, json, time, itertools
from datetime import date
from sitescripts.utils import get_config, setupStderr, get_custom_template_environment, cached
import sitescripts.stats.common as common
from sitescripts.stats.countrycodes import countrycodes
@cached(float("inf"))
def get_template_environment():
return get_custom_template_environment({
@@ -100,17 +100,17 @@ def generate_pages(datadir, outputdir):
current_month = None
for month, month_dir in get_names(server_type_dir, True):
if current_month == None or month > current_month:
current_month = month
for filename, path in get_names(month_dir, False):
filename = re.sub(r"\.json$", "", filename)
with codecs.open(path, "rb", encoding="utf-8") as file:
- data = simplejson.load(file)
+ data = json.load(file)
overview_url = "../../overview-" + common.filename_encode(filename + ".html")
filtered_urls = {}
for field in common.fields:
if field["name"] not in data:
continue
# Create filtered views for the first thirty values of a field if they
# have filtered data.
« no previous file with comments | « sitescripts/stats/bin/logprocessor.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld