Home | History | Annotate | Download | only in operators
      1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 """Selects the appropriate operator."""
      6 
      7 
      8 def GetOperator(operator):
      9   """Given an operator by name, returns its module.
     10 
     11   Args:
     12     operator: string describing the comparison
     13 
     14   Returns:
     15     module
     16   """
     17 
     18   # TODO(jhaas): come up with a happy way of integrating multiple operators
     19   # with different, possibly divergent and possibly convergent, operators.
     20 
     21   module = __import__(operator, globals(), locals(), [''])
     22 
     23   return module
     24