- Timestamp:
- 23/06/10 16:41:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDG_XACML/ndg/xacml/core/functions/__init__.py
- Property svn:keywords set to Id
r6805 r7064 9 9 __license__ = "BSD - see LICENSE file in top-level directory" 10 10 __contact__ = "Philip.Kershaw@stfc.ac.uk" 11 __revision__ = "$Id :$"11 __revision__ = "$Id$" 12 12 from abc import ABCMeta, abstractmethod 13 13 from datetime import datetime, timedelta … … 356 356 # name in order to make an implementation of a class to handle it 357 357 functionName = identifier.split(self.__class__.URN_SEP)[-1] 358 if functionName == 'xpath-node-match': 359 pass 358 360 typePart = functionName.split(self.__class__.FUNCTION_NS_SUFFIX)[0] 359 361 362 # Attempt to infer from the function name the associated type 360 363 typeName = typePart[0].upper() + typePart[1:] 361 typeURI = AttributeValue.IDENTIFIER_PREFIX + typePart 364 365 # Remove any hyphens converting to camel case 366 if '-' in typeName: 367 typeName = ''.join([i[0].upper() + i[1:] 368 for i in typeName.split('-')]) 369 370 typeURI = AttributeValue.TYPE_URI_MAP.get(typeName) 371 if typeURI is None: 372 # Ugly hack to allow for XPath node functions 373 if typePart == 'xpath-node': 374 typeURI = AttributeValue.TYPE_URI_MAP['String'] 375 else: 376 raise TypeError('No AttributeValue.TYPE_URI_MAP entry for ' 377 '%r type' % typePart) 378 362 379 _type = attributeValueClassFactory(typeURI) 363 380 if _type is None: … … 474 491 if len(functionNameParts) == 1: 475 492 moduleName = functionNameParts[0] 493 494 elif functionName.startswith('xpath-node'): 495 # Ugly hack for xpath-node functions 496 moduleName = functionNameParts[-1].lower() 476 497 else: 477 498 moduleName = '_'.join(functionNameParts[1:]).lower()
Note: See TracChangeset
for help on using the changeset viewer.