Ignore:
Timestamp:
3 Apr 2009, 10:44:43 (16 years ago)
Author:
uli
Message:

Let importers accept file-like objects.

File:
1 edited

Legend:

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

    r4050 r4057  
    7878   
    7979    def doImport(self, filepath):
    80         xml = open(filepath, 'rb').read()
     80        xml = None
     81        if isinstance(filepath, basestring):
     82            xml = open(filepath, 'rb').read()
     83        else:
     84            xml = filepath.read()
    8185        obj = zope.xmlpickle.loads(xml)
    8286        return obj
Note: See TracChangeset for help on using the changeset viewer.