[Zope-Checkins] SVN: Zope/trunk/src/ explicit is better than implicit

Yvo Schubbe y.2011 at wcm-solutions.de
Mon Nov 14 16:42:41 UTC 2011


Log message for revision 123343:
  explicit is better than implicit

Changed:
  U   Zope/trunk/src/OFS/Image.py
  U   Zope/trunk/src/webdav/LockItem.py

-=-
Modified: Zope/trunk/src/OFS/Image.py
===================================================================
--- Zope/trunk/src/OFS/Image.py	2011-11-14 16:42:24 UTC (rev 123342)
+++ Zope/trunk/src/OFS/Image.py	2011-11-14 16:42:41 UTC (rev 123343)
@@ -34,7 +34,6 @@
 from webdav.Lockable import ResourceLockedError
 from ZPublisher import HTTPRangeSupport
 from ZPublisher.HTTPRequest import FileUpload
-from ZPublisher.Iterators import filestream_iterator
 from zExceptions import Redirect
 from zope.contenttype import guess_content_type
 from zope.interface import implementedBy
@@ -651,6 +650,9 @@
 
         return ''
 
+InitializeClass(File)
+
+
 manage_addImageForm=DTMLFile('dtml/imageAdd',globals(),
                              Kind='Image',kind='image')
 def manage_addImage(self, id, file, title='', precondition='', content_type='',
@@ -890,7 +892,9 @@
 
         return '%s />' % result
 
+InitializeClass(Image)
 
+
 def cookId(id, title, file):
     if not id and hasattr(file,'filename'):
         filename=file.filename

Modified: Zope/trunk/src/webdav/LockItem.py
===================================================================
--- Zope/trunk/src/webdav/LockItem.py	2011-11-14 16:42:24 UTC (rev 123342)
+++ Zope/trunk/src/webdav/LockItem.py	2011-11-14 16:42:41 UTC (rev 123343)
@@ -15,6 +15,7 @@
 
 import time
 
+from AccessControl.class_init import InitializeClass
 from AccessControl.owner import ownerInfo
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from Persistence import Persistent
@@ -171,7 +172,6 @@
         return s
 
     def asXML(self):
-
         s = """<?xml version="1.0" encoding="utf-8" ?>
 <d:prop xmlns:d="DAV:">
  <d:lockdiscovery>
@@ -179,3 +179,5 @@
  </d:lockdiscovery>
 </d:prop>""" % self.asLockDiscoveryProperty(ns="d")
         return s
+
+InitializeClass(LockItem)



More information about the Zope-Checkins mailing list