Log message for revision 122088: Removed unused rPickly module Changed: D Zope/trunk/src/OFS/rPickle.py
-=- Deleted: Zope/trunk/src/OFS/rPickle.py =================================================================== --- Zope/trunk/src/OFS/rPickle.py 2011-07-03 15:38:34 UTC (rev 122087) +++ Zope/trunk/src/OFS/rPickle.py 2011-07-03 15:52:37 UTC (rev 122088) @@ -1,42 +0,0 @@ -############################################################################## -# -# Copyright (c) 2002 Zope Foundation and Contributors. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE -# -############################################################################## -"""Restricted unpickler -""" - -import pickle - -reg={} - -class Unpickler(pickle.Unpickler): - def find_class(self, module, name): - try: return reg[(module,name)] - except: raise SystemError, 'Class not registered' - - def load_string(self): - raise pickle.UnpicklingError, 'Bad pickle: Non binstring' - -# Public interface - -from cStringIO import StringIO - -def loads(s): - """Unpickle a string""" - return Unpickler(StringIO(s)).load() - -def register(mod, cls, obj): - """Register a class""" - reg[(mod,cls)]=obj - -def unregister(mod, cls): - """Unregister a class""" - del reg[(mod,cls)] _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins