1#!/usr/bin/env python 2# Copyright 2017 gRPC authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16import subprocess 17import datetime 18 19# this script is only of historical interest: it's the script that was used to 20# bootstrap the dataset 21 22 23def daterange(start, end): 24 for n in range(int((end - start).days)): 25 yield start + datetime.timedelta(n) 26 27 28start_date = datetime.date(2017, 3, 26) 29end_date = datetime.date(2017, 3, 29) 30 31for dt in daterange(start_date, end_date): 32 dmy = dt.strftime('%Y-%m-%d') 33 print dmy 34 subprocess.check_call([ 35 'tools/line_count/yaml2csv.py', '-i', 36 '../count/%s.yaml' % dmy, '-d', dmy, '-o', 37 '../count/%s.csv' % dmy 38 ]) 39