[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/i18nfile/browser/i Removed two XXX comments.

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Jul 7 18:58:37 EDT 2004


Log message for revision 26194:
Removed two XXX comments.

1. Make use of the ISized adapter.

2. The one about content length was outdated in my opinion.




-=-
Modified: Zope3/trunk/src/zope/app/i18nfile/browser/i18nimage.py
===================================================================
--- Zope3/trunk/src/zope/app/i18nfile/browser/i18nimage.py	2004-07-07 22:36:03 UTC (rev 26193)
+++ Zope3/trunk/src/zope/app/i18nfile/browser/i18nimage.py	2004-07-07 22:58:37 UTC (rev 26194)
@@ -15,11 +15,13 @@
 
 $Id$
 """
+from urllib import quote
+
 from zope.i18n.negotiator import negotiator
+
 from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.file.browser.image import ImageData
 from zope.app.size import byteDisplay
-from urllib import quote
 
 class I18nImageEdit(object):
 
@@ -28,16 +30,9 @@
     description = _('This edit form allows you to make changes to the ' +
                    'properties of this image.')
 
-    def getImageSize(self, language=None):
-        # XXX Change to ISizeable adapter
-        size = self.context.getImageSize(language)
-        sx, sy = size
-        if sx < 0:
-            sx = '?'
-        if sy < 0:
-            sy = '?'
-        return "%s x %s pixels, %s" % (sx, sy,
-            byteDisplay(self.context.getSize()))
+    def size(self, language=None):
+        sized = ISized(self.context._get(language))
+        return sized.sizeForDisplay()
 
     def action(self, contentType, data, language, defaultLanguage,
                selectLanguage=None, removeLanguage=None,
@@ -65,9 +60,7 @@
         if self.request is not None:
             langs = self.context.getAvailableLanguages()
             language = negotiator.getLanguage(langs, self.request)
-
             self.request.response.setHeader('content-type', image.contentType)
-            # XXX: no content-length?  See ImageData.__call__
         return image.getData(language)
 
 

Modified: Zope3/trunk/src/zope/app/i18nfile/browser/image_edit.pt
===================================================================
--- Zope3/trunk/src/zope/app/i18nfile/browser/image_edit.pt	2004-07-07 22:36:03 UTC (rev 26193)
+++ Zope3/trunk/src/zope/app/i18nfile/browser/image_edit.pt	2004-07-07 22:58:37 UTC (rev 26194)
@@ -84,7 +84,7 @@
     <div class="row">
       <div class="label" i18n:translate="">Dimensions</div>
       <div class="field"
-          tal:content="python:view.getImageSize(request.get('language'))">
+          tal:content="python:view.size(request.get('language'))">
         40 x 40 pixels, 10 kB
       </div>
     </div>



More information about the Zope3-Checkins mailing list