[Zodb-checkins] CVS: ZODB3/ZODB - ExportImport.py:1.16.22.1

Jeremy Hylton jeremy at zope.com
Tue Jul 15 14:17:04 EDT 2003


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv24245

Modified Files:
      Tag: zodb33-devel-branch
	ExportImport.py 
Log Message:
Remove unused variables and slightly reformat affected code.


=== ZODB3/ZODB/ExportImport.py 1.16 => 1.16.22.1 ===
--- ZODB3/ZODB/ExportImport.py:1.16	Fri Jan 17 12:23:14 2003
+++ ZODB3/ZODB/ExportImport.py	Tue Jul 15 13:16:57 2003
@@ -60,15 +60,11 @@
     def importFile(self, file, clue='', customImporters=None):
         # This is tricky, because we need to work in a transaction!
 
-        if type(file) is StringType:
-            file_name=file
-            file=open(file,'rb')
-        else:
-            try: file_name=file.name
-            except: file_name='(unknown)'
-        read=file.read
+        if isinstance(file, StringType):
+            file = open(file,'rb')
+        read = file.read
 
-        magic=read(4)
+        magic = read(4)
 
         if magic != 'ZEXP':
             if customImporters and customImporters.has_key(magic):
@@ -77,7 +73,8 @@
             raise POSException.ExportError, 'Invalid export header'
 
         t = self.getTransaction()
-        if clue: t.note(clue)
+        if clue:
+            t.note(clue)
 
         return_oid_list = []
         self.onCommitAction('_importDuringCommit', file, return_oid_list)
@@ -152,7 +149,6 @@
             pickler.dump(unpickler.load())
             pickler.dump(unpickler.load())
             p=newp.getvalue()
-            plen=len(p)
 
             store(oid, None, p, version, transaction)
 




More information about the Zodb-checkins mailing list