Commit 7a240912 authored by 's avatar

explicit is better than implicit

parent 5e883aef
...@@ -36,7 +36,6 @@ from webdav.interfaces import IWriteLock ...@@ -36,7 +36,6 @@ from webdav.interfaces import IWriteLock
from webdav.Lockable import ResourceLockedError from webdav.Lockable import ResourceLockedError
from ZPublisher import HTTPRangeSupport from ZPublisher import HTTPRangeSupport
from ZPublisher.HTTPRequest import FileUpload from ZPublisher.HTTPRequest import FileUpload
from ZPublisher.Iterators import filestream_iterator
from zExceptions import Redirect from zExceptions import Redirect
from zope.contenttype import guess_content_type from zope.contenttype import guess_content_type
from zope.interface import implementedBy from zope.interface import implementedBy
...@@ -657,6 +656,9 @@ class File(Persistent, Implicit, PropertyManager, ...@@ -657,6 +656,9 @@ class File(Persistent, Implicit, PropertyManager,
return '' return ''
InitializeClass(File)
manage_addImageForm=DTMLFile('dtml/imageAdd',globals(), manage_addImageForm=DTMLFile('dtml/imageAdd',globals(),
Kind='Image',kind='image') Kind='Image',kind='image')
def manage_addImage(self, id, file, title='', precondition='', content_type='', def manage_addImage(self, id, file, title='', precondition='', content_type='',
...@@ -898,6 +900,8 @@ class Image(File): ...@@ -898,6 +900,8 @@ class Image(File):
return '%s />' % result return '%s />' % result
InitializeClass(Image)
def cookId(id, title, file): def cookId(id, title, file):
if not id and hasattr(file,'filename'): if not id and hasattr(file,'filename'):
......
...@@ -19,6 +19,7 @@ import time ...@@ -19,6 +19,7 @@ import time
from AccessControl.Owned import ownerInfo from AccessControl.Owned import ownerInfo
from AccessControl.SecurityInfo import ClassSecurityInfo from AccessControl.SecurityInfo import ClassSecurityInfo
from App.class_init import InitializeClass
from Persistence import Persistent from Persistence import Persistent
from zope.interface import implements from zope.interface import implements
...@@ -173,7 +174,6 @@ class LockItem(Persistent): ...@@ -173,7 +174,6 @@ class LockItem(Persistent):
return s return s
def asXML(self): def asXML(self):
s = """<?xml version="1.0" encoding="utf-8" ?> s = """<?xml version="1.0" encoding="utf-8" ?>
<d:prop xmlns:d="DAV:"> <d:prop xmlns:d="DAV:">
<d:lockdiscovery> <d:lockdiscovery>
...@@ -181,3 +181,5 @@ class LockItem(Persistent): ...@@ -181,3 +181,5 @@ class LockItem(Persistent):
</d:lockdiscovery> </d:lockdiscovery>
</d:prop>""" % self.asLockDiscoveryProperty(ns="d") </d:prop>""" % self.asLockDiscoveryProperty(ns="d")
return s return s
InitializeClass(LockItem)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment