Permalink
Browse files

whoops mess...

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@667 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
1 parent d4ea324 commit e99cd7038825ac0ccc68666ecb672a11956650e3 lkcl committed Jun 24, 2009
View
@@ -43,6 +43,23 @@
pyjs.main()
"""
+pyjdrun = """#!%s
+
+pyjdpth = r'%s'
+
+import os
+import sys
+sys.path[0:0] = [
+ r'%s',
+ ]
+
+import pyjd
+sys.path += [os.path.join(pyjdpth, 'library')]
+
+if __name__ == '__main__':
+ pyjd.main()
+"""
+
batcmdtxt = '''@echo off
set CMD_LINE_ARGS=
:setArgs
@@ -107,4 +124,5 @@ def make_cmd(prefix, pth, pyjspth, cmdname, txt):
make_cmd(prefix, pth, pyjspth, "pyjsbuild", pyjsbuild)
make_cmd(prefix, pth, pyjspth, "pyjscompile", pyjscompile)
+ make_cmd(prefix, pth, pyjspth, "pyjdrun", pyjdrun)
@@ -5,6 +5,11 @@
def greet(fred):
Window.alert("Hello, AJAX!")
+class Hello:
+ def onModuleLoad(self):
+ b = Button("Click me", greet)
+ RootPanel().add(b)
+
if __name__ == '__main__':
- b = Button("Click me", greet)
- RootPanel().add(b)
+ h = Hello()
+ h.onModuleLoad()
@@ -48,10 +48,10 @@ def __init__(self):
dock.add(north1, DockPanel.NORTH)
dock.add(scroller, DockPanel.CENTER)
- Logger.write("Layouts", "TODO: flowpanel")
+ #Logger.write("Layouts", "TODO: flowpanel")
flow = FlowPanel()
for i in range(8):
- flow.add(CheckBox("Flow " + i))
+ flow.add(CheckBox("Flow %d" % i))
horz = HorizontalPanel()
horz.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
@@ -77,7 +77,7 @@ def __init__(self):
menu1.addItem("child11")
menu1.addItem("child12")
- Logger.write("Layouts", "TODO: htmlpanel")
+ #Logger.write("Layouts", "TODO: htmlpanel")
id = HTMLPanel.createUniqueId()
text="""This is an <code>HTMLPanel</code>. It allows you to add
components inside existing HTML, like this: <span id='%s' />
@@ -26,7 +26,7 @@ def __init__(self):
self.list.setMultipleSelect(True)
for i in range(len(self.sStrings)):
- self.combo.addItem("List " + i)
+ self.combo.addItem("List %d" % i)
self.combo.setSelectedIndex(0)
self.fillList(0)
@@ -24,7 +24,7 @@ def __init__(self):
list = ListBox()
list.setVisibleItemCount(5)
for i in range(10):
- list.addItem("list item " + i)
+ list.addItem("list item %d" % i)
panel.add(list)
panel.setSpacing(8)
@@ -20,7 +20,7 @@ def __init__(self):
for i in range(10):
for j in range(5):
- inner.setText(i, j, "" + i + "," + j)
+ inner.setText(i, j, "%d" % i + ",%d" % j)
inner.setWidth("100%")
outer.setWidth("100%")
@@ -48,7 +48,7 @@ def createTextThing(self, textBox):
return p
def updateText(self, text, echo):
- echo.setHTML("Text: " + text.getText() + "<br>" + "Selection: " + text.getCursorPos() + ", " + text.getSelectionLength())
+ echo.setHTML("Text: " + text.getText() + "<br>" + "Selection: %d" % text.getCursorPos() + ", %d" % text.getSelectionLength())
class TextBoxListener:
@@ -0,0 +1,40 @@
+sNextHashId = 0
+
+def getNextHashId():
+ global sNextHashId
+ sNextHashId += 1
+ return sNextHashId
+
+def getHashCode(o):
+ JS("""
+ return (o == null) ? 0 :
+ (o.$H ? o.$H : (o.$H = pygwt_getNextHashId()));
+ """)
+
+def getModuleName():
+ JS("""
+ return $moduleName;
+ """)
+
+def getModuleBaseURL():
+ JS("""
+ // this is intentionally not using $doc, because we want the module's own url
+ var s = document.location.href;
+
+ // Pull off any hash.
+ var i = s.indexOf('#');
+ if (i != -1)
+ s = s.substring(0, i);
+
+ // Pull off any query string.
+ i = s.indexOf('?');
+ if (i != -1)
+ s = s.substring(0, i);
+
+ // Rip off everything after the last slash.
+ i = s.lastIndexOf('/');
+ if (i != -1)
+ s = s.substring(0, i);
+
+ return (s.length > 0) ? s + "/" : "";
+ """)
Oops, something went wrong.

0 comments on commit e99cd70

Please sign in to comment.