[Zope-Checkins] SVN: Zope/branches/2.10/ Merged r69769:69770 from 2.9 branch.

Stefan H. Holek stefan at epy.co.at
Thu Aug 24 12:52:48 EDT 2006


Log message for revision 69771:
  Merged r69769:69770 from 2.9 branch.
  
  Moved 'alt' property from File to Image.
  Fixes http://www.zope.org/Collectors/Zope/1907
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/Image.py
  U   Zope/branches/2.10/lib/python/OFS/dtml/imageView.dtml
  U   Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.10/doc/CHANGES.txt	2006-08-24 16:46:48 UTC (rev 69770)
+++ Zope/branches/2.10/doc/CHANGES.txt	2006-08-24 16:52:47 UTC (rev 69771)
@@ -8,6 +8,8 @@
 
     Bugs fixed
 
+      - Collector #1907: Moved 'alt' property from File to Image.
+
       - Collector #1983: Specifying session-resolution-seconds >= 1200 caused
         Zope startup to fail.
 

Modified: Zope/branches/2.10/lib/python/OFS/Image.py
===================================================================
--- Zope/branches/2.10/lib/python/OFS/Image.py	2006-08-24 16:46:48 UTC (rev 69770)
+++ Zope/branches/2.10/lib/python/OFS/Image.py	2006-08-24 16:52:47 UTC (rev 69771)
@@ -85,7 +85,6 @@
 
     precondition=''
     size=None
-    alt=''
 
     manage_editForm  =DTMLFile('dtml/fileEdit',globals(),
                                Kind='File',kind='file')
@@ -110,7 +109,6 @@
         )
 
     _properties=({'id':'title', 'type': 'string'},
-                 {'id':'alt', 'type':'string'},
                  {'id':'content_type', 'type':'string'},
                  )
 
@@ -734,6 +732,7 @@
     security = ClassSecurityInfo()
     security.declareObjectProtected(View)
 
+    alt=''
     height=''
     width=''
 
@@ -750,6 +749,7 @@
     security.declareProtected(delete_objects, 'DELETE')
 
     _properties=({'id':'title', 'type': 'string'},
+                 {'id':'alt', 'type':'string'},
                  {'id':'content_type', 'type':'string','mode':'w'},
                  {'id':'height', 'type':'string'},
                  {'id':'width', 'type':'string'},

Modified: Zope/branches/2.10/lib/python/OFS/dtml/imageView.dtml
===================================================================
--- Zope/branches/2.10/lib/python/OFS/dtml/imageView.dtml	2006-08-24 16:46:48 UTC (rev 69770)
+++ Zope/branches/2.10/lib/python/OFS/dtml/imageView.dtml	2006-08-24 16:52:47 UTC (rev 69771)
@@ -2,10 +2,7 @@
 <dtml-var manage_tabs>
 
 <p>
-<img src="&dtml-absolute_url;" <dtml-if 
- width>width="&dtml-width;" </dtml-if><dtml-if 
- height>height="&dtml-height;" </dtml-if
- > alt="&dtml-title_or_id;" />
+ <dtml-var tag>
 </p>
 
 <dtml-var manage_page_footer>

Modified: Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py
===================================================================
--- Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py	2006-08-24 16:46:48 UTC (rev 69770)
+++ Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py	2006-08-24 16:52:47 UTC (rev 69771)
@@ -277,8 +277,12 @@
           ('<img src="http://foo/file" alt="" title="" height="16" width="16" />'))
 
     def testTag(self):
-        self.assertEqual(self.file.tag(),
-          ('<img src="http://foo/file" alt="" title="" height="16" width="16" />'))
+        tag_fmt = '<img src="http://foo/file" alt="%s" title="%s" height="16" width="16" />'
+        self.assertEqual(self.file.tag(), (tag_fmt % ('','')))
+        self.file.manage_changeProperties(title='foo')
+        self.assertEqual(self.file.tag(), (tag_fmt % ('','foo')))
+        self.file.manage_changeProperties(alt='bar')
+        self.assertEqual(self.file.tag(), (tag_fmt % ('bar','foo')))
 
     def testViewImageOrFile(self):
         pass # dtml method,screw it



More information about the Zope-Checkins mailing list