[Zope-Checkins] SVN: Zope/trunk/lib/python/ add tests for on-error handling in macros for errors in slot fillers; errors

2006-03-14 Thread Fred L. Drake, Jr.
Log message for revision 66017:
  add tests for on-error handling in macros for errors in slot fillers; errors
  in the filler can now be handled by the macro, as intended
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py
  U   Zope/trunk/lib/python/TAL/TALInterpreter.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py 
2006-03-14 17:46:42 UTC (rev 66016)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testDTMLTests.py 
2006-03-14 17:47:30 UTC (rev 66017)
@@ -135,9 +135,49 @@
 expect = util.read_output('DTML3.html')
 util.check_xml(expect, o)
 
+def check_on_error_in_slot_filler(self):
+# The `here` isn't defined, so the macro definition is
+# expected to catch the error that gets raised.
+text = '''\
+
+   
+  
+  cool
+   
+
+
+
+   
+  
+   
+
+'''
+self.t.write(text)
+aa = util.argv(('one', 'two', 'three', 'four', 'five'))
+self.t.__of__(aa)()
+
+def check_on_error_in_slot_default(self):
+# The `here` isn't defined, so the macro definition is
+# expected to catch the error that gets raised.
+text = '''\
+
+   
+  
+
+  
+   
+
+
+
+
+'''
+self.t.write(text)
+aa = util.argv(('one', 'two', 'three', 'four', 'five'))
+self.t.__of__(aa)()
+
+
 def test_suite():
 return unittest.makeSuite(DTMLTests, 'check')
 
 if __name__=='__main__':
 main()
-

Modified: Zope/trunk/lib/python/TAL/TALInterpreter.py
===
--- Zope/trunk/lib/python/TAL/TALInterpreter.py 2006-03-14 17:46:42 UTC (rev 
66016)
+++ Zope/trunk/lib/python/TAL/TALInterpreter.py 2006-03-14 17:47:30 UTC (rev 
66017)
@@ -769,11 +769,13 @@
 slot = slots.get(slotName)
 if slot is not None:
 prev_source = self.sourceFile
-self.interpret(slot)
-if self.sourceFile != prev_source:
-self.engine.setSourceFile(prev_source)
-self.sourceFile = prev_source
-self.pushMacro(macroName, slots, entering=0)
+try:
+self.interpret(slot)
+finally:
+if self.sourceFile != prev_source:
+self.engine.setSourceFile(prev_source)
+self.sourceFile = prev_source
+self.pushMacro(macroName, slots, entering=0)
 return
 self.pushMacro(macroName, slots)
 # Falling out of the 'if' allows the macro to be interpreted.

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


[Zope-Checkins] CVS: Packages/TAL - TALInterpreter.py:1.78.4.7.24.1

2006-03-14 Thread Fred L. Drake, Jr.
Update of /cvs-repository/Packages/TAL
In directory cvs.zope.org:/tmp/cvs-serv1857/lib/python/TAL

Modified Files:
  Tag: zc-Zope-2-7-5
TALInterpreter.py 
Log Message:
add tests for on-error handling in macros for errors in slot fillers; errors
in the filler can now be handled by the macro, as intended


=== Packages/TAL/TALInterpreter.py 1.78.4.7 => 1.78.4.7.24.1 ===
--- Packages/TAL/TALInterpreter.py:1.78.4.7 Thu Aug 12 12:15:14 2004
+++ Packages/TAL/TALInterpreter.py  Tue Mar 14 12:48:21 2006
@@ -691,11 +691,13 @@
 slot = slots.get(slotName)
 if slot is not None:
 prev_source = self.sourceFile
-self.interpret(slot)
-if self.sourceFile != prev_source:
-self.engine.setSourceFile(prev_source)
-self.sourceFile = prev_source
-self.pushMacro(macroName, slots, entering=0)
+try:
+self.interpret(slot)
+finally:
+if self.sourceFile != prev_source:
+self.engine.setSourceFile(prev_source)
+self.sourceFile = prev_source
+self.pushMacro(macroName, slots, entering=0)
 return
 self.pushMacro(macroName, slots)
 # Falling out of the 'if' allows the macro to be interpreted.

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


[Zope-Checkins] CVS: Products/PageTemplates/tests - testDTMLTests.py:1.8.108.1

2006-03-14 Thread Fred L. Drake, Jr.
Update of /cvs-repository/Products/PageTemplates/tests
In directory 
cvs.zope.org:/tmp/cvs-serv1857/lib/python/Products/PageTemplates/tests

Modified Files:
  Tag: zc-Zope-2-7-5
