Author: reebalazs
Date: Mon Oct  1 16:35:44 2007
New Revision: 47076

Modified:
   kukit/kss.core/trunk/kss/core/browser/errorresponse.pt
   kukit/kss.core/trunk/kss/core/doc/tutorial_part2.rst
   kukit/kss.core/trunk/kss/core/tests/kukitresponse_test.pt
   kukit/kss.core/trunk/kss/core/tests/test_browserview.py
   kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py
Log:
base2 followup: further simplify kukit payload / fix up tests and docs

Modified: kukit/kss.core/trunk/kss/core/browser/errorresponse.pt
==============================================================================
--- kukit/kss.core/trunk/kss/core/browser/errorresponse.pt      (original)
+++ kukit/kss.core/trunk/kss/core/browser/errorresponse.pt      Mon Oct  1 
16:35:44 2007
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
-<root xmlns:kukit="http://www.kukit.org/commands/1.0";
+<kukit xmlns="http://www.kukit.org/commands/1.0";
       xmlns:tal="http://xml.zope.org/namespaces/tal";
       xmlns:metal="http://xml.zope.org/namespaces/metal";>
-<kukit:commands>
-       <kukit:command name="error">
-               <kukit:param name="type" tal:content="options/type | 
nothing">system</kukit:param>
-               <kukit:param name="message" 
tal:content="options/message">Exception: reason</kukit:param>
-       </kukit:command>
-</kukit:commands>
-</root>
+<commands>
+       <command name="error">
+               <param name="type" tal:content="options/type | 
nothing">system</param>
+               <param name="message" tal:content="options/message">Exception: 
reason</param>
+       </command>
+</commands>
+</kukit>

Modified: kukit/kss.core/trunk/kss/core/doc/tutorial_part2.rst
==============================================================================
--- kukit/kss.core/trunk/kss/core/doc/tutorial_part2.rst        (original)
+++ kukit/kss.core/trunk/kss/core/doc/tutorial_part2.rst        Mon Oct  1 
16:35:44 2007
@@ -65,18 +65,17 @@
 the source of the response :
 
 ::
-
-        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-        <html xmlns="http://www.w3.org/1999/xhtml";
-              xmlns:kukit="http://www.kukit.org/commands/1.0";><body>
-        <kukit:commands>
-        <kukit:command selector="#portal-siteactions"
+        <?xml version="1.0" ?>
+        <kukit xmlns="http://www.kukit.org/commands/1.0";
+            xmlns:tal="http://xml.zope.org/namespaces/tal";
+            xmlns:metal="http://xml.zope.org/namespaces/metal";>
+        <commands>
+        <command selector="#portal-siteactions"
                        name="replaceInnerHTML" selectorType="">
-            <kukit:param name="html"><h1>We did it!</h1></kukit:param>
-        </kukit:command>
-        </kukit:commands>
-        </body></html>
+            <param name="html"><![CDATA[<h1>We did it!</h1>]]></param>
+        </command>
+        </commands>
+        </kukit><
 
 This is an XML response, where we can see how commands and parameters are
 actually marshalled. When the response is interpreted by the kss engine, it

Modified: kukit/kss.core/trunk/kss/core/tests/kukitresponse_test.pt
==============================================================================
--- kukit/kss.core/trunk/kss/core/tests/kukitresponse_test.pt   (original)
+++ kukit/kss.core/trunk/kss/core/tests/kukitresponse_test.pt   Mon Oct  1 
16:35:44 2007
@@ -1,16 +1,13 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-<html xmlns="http://www.w3.org/1999/xhtml"; 
-         xmlns:kukit="http://www.kukit.org/commands/1.0";>
-       <body>
-               <kukit:command selector="div#demo" name="setHtmlAsChild">
-                       <kukit:param name="html">
-                               <h1 xmlns="http://www.w3.org/1999/xhtml";>it 
worked</h1>
-                       </kukit:param>
-               </kukit:command>
-               <kukit:command selector="div#demo" name="setHtmlAsChild">
-                       <kukit:param name="html">
-                               <h1 xmlns="http://www.w3.org/1999/xhtml";>it 
worked&nbsp;again (test)</h1>
-                       </kukit:param>
-               </kukit:command>
-       </body>
-</html>
+<?xml version="1.0" ?>
+<kukit xmlns="http://www.kukit.org/commands/1.0";
+      xmlns:tal="http://xml.zope.org/namespaces/tal";
+      xmlns:metal="http://xml.zope.org/namespaces/metal";>
+  <commands>
+         <command selector="div#demo" name="setHtmlAsChild">
+                 <param name="html"><![CDATA[<h1 
xmlns="http://www.w3.org/1999/xhtml";>it worked</h1>]]></param>
+         </command>
+         <command selector="div#demo" name="setHtmlAsChild">
+                 <param name="html"><![CDATA[<h1 
xmlns="http://www.w3.org/1999/xhtml";>it worked&nbsp;again (test)</h1>]]></param>
+         </command>
+  </commands>
+</kukit>

