- 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/attributevalue.py
- Property svn:keywords set to Id
r6807 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 datetime import datetime, timedelta 13 13 … … 21 21 CLASS_NAME_SUFFIX = 'AttributeValue' 22 22 IDENTIFIER_PREFIX = 'http://www.w3.org/2001/XMLSchema#' 23 23 24 IDENTIFIER = None 24 TYPE_MAP = { 25 'String': basestring, 26 'AnyURI': basestring, 27 'Integer': int, 28 'Boolean': bool, 29 'Double': float, 30 'Date': datetime, 31 'DateTime': datetime, 32 'Time': datetime, 33 'DayTimeDuration': timedelta, 34 'YearMonthDuration': timedelta, 35 'X500Name': basestring, 36 'Rfc822Name': basestring, 37 'HexBinary': int, 38 'Base64Binary': NotImplemented, 39 'IpAddress': basestring, 40 'DnsName': basestring 41 } 25 TYPE_URIS = ( 26 'http://www.w3.org/2001/XMLSchema#string', 27 'http://www.w3.org/2001/XMLSchema#anyURI', 28 'http://www.w3.org/2001/XMLSchema#integer', 29 'http://www.w3.org/2001/XMLSchema#boolean', 30 'http://www.w3.org/2001/XMLSchema#double', 31 'http://www.w3.org/2001/XMLSchema#date', 32 'http://www.w3.org/2001/XMLSchema#dateTime', 33 'http://www.w3.org/2001/XMLSchema#time', 34 'http://www.w3.org/TR/2002/WD-xquery-operators-20020816#dayTimeDuration', 35 'http://www.w3.org/TR/2002/WD-xquery-operators-20020816#yearMonthDuration', 36 'urn:oasis:names:tc:xacml:1.0:data-type:x500Name', 37 'urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name', 38 'http://www.w3.org/2001/XMLSchema#hexBinary', 39 'http://www.w3.org/2001/XMLSchema#base64Binary', 40 'urn:oasis:names:tc:xacml:2.0:data-type:ipAddress', 41 'urn:oasis:names:tc:xacml:2.0:data-type:dnsName' 42 ) 43 TYPE_NAMES = ( 44 'String', 45 'AnyURI', 46 'Integer', 47 'Boolean', 48 'Double', 49 'Date', 50 'DateTime', 51 'Time', 52 'DayTimeDuration', 53 'YearMonthDuration', 54 'X500Name', 55 'Rfc822Name', 56 'HexBinary', 57 'Base64Binary', 58 'IpAddress', 59 'DnsName', 60 ) 61 NATIVE_TYPES = ( 62 basestring, 63 basestring, 64 int, 65 bool, 66 float, 67 datetime, 68 datetime, 69 datetime, 70 timedelta, 71 timedelta, 72 basestring, 73 basestring, 74 int, 75 NotImplemented, 76 basestring, 77 basestring 78 ) 79 TYPE_MAP = dict(zip(TYPE_NAMES, NATIVE_TYPES)) 80 TYPE_URI_MAP = dict(zip(TYPE_NAMES, TYPE_URIS)) 42 81 TYPE = None 43 82 … … 122 161 123 162 for typeName, _type in AttributeValue.TYPE_MAP.items(): 124 identifier = AttributeValue.IDENTIFIER_PREFIX + typeName[0 125 ].lower() + typeName[1:] 163 identifier = AttributeValue.TYPE_URI_MAP[typeName] 126 164 127 165 className = typeName + AttributeValue.CLASS_NAME_SUFFIX
Note: See TracChangeset
for help on using the changeset viewer.