From 9d09649a437e0606e7f30a3283cb1ea79a444568 Mon Sep 17 00:00:00 2001 From: Diederik Date: Thu, 28 Jun 2012 13:51:35 -0400 Subject: [PATCH] Add backport for ordereddict to make scripts Python 2.4 - 2.6 compatiable. --- old_rc_new/new_charts.py | 5 ++++- old_rc_new/old_charts.py | 7 +++++-- old_rc_new/parse_csv.py | 5 ++++- old_rc_new/targets.py | 8 +++++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/old_rc_new/new_charts.py b/old_rc_new/new_charts.py index 35bfa21..a164b6b 100644 --- a/old_rc_new/new_charts.py +++ b/old_rc_new/new_charts.py @@ -2,7 +2,10 @@ Creates dygrap csv files for new metrics ''' import os -from collections import OrderedDict +try: + from collections import OrderedDict +except: + from ordereddict import OrderedDict import parse_csv as p diff --git a/old_rc_new/old_charts.py b/old_rc_new/old_charts.py index c284813..bc8a83e 100644 --- a/old_rc_new/old_charts.py +++ b/old_rc_new/old_charts.py @@ -2,7 +2,10 @@ Creates dygrap csv files for all metrics in the old report card ''' import os -from collections import OrderedDict +try: + from collections import OrderedDict +except ImportError: + from ordereddict import OrderedDict import parse_csv as p @@ -181,4 +184,4 @@ def create_all(): active_editors() very_active_editors() - page_requests() \ No newline at end of file + page_requests() diff --git a/old_rc_new/parse_csv.py b/old_rc_new/parse_csv.py index 4a4b683..afa9493 100644 --- a/old_rc_new/parse_csv.py +++ b/old_rc_new/parse_csv.py @@ -6,7 +6,10 @@ import old_to_new from utils import months_dict,fix_dates -from collections import OrderedDict +try: + from collections import OrderedDict +except ImportError: + from ordereddict import OrderedDict def parse_StatisticsMonthly(metric,next_metric,startindex=2,endindex=-2,n_lines='all'): '''Parses the excel_in_StatisticsMonthly_* file, extracts the `metric` passed as an argument and stores a dygraph csv file''' diff --git a/old_rc_new/targets.py b/old_rc_new/targets.py index 8a3d003..139eb8e 100644 --- a/old_rc_new/targets.py +++ b/old_rc_new/targets.py @@ -2,7 +2,13 @@ Creates dygrap csv files for target/benchmarks ''' import os -from collections import OrderedDict,defaultdict + +try: + from collections import OrderedDict +except ImportError: + from ordereddict import OrderedDict + +from collections import defaultdict import old_to_new import utils -- 1.7.0.4