[Zope-Checkins] CVS: Zope/lib/python/webdav - webdav_magic.py:1.1.2.6
Andreas Jung
andreas@zope.com
Thu, 8 Nov 2001 13:13:00 -0500
Update of /cvs-repository/Zope/lib/python/webdav
In directory cvs.zope.org:/tmp/cvs-serv27054
Modified Files:
Tag: ajung-webdav-debug
webdav_magic.py
Log Message:
=== Zope/lib/python/webdav/webdav_magic.py 1.1.2.5 => 1.1.2.6 ===
-def cloneFile(ob,destId,mime_type):
+def cloneFile(ob, destId, mime_type):
import OFS.Image
file = OFS.Image.File(destId, title=destId,
@@ -112,6 +112,16 @@
return file
+def cloneDTMLDocument(ob, destId, mimeType):
+ import OFS.DTMLDocument
+
+ doc = OFS.DTMLDocument.DTMLDocument('', __name__ = destId)
+ doc.title = destId
+ doc.manage_addProperty('content_type', mimeType, 'string')
+
+ return doc
+
+
def webdavCloneObject(ob, destId, REQUEST):
agent = REQUEST.get("HTTP_USER_AGENT")
@@ -144,7 +154,8 @@
magic_mapping = {
- '.css' : (cloneFile , 'text/css'),
+ '.css' : (cloneDTMLDocument , 'text/css'),
+ '.js' : (cloneDTMLDocument, 'application/javascript'),
}