testDTMLTests.py 
Log Message:
add tests for on-error handling in macros for errors in slot fillers; errors
in the filler can now be handled by the macro, as intended


=== Products/PageTemplates/tests/testDTMLTests.py 1.8 => 1.8.108.1 ===
--- Products/PageTemplates/tests/testDTMLTests.py:1.8   Wed Sep 18 11:12:46 2002
+++ Products/PageTemplates/tests/testDTMLTests.py   Tue Mar 14 12:48:20 2006
@@ -135,9 +135,49 @@
 expect = util.read_output('DTML3.html')
 util.check_xml(expect, o)
 
+def check_on_error_in_slot_filler(self):
+# The `here` isn't defined, so the macro definition is
+# expected to catch the error that gets raised.
+text = '''\
+
+   
+  
+  cool
+   
+
+
+
+   
+  
+   
+
+'''
+self.t.write(text)
+aa = util.argv(('one', 'two', 'three', 'four', 'five'))
+self.t.__of__(aa)()
+
+def check_on_error_in_slot_default(self):
+# The `here` isn't defined, so the macro definition is
+# expected to catch the error that gets raised.
+text = '''\
+
+   
+  
+
+  
+   
+
+
+
+
+'''
+self.t.write(text)
+aa = util.argv(('one', 'two', 'three', 'four', 'five'))
+self.t.__of__(aa)()
+
+
 def test_suite():
 return unittest.makeSuite(DTMLTests, 'check')
 
 if __name__=='__main__':
 main()
-

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/App/Extensions.py removed support for .pyp files ...no idea

2006-03-14 Thread Andreas Jung
Log message for revision 66019:
  removed support for .pyp files ...no idea
  what they were used for but the related code
  will definetely no longer work under Python 2.4
  because the rotor module has gone...
  

Changed:
  U   Zope/trunk/lib/python/App/Extensions.py

-=-
Modified: Zope/trunk/lib/python/App/Extensions.py
===
--- Zope/trunk/lib/python/App/Extensions.py 2006-03-14 19:59:04 UTC (rev 
66018)
+++ Zope/trunk/lib/python/App/Extensions.py 2006-03-14 20:05:29 UTC (rev 
66019)
@@ -110,12 +110,12 @@
 return old[name]
 
 base, ext = os.path.splitext(module)
-if ext in ('py', 'pyp', 'pyc'):
+if ext in ('py', 'pyc'):
 # XXX should never happen; splitext() keeps '.' with the extension
 p = base
 else:
 p = module
-p=getPath('Extensions', p, suffixes=('','py','pyp','pyc'))
+p=getPath('Extensions', p, suffixes=('','py','pyc'))
 if p is None:
 raise NotFound, (
 "The specified module, %s, couldn't be found." % module)
@@ -129,16 +129,6 @@
 file.close()
 m=binmod.__dict__
 
-elif ext=='.pyp':
-import rotor
-prod_id=module.split('.', 1)[0]
-data=zlib.decompress(
-rotor.newrotor(prod_id +' shshsh').decrypt(open(p,'rb').read())
-)
-execsrc=compile(data, module, 'exec')
-m={}
-exec execsrc in m
-
 else:
 try: execsrc=open(p)
 except: raise NotFound, (

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


[Zope-Checkins] SVN: Zope/trunk/doc/CHANGES.txt Remove stale To-do's.

2006-03-14 Thread Tres Seaver
Log message for revision 66020:
  Remove stale To-do's.

Changed:
  U   Zope/trunk/doc/CHANGES.txt

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-03-14 20:05:29 UTC (rev 66019)
+++ Zope/trunk/doc/CHANGES.txt  2006-03-15 04:42:02 UTC (rev 66020)
@@ -6,22 +6,14 @@
 
   To-do
 
-   - Reenable C permission roles by implementing recent Python
- changes in C, brining the Python and C implementations back in
- sync.  See lib/python/AccessControl/PermissionRole.py.
-
- Add cyclic-garbage collection support to C extension classes,
  especially to acquisition wrappers.
 
-   - Reenable C Zope security policy by implementing recent Python
- changes in C, bringing the Python and C implementations back in
- sync.  See lib/python/AccessControl/ZopeSecurityPolicy.py.
+ N.B:  ExtensionClassType already declares that it supports GC
+ (via the Py_TPFLAGS_HAVE_GC flag), but does not appear to conform
+ to the rules for such a type laid out in the Python docs:
+ http://docs.python.org/api/supporting-cycle-detection.html
 
-   - Change acquisition wrappers to implement the descr get slot
- directly, thus speeding the use of the slot.
-
-   - Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
-
   Trunk only (unreleased)
 
 Restructuring

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