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