Changeset 4050 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 2 Apr 2009, 11:39:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py
r4047 r4050 7 7 from xml.dom.minidom import Document, getDOMImplementation 8 8 from zope.interface import Interface 9 from waeup.interfaces import IWAeUPObject, IWAeUPExporter, IWAeUPXMLExporter 9 from waeup.interfaces import (IWAeUPObject, IWAeUPExporter, IWAeUPXMLExporter, 10 IWAeUPXMLImporter) 10 11 11 12 def readFile(f): … … 67 68 return filelike_obj 68 69 70 class XMLImporter(grok.Adapter): 71 """Import a WAeUP object from XML. 72 """ 73 grok.context(Interface) 74 grok.provides(IWAeUPXMLImporter) 75 76 def __init__(self, context): 77 self.context = context 78 79 def doImport(self, filepath): 80 xml = open(filepath, 'rb').read() 81 obj = zope.xmlpickle.loads(xml) 82 return obj 83
Note: See TracChangeset for help on using the changeset viewer.