[Zope-Checkins] SVN: Zope/branches/2.12/ fix regression in traversing to 'macros' on template-based browser views, which crept in somewhere on the way to 2.12

2010-03-23 Thread David Glick
Log message for revision 110119:
  fix regression in traversing to 'macros' on template-based browser views, 
which crept in somewhere on the way to 2.12

Changed:
  U   Zope/branches/2.12/doc/CHANGES.rst
  U   Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py
  U   Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py

-=-
Modified: Zope/branches/2.12/doc/CHANGES.rst
===
--- Zope/branches/2.12/doc/CHANGES.rst  2010-03-23 21:12:19 UTC (rev 110118)
+++ Zope/branches/2.12/doc/CHANGES.rst  2010-03-23 21:43:11 UTC (rev 110119)
@@ -20,6 +20,8 @@
 Bugs Fixed
 ++
 
+- Restore ability to traverse to 'macros' on template-based browser views.
+
 - Protect ZCTextIndex's clear method against storing Acquisition wrappers.
 
 - LP #195761: fixed ZMI XML export / import and restored it to the UI.

Modified: Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py
===
--- Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py   
2010-03-23 21:12:19 UTC (rev 110118)
+++ Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py   
2010-03-23 21:43:11 UTC (rev 110119)
@@ -421,6 +421,8 @@
 raise NotFound(self, name, request)
 
 def __getitem__(self, name):
+if name == 'macros':
+return self.index.macros
 return self.index.macros[name]
 
 def __call__(self, *args, **kw):

Modified: 
Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py
===
--- Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py
2010-03-23 21:12:19 UTC (rev 110118)
+++ Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py
2010-03-23 21:43:11 UTC (rev 110119)
@@ -41,6 +41,12 @@
 index.macros = {}
 index.macros['aaa'] = aaa = object()
 self.failUnless(view['aaa'] is aaa)
+
+def test__getitem__gives_shortcut_to_index_macros(self):
+view = self._makeOne()
+view.index = index = DummyTemplate()
+index.macros = {}
+self.failUnless(view['macros'] is index.macros)
 
 def test___call___no_args_no_kw(self):
 view = self._makeOne()

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


[Zope-Checkins] SVN: Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py fix obvious NameError

2010-03-23 Thread David Glick
Log message for revision 110120:
  fix obvious NameError

Changed:
  U   Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py

-=-
Modified: Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py
===
--- Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py   
2010-03-23 21:43:11 UTC (rev 110119)
+++ Zope/branches/2.12/src/Products/Five/browser/metaconfigure.py   
2010-03-23 21:48:57 UTC (rev 110120)
@@ -230,7 +230,7 @@
 if view is not None:
 return view
 
-raise NotFoundError(self, name, request)
+raise NotFound(self, name, request)
 
 cdict['publishTraverse'] = publishTraverse
 

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


[Zope-Checkins] SVN: Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py avoid test method name collision

2010-03-23 Thread David Glick
Log message for revision 110121:
  avoid test method name collision

Changed:
  U   Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py

-=-
Modified: 
Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py
===
--- Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py
2010-03-23 21:48:57 UTC (rev 110120)
+++ Zope/branches/2.12/src/Products/Five/browser/tests/test_metaconfigure.py
2010-03-23 21:52:11 UTC (rev 110121)
@@ -69,7 +69,7 @@
 self.failUnless(result is index)
 self.assertEqual(index._called_with, ((), {'foo': 'bar'}))
 
-def test___call___no_args_no_kw(self):
+def test___call___w_args_w_kw(self):
 view = self._makeOne()
 view.index = index = DummyTemplate()
 result = view('abc', foo='bar')

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


[Zope-Checkins] SVN: Zope/trunk/src/Products/Five/browser/ merge r110118-110121 from 2.12 branch

2010-03-23 Thread David Glick
Log message for revision 110122:
  merge r110118-110121 from 2.12 branch

Changed:
  U   Zope/trunk/src/Products/Five/browser/metaconfigure.py
  U   Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py

-=-
Modified: Zope/trunk/src/Products/Five/browser/metaconfigure.py
===
--- Zope/trunk/src/Products/Five/browser/metaconfigure.py   2010-03-23 
21:52:11 UTC (rev 110121)
+++ Zope/trunk/src/Products/Five/browser/metaconfigure.py   2010-03-23 
22:01:16 UTC (rev 110122)
@@ -231,7 +231,7 @@
 if view is not None:
 return view
 
-raise NotFoundError(self, name, request)
+raise NotFound(self, name, request)
 
 cdict['publishTraverse'] = publishTraverse
 
@@ -422,6 +422,8 @@
 raise NotFound(self, name, request)
 
 def __getitem__(self, name):
+if name == 'macros':
+return self.index.macros
 return self.index.macros[name]
 
 def __call__(self, *args, **kw):

Modified: Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py
===
--- Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py
2010-03-23 21:52:11 UTC (rev 110121)
+++ Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py
2010-03-23 22:01:16 UTC (rev 110122)
@@ -41,6 +41,12 @@
 index.macros = {}
 index.macros['aaa'] = aaa = object()
 self.failUnless(view['aaa'] is aaa)
+
+def test__getitem__gives_shortcut_to_index_macros(self):
+view = self._makeOne()
+view.index = index = DummyTemplate()
+index.macros = {}
+self.failUnless(view['macros'] is index.macros)
 
 def test___call___no_args_no_kw(self):
 view = self._makeOne()
@@ -63,7 +69,7 @@
 self.failUnless(result is index)
 self.assertEqual(index._called_with, ((), {'foo': 'bar'}))
 
-def test___call___no_args_no_kw(self):
+def test___call___w_args_w_kw(self):
 view = self._makeOne()
 view.index = index = DummyTemplate()
 result = view('abc', foo='bar')

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