Ignore:
Timestamp:
2 Apr 2009, 11:19:43 (16 years ago)
Author:
uli
Message:

Let adapters behave like real adapters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py

    r4045 r4047  
    3232    grok.provides(IWAeUPExporter)
    3333
    34     def export(self, obj, filepath=None):
     34    def __init__(self, context):
     35        self.context = context
     36
     37    def export(self, filepath=None):
    3538        if filepath is None:
    3639            filelike_obj = StringIO()
    3740        else:
    3841            filelike_obj = open(filepath, 'wb')
    39         exported_obj = cPickle.dump(obj, filelike_obj)
     42        exported_obj = cPickle.dump(self.context, filelike_obj)
    4043        filelike_obj.close()
    4144        return filelike_obj
     
    5053    grok.provides(IWAeUPXMLExporter)
    5154
    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)
    5460        result = zope.xmlpickle.toxml(pickled_obj)
    5561        if filepath is None:
     
    6066        filelike_obj.seek(0)
    6167        return filelike_obj
     68
Note: See TracChangeset for help on using the changeset viewer.