Added displaying of configurations at the top of the page.

A table on the top of the page displays the test configurations of the input files present.
The displayed string in the legend of each graph is now fetched from test configuration name instead of using the filename.

Review URL: http://webrtc-codereview.appspot.com/279006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1104 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/tools/python_charts/webrtc/data_helper.py b/tools/python_charts/webrtc/data_helper.py
index 17daf7d..fce949f 100644
--- a/tools/python_charts/webrtc/data_helper.py
+++ b/tools/python_charts/webrtc/data_helper.py
@@ -107,9 +107,9 @@
           self.messages.append("Couldn't find frame data for row %d "
           "for %s" % (row_number, self.names_list[dataset_index])) 
           break
-    return (result_table_description, result_data_table)
+    return result_table_description, result_data_table
 
-  def GetOrdering(self, table_description):  
+  def GetOrdering(self, table_description):
     """ Creates a list of column names, ordered alphabetically except for the
       frame_number column which always will be the first column.
      
@@ -131,4 +131,53 @@
     for column in sorted(table_description.keys()):
       if column != 'frame_number':
         columns_ordering.append(column)
-    return columns_ordering
\ No newline at end of file
+    return columns_ordering
+  
+  def CreateConfigurationTable(self, configurations):
+    """ Combines multiple test data configurations for display.
+
+    Args:
+      configurations: List of one ore more configurations. Each configuration
+      is required to be a list of dictionaries with two keys: 'name' and
+      'value'.
+      Example of a single configuration:
+      [
+        {'name': 'name', 'value': 'VP8 software'},
+        {'name': 'test_number', 'value': '0'},
+        {'name': 'input_filename', 'value': 'foreman_cif.yuv'},
+      ]
+    Returns:
+      A tuple containing:
+      - a dictionary describing the columns in the configuration table to be
+        displayed. All columns will have string as data type.
+        Example:
+        {
+          'name': 'string',
+          'test_number': 'string',
+          'input_filename': 'string',
+         }
+      - a list containing dictionaries (one per configuration) with the
+        configuration column names mapped to the value for each test run:
+
+        Example matching the columns above:
+        [
+         {'name': 'VP8 software',
+          'test_number': '12',
+          'input_filename': 'foreman_cif.yuv' },
+         {'name': 'VP8 hardware',
+          'test_number': '5',
+          'input_filename': 'foreman_cif.yuv' },
+        ]
+    """
+    result_description = {}
+    result_data = []
+
+    for configuration in configurations:
+      data = {}
+      result_data.append(data)
+      for dict in configuration:
+        name = dict['name']
+        value = dict['value']
+        result_description[name] = 'string'
+        data[name] = value
+    return result_description, result_data