Skip to content
Snippets Groups Projects
Commit 332677d6 authored by jkerdreu's avatar jkerdreu
Browse files

Added comments

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2820 b32b6428-25c9-4566-ad07-03861ab6144f
parent 874abc3d
Branches
Tags
No related merge requests found
......@@ -21,9 +21,11 @@ def cleanup(obj):
"""
recursive walk a object to search for un-wanted CBOR tags.
Transform this tag in string format, this can be UUID, URL..
Should be Ok, with list, dicts..
Warning: This operate in-place changes.
Warning: This won't work for tags in dict keys.
/!\ use with caution, this operate in-place changes.
This is quite the same code as cbor.cleanup() but simply call
get() instead of str()
"""
if isinstance(obj,list):
for i in range(0,len(obj)):
......@@ -41,8 +43,8 @@ def cleanup(obj):
else:
return obj
def prepare_cbor(obj):
""" transfor a cbor object into something that rapdjson can handle """
import copy
r = copy.deepcopy(obj)
return cleanup(r)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment