| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013-2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 class FieldComposerError(BaseException): | 6 class FieldComposerError(BaseException): |
| 7 """Base error class for this module.""" | 7 """Base error class for this module.""" |
| 8 pass | 8 pass |
| 9 | 9 |
| 10 | 10 |
| 11 class RegistryConflict(FieldComposerError): | 11 class RegistryConflict(FieldComposerError): |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return FieldComposer(new_fields, new_registry) | 77 return FieldComposer(new_fields, new_registry) |
| 78 | 78 |
| 79 def get_with_context(self, key, value): | 79 def get_with_context(self, key, value): |
| 80 """Combine the current value for key (if any) with value.""" | 80 """Combine the current value for key (if any) with value.""" |
| 81 if key not in self._registry: | 81 if key not in self._registry: |
| 82 raise CompositionUndefined( | 82 raise CompositionUndefined( |
| 83 "No combine function registered for %s." % key) | 83 "No combine function registered for %s." % key) |
| 84 if key in self: | 84 if key in self: |
| 85 return self._registry[key]['combine'](self.get(key), value) | 85 return self._registry[key]['combine'](self.get(key), value) |
| 86 return value | 86 return value |
| OLD | NEW |