[Zope3-checkins] CVS: Zope3/src/zope/tal/tests/input - test11.html:1.2.50.1 test29.html:1.2.48.1

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Aug 20 10:00:42 EDT 2003


Update of /cvs-repository/Zope3/src/zope/tal/tests/input
In directory cvs.zope.org:/tmp/cvs-serv5066/tests/input

Modified Files:
      Tag: srichter-inlinepython-branch
	test11.html test29.html 
Log Message:
This commit is a bit chaotic, since I accidently created my branch on an old 
checkout.

So the first thing this does is an update with HEAD.

The second part I got the following working:

  <p tal:script="server-python">print "hello"</p>

  Result <p>hello\n</p>\n

This fails the requirement that we eventually want this syntax:

  <script lang="server-python">
    print "hello"
  </script>

It will be fairly difficult to do this, since we have to introduce sort of 
a new namespace to handle this.

Other open issues (I try to solve today):

- How to store global versus local variables. There are two models I can
  see being practical:

  (a) Make all declared variables inside the code global. This would be 
      acceptable, since we want to keep it simple and the feature is aimed
      at the scripter, who usually does not think carefully about namespaces
      anyways.

  (b) Have a special markup for making variables global, maybe by reusing 
      the global keyword?

- How to handle indentation. I have not explored this, but plan to do this 
  today. I also do not know what will happen to multiline code at this 
  point.

- What happens if the code contains other tags? I don't know, but I think
  we can reuse the Javascript trick and place <!-- --> inside the script
  tag to avoid any issues. Of course we would need to handle this case too.

- Security. Currently I call the exec keyword directly without worrying 
  about any intrusive code. Since the TTW module has the same problem I 
  will look there for an answer. However, for the DummyEngine the plain 
  exec is enough I think.



=== Zope3/src/zope/tal/tests/input/test11.html 1.2 => 1.2.50.1 ===
--- Zope3/src/zope/tal/tests/input/test11.html:1.2	Wed Dec 25 09:15:31 2002
+++ Zope3/src/zope/tal/tests/input/test11.html	Wed Aug 20 09:00:05 2003
@@ -11,4 +11,9 @@
   <p tal:on-error="string:x undefined">
     <span tal:content="x"/>
   </p>
+  <tal:block on-error="string:x undefined" replace="x" />
+  <tal:block on-error="string:x undefined">
+  <p tal:content="x">p</p>
+  </tal:block>
+  <div tal:replace="structure string:&lt;hr /&gt;">rule</div>
 </html>


=== Zope3/src/zope/tal/tests/input/test29.html 1.2 => 1.2.48.1 ===
--- Zope3/src/zope/tal/tests/input/test29.html:1.2	Wed Dec 25 09:15:31 2002
+++ Zope3/src/zope/tal/tests/input/test29.html	Wed Aug 20 09:00:05 2003
@@ -1,4 +1,4 @@
-At the tone the time will be
+<div i18n:translate="">At the tone the time will be
 <span i18n:data="here/currentTime"
       i18n:translate="timefmt"
-      i18n:name="time">2:32 pm</span>... beep!
+      i18n:name="time">2:32 pm</span>... beep!</div>




More information about the Zope3-Checkins mailing list