3.11.5. sciexp2.common.progress.UnpicklerStart
Methods
|
Get the sister |
- class UnpicklerStart(obj, **kwargs)
Bases:
objectPicklable proxy to a progress indicator.
In order to provide a progress indicator when unpickling large objects, you can prefix the pickle stream with a
UnpicklerStartinstance and postfix it with itsUnpicklerStopsister instance:def dump (self, file_obj): start = UnpicklerStart(len(self)) pickle.dump((start, self, start.get_stop()), file_obj)
When unpickled, the first will call
Stack.pushand the last will callStack.pop, so that your object will be able to update theCURRENTprogress indicator by callingStack.When pickled, it will also push a progress indicator for your code to use while pickling your large object.
- Parameters:
- obj
Object to show the progress indicator for
- no_picklebool, optional
Do not create a progress indicator while pickling
- msg_picklestring, optional
Message during pickling (otherwise use default)
- no_unpicklebool, optional
Do not create a progress indicator while unpickling
- msg_unpicklestring, optional
Message during unpickling (otherwise use default)togg
- get_stop()
Get the sister
UnpicklerStopobject.