Skip to content

Commit

Permalink
explicit is better than implicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Nov 14, 2011
1 parent 5e883ae commit 7a24091
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/OFS/Image.py
Expand Up @@ -36,7 +36,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
Expand Down Expand Up @@ -657,6 +656,9 @@ def manage_FTPget(self):

return ''

InitializeClass(File)


manage_addImageForm=DTMLFile('dtml/imageAdd',globals(),
Kind='Image',kind='image')
def manage_addImage(self, id, file, title='', precondition='', content_type='',
Expand Down Expand Up @@ -898,6 +900,8 @@ def tag(self, height=None, width=None, alt=None,

return '%s />' % result

InitializeClass(Image)


def cookId(id, title, file):
if not id and hasattr(file,'filename'):
Expand Down
4 changes: 3 additions & 1 deletion src/webdav/LockItem.py
Expand Up @@ -19,6 +19,7 @@

from AccessControl.Owned import ownerInfo
from AccessControl.SecurityInfo import ClassSecurityInfo
from App.class_init import InitializeClass
from Persistence import Persistent
from zope.interface import implements

Expand Down Expand Up @@ -173,11 +174,12 @@ def asLockDiscoveryProperty(self, ns='d',fake=0):
return s

def asXML(self):

s = """<?xml version="1.0" encoding="utf-8" ?>
<d:prop xmlns:d="DAV:">
<d:lockdiscovery>
%s
</d:lockdiscovery>
</d:prop>""" % self.asLockDiscoveryProperty(ns="d")
return s

InitializeClass(LockItem)

0 comments on commit 7a24091

Please sign in to comment.