[Zope3-checkins] CVS: Zope3/src/zope/app/content - file.py:1.11 i18nfile.py:1.4
Philipp von Weitershausen
philikon@philikon.de
Wed, 23 Jul 2003 17:46:25 -0400
Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv30493
Modified Files:
file.py i18nfile.py
Log Message:
Remove ExtensionClass cruft.
=== Zope3/src/zope/app/content/file.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/content/file.py:1.10 Sat Jun 7 02:37:23 2003
+++ Zope3/src/zope/app/content/file.py Wed Jul 23 17:46:18 2003
@@ -53,16 +53,14 @@
if contentType is not None:
self._contentType = contentType
- if hasattr(data, '__class__') and data.__class__ is FileUpload \
- and not data.filename:
+ if isinstance(data, FileUpload) and not data.filename:
data = None # Ignore empty files
if data is not None:
self.data = data
def getData(self):
'''See interface IFile'''
- if hasattr(self._data, '__class__') and \
- self._data.__class__ is FileChunk:
+ if isinstance(self._data, FileChunk):
return str(self._data)
else:
return self._data
@@ -86,7 +84,7 @@
raise TypeError('Cannot set None data on a file.')
# Handle case when data is already a FileChunk
- if hasattr(data, '__class__') and data.__class__ is FileChunk:
+ if isinstance(data, FileChunk):
size = len(data)
self._data, self._size = data, size
return
=== Zope3/src/zope/app/content/i18nfile.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/content/i18nfile.py:1.3 Sat Jun 7 02:37:23 2003
+++ Zope3/src/zope/app/content/i18nfile.py Wed Jul 23 17:46:18 2003
@@ -99,8 +99,7 @@
if contentType is not None:
self.setContentType(contentType)
- if hasattr(data, '__class__') and data.__class__ is FileUpload \
- and not data.filename:
+ if isinstance(data, FileUpload) and not data.filename:
data = None # Ignore empty files
if data is not None:
self.setData(data, language)