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

Side by Side Diff: modules/statsmaster/templates/build_static_head.erb

Issue 6293281981857792: Issue 239 - Move AWStats processing to the stats server (Closed)
Patch Set: Added IP address anonymization and addressed review comments Created April 25, 2014, 7:38 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « modules/statsmaster/templates/awstats.conf ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import subprocess, sys, os, re 3 import subprocess
4 import sys
5 import os
6 import re
4 from datetime import datetime, timedelta 7 from datetime import datetime, timedelta
5 8
6 if len(sys.argv) > 1: 9 if len(sys.argv) > 1:
7 yearmonth = sys.argv[1] 10 yearmonth = sys.argv[1]
8 if yearmonth == 'prevmonth': 11 if yearmonth == 'prevmonth':
9 now = datetime.now() 12 now = datetime.now()
10 yearmonth = (now - timedelta(days=now.day)).strftime('%Y%m') 13 yearmonth = (now - timedelta(days=now.day)).strftime('%Y%m')
11 year, month = re.search(r'^(\d{4})(\d{2})$', yearmonth).groups() 14 year, month = re.search(r'^(\d{4})(\d{2})$', yearmonth).groups()
12 dirtemplate = os.path.join('/var/www/awstats/archive/%s', yearmonth) 15 dirtemplate = os.path.join('/var/www/awstats/archive/%s', yearmonth)
13 additional_params = ['-month=%s' % month, '-year=%s' % year] 16 additional_params = ['-month=%s' % month, '-year=%s' % year]
14 else: 17 else:
15 dirtemplate = '/var/www/awstats/%s' 18 dirtemplate = '/var/www/awstats/%s'
16 additional_params = [] 19 additional_params = []
OLDNEW
« no previous file with comments | « modules/statsmaster/templates/awstats.conf ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld