[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content - image.py:1.3 imageedit.pt:1.3

Steve Alexander steve@cat-box.net
Mon, 30 Dec 2002 09:03:53 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/content
In directory cvs.zope.org:/tmp/cvs-serv23914/src/zope/app/browser/content

Modified Files:
	image.py imageedit.pt 
Log Message:
Large refactoring of the event service.


=== Zope3/src/zope/app/browser/content/image.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/content/image.py:1.2	Wed Dec 25 09:12:30 2002
+++ Zope3/src/zope/app/browser/content/image.py	Mon Dec 30 09:02:52 2002
@@ -17,12 +17,12 @@
 """
 
 from zope.app.browser.content.file import FileUpload
+from zope.app.size import byteDisplay
 from zope.app.event.objectevent import ObjectModifiedEvent
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.event import publish
+from zope.app.event import publish
 from zope.publisher.browser import BrowserView
 
-
 class ImageData(BrowserView):
 
     def __call__(self):
@@ -93,7 +93,13 @@
 
     def size(self):
         sx, sy = self.context.getImageSize()
-        return "%s x %s pixels" % (sx > 0 and sx or 0, sx > 0 and sy or 0)
+        if sx < 0:
+            sx = '?'
+        if sy < 0:
+            sy = '?'
+        return "%s x %s pixels, %s" % (
+                sx, sy, byteDisplay(self.context.getSize())
+                )
 
     def apply_update(self, data):
         """Apply user inputs


=== Zope3/src/zope/app/browser/content/imageedit.pt 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/content/imageedit.pt:1.2	Wed Dec 25 09:12:30 2002
+++ Zope3/src/zope/app/browser/content/imageedit.pt	Mon Dec 30 09:02:52 2002
@@ -10,7 +10,7 @@
         <tr metal:fill-slot="extra_top">
           <td class="EditAttributeName">Size</td>
 	  <td class="EditAttributeValue" tal:content="view/size"
-             >103 x 45 pixels</td>            
+             >103 x 45 pixels, 43KB</td>            
         </tr>
       </table>