[Zope-Checkins] SVN: Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py fixes

2006-12-17 Thread Andreas Jung
Log message for revision 71578:
  fixes
  

Changed:
  U   
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py

-=-
Modified: 
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
===
--- 
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
2006-12-17 20:24:43 UTC (rev 71577)
+++ 
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
2006-12-17 20:24:56 UTC (rev 71578)
@@ -122,7 +122,7 @@
 self.id = id
 self.expand = 0
   
 self.ZBindings_edit(self._default_bindings)
-self.output_encoding = 'utf-8'
+self.output_encoding = encoding
 
 # default content
 if not text:
@@ -146,9 +146,9 @@
 self.output_encoding = 'utf-8'
 else:   
 self.output_encoding = encoding
+else:
+encoding = self.output_encoding
 
-encoding = self.output_encoding
-
 if not isinstance(text, unicode):
 text = unicode(text, encoding)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py - fixes for WebDAV/FTP support

2006-12-17 Thread Andreas Jung
Log message for revision 71563:
  - fixes for WebDAV/FTP support
  - PUT() now uses pt_edit() in order to play nicely
with encoded text. We *except* the the encoding of the uploaded
text is the same as the original encoding (self.output_encoding)
  

Changed:
  U   
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py

-=-
Modified: 
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
===
--- 
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
2006-12-17 15:10:10 UTC (rev 71562)
+++ 
Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
2006-12-17 15:46:14 UTC (rev 71563)
@@ -292,8 +292,9 @@
 """ Handle HTTP PUT requests """
 self.dav__init(REQUEST, RESPONSE)
 self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
-## XXX this should be unicode or we must pass an encoding
-self.pt_edit(REQUEST.get('BODY', ''))
+text = REQUEST.get('BODY', '')
+content_type = guess_type('', text) 
+self.pt_edit(text, content_type, self.output_encoding)
 RESPONSE.setStatus(204)
 return RESPONSE
 
@@ -304,8 +305,7 @@
 security.declareProtected(ftp_access, 'manage_FTPget')
 def manage_FTPget(self):
 "Get source for FTP download"
-self.REQUEST.RESPONSE.setHeader('Content-Type', self.content_type)
-return self.read()
+return self.pt_render()
 
 security.declareProtected(view_management_screens, 'html')
 def html(self):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins