[Zope3-checkins] CVS: Zope3/src/zope/app/content - file.py:1.1.2.2

Fred L. Drake, Jr. fred@zope.com
Tue, 24 Dec 2002 02:54:24 -0500


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv27019

Modified Files:
      Tag: NameGeddon-branch
	file.py 
Log Message:
miscellaneous cleanups


=== Zope3/src/zope/app/content/file.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/content/file.py:1.1.2.1	Mon Dec 23 14:31:29 2002
+++ Zope3/src/zope/app/content/file.py	Tue Dec 24 02:54:24 2002
@@ -15,7 +15,6 @@
 
 $Id$
 """
-from types import StringType, UnicodeType, NoneType
 import datetime
 zerotime = datetime.datetime.fromtimestamp(0)
 
@@ -27,10 +26,9 @@
 
 from zope.app.interfaces.dublincore import IZopeDublinCore
 from zope.app.interfaces.annotation import IAnnotatable
-
-
 from zope.app.interfaces.content.file import IFile, IReadFile
 
+
 # set the size of the chunks
 MAXCHUNKSIZE = 1 << 16
 
@@ -82,10 +80,10 @@
     def setData(self, data):
         '''See interface Zope.App.OFS.Content.File.IFile.IFile'''
         # Handle case when data is a string
-        if isinstance(data, UnicodeType):
+        if isinstance(data, unicode):
             data = data.encode('UTF-8')
 
-        if isinstance(data, StringType):
+        if isinstance(data, str):
             size = len(data)
             if size < MAXCHUNKSIZE:
                 self._data, self._size = FileChunk(data), size
@@ -94,7 +92,7 @@
             return None
 
         # Handle case when data is None
-        if isinstance(data, NoneType):
+        if data is None:
             self._data, self._size = None, 0
             return None
 
@@ -199,13 +197,7 @@
             return None
 
 
-"""
-
-$Id$
-"""
-import persistence
-
-class FileChunk(Persistence.Persistent):
+class FileChunk(Persistent):
     # Wrapper for possibly large data
 
     next = None