<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>pyjamas-web/f.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/htmldict.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/index.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/mainpage.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/modpython_gateway.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/tls.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/zct.py</filename>
    </added>
    <added>
      <filename>pyjamas-web/zctlogin.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-from ui import Button, RootPanel
+from ui import Button, RootPanel, Label
 import Window
 
 def greet(sender):
@@ -8,3 +8,4 @@ class Hello:
     def onModuleLoad(self):
         b = Button(&quot;Click me&quot;, greet)
         RootPanel().add(b)
+        RootPanel().add(Label(&quot;hello world&quot;))</diff>
      <filename>pyjamas-web/examples/helloworld/Hello.py</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,13 @@
 # limitations under the License.
 
 from __pyjamas__ import JS
+from lxml import etree
 
 sCaptureElem = None
 sEventPreviewStack = []
 
 def init():
+    return
     JS(&quot;&quot;&quot;
     // Set up capture event dispatchers.
     $wnd.__dispatchCapturedMouseEvent = function(evt) {
@@ -96,9 +98,7 @@ def addEventPreview(preview):
     sEventPreviewStack.append(preview)
 
 def appendChild(parent, child):
-    JS(&quot;&quot;&quot;
-    parent.appendChild(child);
-    &quot;&quot;&quot;)
+    parent.append(child)
 
 def compare(elem1, elem2):
     JS(&quot;&quot;&quot;
@@ -118,9 +118,7 @@ def createDiv():
     return createElement(&quot;div&quot;)
 
 def createElement(tag):
-    JS(&quot;&quot;&quot;
-    return $doc.createElement(tag);
-    &quot;&quot;&quot;)
+    return etree.Element(tag)
 
 def createFieldSet():
     return createElement(&quot;fieldset&quot;)
@@ -329,15 +327,10 @@ def getAbsoluteTop(elem):
     &quot;&quot;&quot;)
 
 def getAttribute(elem, attr):
-    JS(&quot;&quot;&quot;
-    var ret = elem[attr];
-    return (ret == null) ? null : String(ret);
-    &quot;&quot;&quot;)
+    return elem.attrib.get(attr)
 
 def getBooleanAttribute(elem, attr):
-    JS(&quot;&quot;&quot;
-    return !!elem[attr];
-    &quot;&quot;&quot;)
+    return bool(getAttribute(elem, attr))
 
 def getCaptureElement():
     global sCaptureElem
@@ -665,14 +658,10 @@ def removeAttribute(element, attribute):
     &quot;&quot;&quot;)
 
 def setAttribute(element, attribute, value):
-    JS(&quot;&quot;&quot;
-    element[attribute] = value;
-    &quot;&quot;&quot;)
+    element.attrib[attribute] = value
 
 def setBooleanAttribute(elem, attr, value):
-    JS(&quot;&quot;&quot;
-    elem[attr] = value;
-    &quot;&quot;&quot;)
+    elem.attrib[attribute] = bool(value)
 
 def setCapture(elem):
     JS(&quot;&quot;&quot;
@@ -681,6 +670,8 @@ def setCapture(elem):
     &quot;&quot;&quot;)
 
 def setEventListener(element, listener):
+    print &quot;TODO&quot;
+    return
     &quot;&quot;&quot;
     Register an object to receive event notifications for the given
     element.  The listener's onBrowserEvent() method will be called
@@ -692,6 +683,10 @@ def setEventListener(element, listener):
     &quot;&quot;&quot;)
 
 def setInnerHTML(element, html):
