Changeset 4047 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 2 Apr 2009, 11:19:43 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py
r4045 r4047 32 32 grok.provides(IWAeUPExporter) 33 33 34 def export(self, obj, filepath=None): 34 def __init__(self, context): 35 self.context = context 36 37 def export(self, filepath=None): 35 38 if filepath is None: 36 39 filelike_obj = StringIO() 37 40 else: 38 41 filelike_obj = open(filepath, 'wb') 39 exported_obj = cPickle.dump( obj, filelike_obj)42 exported_obj = cPickle.dump(self.context, filelike_obj) 40 43 filelike_obj.close() 41 44 return filelike_obj … … 50 53 grok.provides(IWAeUPXMLExporter) 51 54 52 def export(self, obj, filepath=None): 53 pickled_obj = cPickle.dumps(obj) 55 def __init__(self, context): 56 self.context = context 57 58 def export(self, filepath=None): 59 pickled_obj = cPickle.dumps(self.context) 54 60 result = zope.xmlpickle.toxml(pickled_obj) 55 61 if filepath is None: … … 60 66 filelike_obj.seek(0) 61 67 return filelike_obj 68
Note: See TracChangeset for help on using the changeset viewer.