Package caldavclientlibrary :: Package admin :: Package xmlaccounts :: Module recordtypes
[hide private]
[frames] | no frames]

Source Code for Module caldavclientlibrary.admin.xmlaccounts.recordtypes

 1  ## 
 2  # Copyright (c) 2007-2016 Apple Inc. All rights reserved. 
 3  # 
 4  # Licensed under the Apache License, Version 2.0 (the "License"); 
 5  # you may not use this file except in compliance with the License. 
 6  # You may obtain a copy of the License at 
 7  # 
 8  # http://www.apache.org/licenses/LICENSE-2.0 
 9  # 
10  # Unless required by applicable law or agreed to in writing, software 
11  # distributed under the License is distributed on an "AS IS" BASIS, 
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13  # See the License for the specific language governing permissions and 
14  # limitations under the License. 
15  ## 
16   
17  """ 
18  Defines the record type identifiers and various dict's to map between those and XML elements. 
19  """ 
20   
21  from caldavclientlibrary.admin.xmlaccounts import tags 
22   
23  recordType_users     = "users" 
24  recordType_groups    = "groups" 
25  recordType_locations = "locations" 
26  recordType_resources = "resources"             
27  recordType_all       = "all"             
28   
29  RECORD_TYPES = ( 
30      recordType_users, 
31      recordType_groups, 
32      recordType_locations, 
33      recordType_resources,             
34  ) 
35  """Allowed record type identifiers.""" 
36   
37  RECORD_TYPES_TO_TAGS = { 
38      recordType_users     : tags.ELEMENT_USER, 
39      recordType_groups    : tags.ELEMENT_GROUP, 
40      recordType_locations : tags.ELEMENT_LOCATION, 
41      recordType_resources : tags.ELEMENT_RESOURCE,             
42  } 
43  """Maps between record type identifiers and their corresponding XML element names.""" 
44   
45  TAGS_TO_RECORD_TYPES = { 
46      tags.ELEMENT_USER     : recordType_users, 
47      tags.ELEMENT_GROUP    : recordType_groups, 
48      tags.ELEMENT_LOCATION : recordType_locations, 
49      tags.ELEMENT_RESOURCE : recordType_resources,             
50  } 
51  """Maps between XML element names and their corresponding record type identifiers.""" 
52