Modified: kukit/kss.core/trunk/kss/core/tests/test_browserview.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/tests/test_browserview.py     (original)
+++ kukit/kss.core/trunk/kss/core/tests/test_browserview.py     Mon Oct  1 
16:35:44 2007
@@ -31,7 +31,7 @@
         header = response.getHeader('x-ksscommands')
         self.assert_('the_&amp;lt;&amp;gt;message' in header)   # no < > in 
the message
         self.assert_('\n' not in header)   # no /n in the payload: would 
destroy the page
-        self.assertEqual(header, '<?xml version="1.0"?> <root 
xmlns:kukit="http://www.kukit.org/commands/1.0";> <kukit:commands> 
\t<kukit:command name="error"> \t\t<kukit:param 
name="type">system</kukit:param> \t\t<kukit:param name="message">TheError: 
the_&amp;lt;&amp;gt;message  </kukit:param> \t</kukit:command> 
</kukit:commands> </root> ')
+        self.assertEqual(header, '<?xml version="1.0"?> <kukit 
xmlns="http://www.kukit.org/commands/1.0";> <commands> \t<command name="error"> 
\t\t<param name="type">system</param> \t\t<param name="message">TheError: 
the_&amp;lt;&amp;gt;message  </param> \t</command> </commands> </kukit> ')
 
 def test_suite():
     suites = []

Modified: kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py    (original)
+++ kukit/kss.core/trunk/kss/core/tests/test_kssview_core.py    Mon Oct  1 
16:35:44 2007
@@ -100,12 +100,12 @@
     def _wrapped_commands(self, inline):
         header = textwrap.dedent(u'''\
                 <?xml version="1.0" ?>
-                <root xmlns:kukit="http://www.kukit.org/commands/1.0";>
-                <kukit:commands>
+                <kukit xmlns="http://www.kukit.org/commands/1.0";>
+                <commands>
                 ''')
         footer = textwrap.dedent('''\
-                </kukit:commands>
-                </root>
+                </commands>
+                </kukit>
                 ''')
         return header + inline + footer
 
@@ -126,11 +126,11 @@
         view.getCommandSet('core').replaceInnerHTML('div.class', 'new content')
         result = view.render()
         awaited = u'''\
-<kukit:command selector="div.class" name="replaceInnerHTML"
-               selectorType="">
-    <kukit:param name="html"><![CDATA[new content]]></kukit:param>
-    <kukit:param name="withKssSetup">True</kukit:param>
-</kukit:command>
+<command selector="div.class" name="replaceInnerHTML"
+         selectorType="">
+    <param name="html"><![CDATA[new content]]></param>
+    <param name="withKssSetup">True</param>
+</command>
 '''
         self.assertCommandsEqual(result, awaited)
         
@@ -140,11 +140,11 @@
         cs.replaceInnerHTML('div.class', 'new content')
         result = view.render()
         awaited = u'''\
-<kukit:command selector="div.class" name="replaceInnerHTML"
-               selectorType="">
-    <kukit:param name="html"><![CDATA[new content]]></kukit:param>
-    <kukit:param name="withKssSetup">True</kukit:param>
-</kukit:command>
+<command selector="div.class" name="replaceInnerHTML"
+         selectorType="">
+    <param name="html"><![CDATA[new content]]></param>
+    <param name="withKssSetup">True</param>
+</command>
 '''
         self.assertCommandsEqual(result, awaited)
 
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to