Commits

Olemis Lang committed fcd8ab3

GViz QL [ refs #299 ] : Replace multiple copies of configure() method with common base method in abstract superclass

Comments (0)

Files changed (1)

trac-dev/gviz/tracgviz/gvizql.py

     raise GVizUnsupportedQueryOp(msg)
 
   def configure(self, options):
-    r"""Configure this clause handler according to `options`
+    r"""Configure this clause handler according to `options`.
+    Nothing to do by default.
     """
-    raise NotImplementedError("Must implement abstract method 'configure'")
 
   def transform(self, schema, data):
     r"""Transform the result set as dictated by the clause included 
     # Activate select clause. May be turned off e.g. by PIVOT clause
     self.active = True
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Arrange and transform values considering the given expressions list.
     """
     # FIXME: str(colnm) => colnm.encode('utf-8')
     self.basetable = name['schema'](lambda colnm: (str(colnm), None))[0]
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Notify that base table has not been processed by data source. 
     This is made this way since it may hide a bug in the underlying 
     # FIXME: str(colnm) => colnm.encode('utf-8')
     self.filter = self._resolve_schema(expr, lambda colnm: (str(colnm), None))[0]
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Filter rows that do not satisfy target predicate.
     """
     self.aggregate = [self._resolve_schema(c, lambda colnm: (str(colnm), None))[0] 
         for c in self.groups_def ]
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Create groups.
     """
 
   MSG_NOAGG = 'Cannot use PIVOT when no aggregations are defined in SELECT.'
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Transpose tha data table considering the details of SELECT clause
     """
         (self._resolve_schema(c, lambda colnm: (colnm.encode('utf-8'), None))[0],
          is_asc) for c, is_asc in self.order_def ]
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Sort rows in base result set by evaluating target expressions.
     """
     """
     self.cnt = number
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Retrieve no more than `cnt` items.
     """
     """
     self.skip = number
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""Skip the number of items determined by `skip` attribute.
     """
       seq = Sequence([seq])
     self.labels = seq
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""(Add | modify) the schema in order to (include | update) 
     column labels.
         raise GVizInvalidQuery('Contradictory options no_value and no_format')
     self.opts = seq
 
-  def configure(self, options):
-    r"""Ignore configuration options"""
-
   def transform(self, schema, data):
     r"""No transformations applied
     """