from OFS.SimpleItem import SimpleItem from StringIO import StringIO class TempFile(SimpleItem): """ temporary file """ def __init__(self, _id, uname): self.id = _id self._data = None self._filename = None self._user = uname SimpleItem.__init__(self) def setFilename(self, fname): self._filename = fname def setData(self, data): self._data = StringIO(data) def getUser(self): return self._user def getData(self): self._data.seek(0) return self._data.read() def getFilename(self): return self._filename