Commit e32d2d4d authored by Jim Fulton's avatar Jim Fulton

Returning the references list makes the API much cleaner,

which will help new storage writers.

Creating the reference list when one isn't passed is a bonus.
parent 4c3e7459
...@@ -86,12 +86,13 @@ ...@@ -86,12 +86,13 @@
""" """
import cPickle, cStringIO import cPickle, cStringIO
def referencesf(p,rootl, def referencesf(p, rootl=None,
Unpickler=cPickle.Unpickler, Unpickler=cPickle.Unpickler,
StringIO=cStringIO.StringIO, StringIO=cStringIO.StringIO,
tt=type(()), tt=type(()),
type=type): type=type, None=None):
if rootl is None: rootl=[]
u=Unpickler(StringIO(p)) u=Unpickler(StringIO(p))
l=len(rootl) l=len(rootl)
u.persistent_load=rootl u.persistent_load=rootl
...@@ -113,4 +114,5 @@ def referencesf(p,rootl, ...@@ -113,4 +114,5 @@ def referencesf(p,rootl,
if v: if v:
if type(v) is tt: v=v[0] if type(v) is tt: v=v[0]
rootl[i]=v rootl[i]=v
return rootl
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment