Changeset 5317
- Timestamp:
- 27 Jul 2010, 08:15:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/utils/converters.py
r5313 r5317 134 134 def _convertValueFromString(self, string): 135 135 if self.tokens is not None: 136 return self.tokens[string] 136 result = None 137 try: 138 result = self.tokens[string] 139 except KeyError: 140 # Be gentle... 141 try: 142 result = self.tokens[string.lower()] 143 return result 144 except KeyError: 145 tokenlist = (','.join(self.tokens[:2])) 146 raise ValueError( 147 'The token %s is not valid. Use one of %s, ...' % ( 148 string, tokenlist)) 149 return result 137 150 if self.terms is not None: 138 151 return self.terms.getValue(string) 139 return self.context.source.getTermByToken(string).value 152 result = self.context.source.getTermByToken(string).value 153 return result 140 154 141 155 def _convertValueToString(self, value):
Note: See TracChangeset for help on using the changeset viewer.