Changeset 9c73557
- Timestamp:
- Apr 7, 2011 7:10:47 AM (14 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 37ecf7e
- Parents:
- 8f1db21
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/remote_service.py
r8f1db21 r9c73557 61 61 # A map used to convert fedid fields to fedid objects (when the field is 62 62 # already a string) 63 fedid_to_object = ( ('fedid', lambda x: fedid(bits=x)),)63 fedid_to_object = {'fedid': lambda x: fedid(bits=x)} 64 64 # A map used by apply_to_tags to convert fedids from xmlrpclib.Binary 65 65 # objects to fedid objects in one sweep. 66 decap_fedids = (('fedid', lambda x: fedid(bits=x.data)),) 66 decap_fedids = {'fedid': lambda x: fedid(bits=x.data), 67 'credential': lambda x: x.data} 67 68 # A map used to encapsulate fedids into xmlrpclib.Binary objects 68 encap_fedids = (('fedid', to_binary),)69 encap_fedids = {'fedid': to_binary, 'credential': to_binary} 69 70 70 71 # fields that are never unicoded, because they represent non strings. … … 142 143 if isinstance(e, dict): 143 144 for k in e.keys(): 144 for tag, fcnin map:145 if k == tag:146 147 148 149 150 151 152 153 154 145 if k in map: 146 fcn = map[k] 147 if isinstance(e[k], list): 148 e[k] = [ fcn(b) for b in e[k]] 149 else: 150 e[k] = fcn(e[k]) 151 elif isinstance(e[k], dict): 152 remote_service_base.apply_to_tags(e[k], map) 153 elif isinstance(e[k], list): 154 for ee in e[k]: 155 remote_service_base.apply_to_tags(ee, map) 155 156 # Other types end the recursion - they should be leaves 156 157 return e
Note: See TracChangeset
for help on using the changeset viewer.