+    if not html:
+        html = ''
+    element.text = html
+    return 
     JS(&quot;&quot;&quot;
     if (!html) {
         html = &quot;&quot;;
@@ -700,6 +695,11 @@ def setInnerHTML(element, html):
     &quot;&quot;&quot;)
 
 def setInnerText(elem, text):
+    while len(elem) &gt; 0:
+        elem.remove(0)
+    elem.text = text
+    print &quot;TODO - convert to text, disallowing HTML&quot;
+    return
     JS(&quot;&quot;&quot;
     // Remove all children first.
     while (elem.firstChild) {
@@ -726,6 +726,8 @@ def setOptionText(select, text, index):
     &quot;&quot;&quot;)
 
 def setStyleAttribute(element, name, value):
+    print &quot;TODO&quot;
+    return
     JS(&quot;&quot;&quot;
     element.style[name] = value;
     &quot;&quot;&quot;)</diff>
      <filename>pyjamas-web/library/DOM.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 from __pyjamas__ import JS
 
 def init():
+    return
     JS(&quot;&quot;&quot;
     $wnd.__historyToken = '';
 </diff>
      <filename>pyjamas-web/library/History.py</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,8 @@ import Location
 closingListeners = []
 resizeListeners = []
 
+from __pyjamas__ import JS
+
 def addWindowCloseListener(listener):
     global closingListeners
     closingListeners.append(listener)
@@ -39,7 +41,7 @@ def getClientWidth():
     return $doc.body.clientWidth;
     &quot;&quot;&quot;)
 
-JS(&quot;var Window_location = null&quot;)
+#JS(&quot;var Window_location = null&quot;)
 def getLocation():
     global location
     JS(&quot;&quot;&quot;
@@ -124,6 +126,8 @@ def fireResizedImpl():
         listener.onWindowResized(getClientWidth(), getClientHeight())
 
 def init():
+    print &quot;TODO&quot;
+    return
     JS(&quot;&quot;&quot;
     $wnd.__pygwt_initHandlers(
         function() {</diff>
      <filename>pyjamas-web/library/Window.py</filename>
    </modified>
    <modified>
      <diff>@@ -15,9 +15,10 @@
 
 # iteration from Bob Ippolito's Iteration in JavaScript
 # pyjs_extend from Kevin Lindsey's Inteheritance Tutorial (http://www.kevlindev.com/tutorials/javascript/inheritance/)
-from __pyjamas__ import JS
+from pyjamas.__pyjamas__ import JS
 
-JS(&quot;&quot;&quot;
+if None:
+	JS(&quot;&quot;&quot;
 StopIteration = function () {};
 StopIteration.prototype = new Error();
 StopIteration.name = 'StopIteration';
@@ -520,16 +521,6 @@ def slice(object, lower, upper):
     return null;
     &quot;&quot;&quot;)
 
-def str(text):
-    JS(&quot;&quot;&quot;
-    return String(text);
-    &quot;&quot;&quot;)
-
-def int(text, radix=0):
-    JS(&quot;&quot;&quot;
-    return parseInt(text, radix);
-    &quot;&quot;&quot;)
-
 def len(object):
     JS(&quot;&quot;&quot;
     if (object==null) return 0;
@@ -624,9 +615,7 @@ def isFunction(a):
     &quot;&quot;&quot;)
 
 def isString(a):
-    JS(&quot;&quot;&quot;
-    return typeof a == 'string';
-    &quot;&quot;&quot;)
+	return isinstance(a, str) or isinstance(a, type(u''))
 
 def isNull(a):
     JS(&quot;&quot;&quot;
@@ -649,9 +638,7 @@ def isIteratable(a):
     &quot;&quot;&quot;)
 
 def isNumber(a):
-    JS(&quot;&quot;&quot;
-    return typeof a == 'number' &amp;&amp; isFinite(a);
-    &quot;&quot;&quot;)
+    return type(a) is int or type(a) is long
 
 def toJSObjects(x):
     &quot;&quot;&quot;</diff>
      <filename>pyjamas-web/library/pyjslib.py</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ from History import History
 import Window
 from sets import Set
 
+from __pyjamas__ import doc
 
 class Event:
     &quot;&quot;&quot;
@@ -481,6 +482,9 @@ class Button(ButtonBase):
             self.addClickListener(listener)
 
     def adjustType(self, button):
+        if DOM.getAttribute(button, 'type'):
+            DOM.setAttribute(button, 'type', 'button')
+        return
         JS(&quot;&quot;&quot;
         if (button.type == 'submit') {
             try { button.setAttribute(&quot;type&quot;, &quot;button&quot;); } catch (e) { }
@@ -1763,6 +1767,7 @@ class RootPanelCls(AbsolutePanel):
         self.onAttach()
 
     def getBodyElement(self):
+        return doc().find('body')
         JS(&quot;&quot;&quot;
         return $doc.body;
         &quot;&quot;&quot;)
@@ -1805,7 +1810,7 @@ class RootPanelCls(AbsolutePanel):
     def onWindowClosing(cls):
         return None
 
-def RootPanel(element):
+def RootPanel(element=None):
 	if pyjslib.isString(element):
 		return RootPanelCls().get(element)
 	return RootPanelCls(element)</diff>
      <filename>pyjamas-web/library/ui.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>pyjamas-web/library/f</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f2cd1c06a364cfa3d42137c363bec4709c45f3db</id>
    </parent>
  </parents>
  <author>
    <name>lkcl</name>
    <email>lkcl@lkcl.net</email>
  </author>
  <url>http://github.com/lkcl/pyjamas-desktop/commit/ac478c87f2aec286cf49dbbfbe18222df364feb6</url>
  <id>ac478c87f2aec286cf49dbbfbe18222df364feb6</id>
  <committed-date>2008-09-05T07:28:14-07:00</committed-date>
  <authored-date>2008-09-05T07:28:14-07:00</authored-date>
  <message>first revision of pyjamas-web, getting hello world to work</message>
  <tree>d5c971d77fe6f74633b57e033233ed3d4cea4f64</tree>
  <committer>
    <name>lkcl</name>
    <email>lkcl@lkcl.net</email>
  </committer>
</commit>
