rhmessaging commits: r3187 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-03-20 11:28:57 -0400 (Fri, 20 Mar 2009)
New Revision: 3187
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Clear out job hold/release/remove reason after form is processed.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2009-03-20 15:06:50 UTC (rev 3186)
+++ mgmt/trunk/cumin/python/cumin/job.py 2009-03-20 15:28:57 UTC (rev 3187)
@@ -1207,6 +1207,7 @@
super(JobReasonBulkActionForm, self).process_submit(session, *args)
def process_return(self, session, *args):
+ self.reason.set(session, "")
branch = session.branch()
self.frame.show_view(branch)
self.page.set_frame(branch, self.frame)
15 years, 10 months
rhmessaging commits: r3186 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-03-20 11:06:50 -0400 (Fri, 20 Mar 2009)
New Revision: 3186
Modified:
mgmt/trunk/wooly/python/wooly/__init__.py
Log:
Fix app error when form has dictparameter
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-20 15:01:50 UTC (rev 3185)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-20 15:06:50 UTC (rev 3186)
@@ -359,7 +359,7 @@
# check for partial match for dictparameters
if not param:
if DictParameter.sep() in path:
- dict_key = key.split(DictParameter.sep(), 1)[0]
+ dict_key = path.split(DictParameter.sep(), 1)[0]
param = self.page_parameters_by_path.get(dict_key)
return param
15 years, 10 months
rhmessaging commits: r3185 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-20 11:01:50 -0400 (Fri, 20 Mar 2009)
New Revision: 3185
Added:
mgmt/trunk/wooly/python/wooly/demo.strings
Modified:
mgmt/trunk/wooly/python/wooly/demo.py
Log:
Explain links and toggles; add a brief intro
Modified: mgmt/trunk/wooly/python/wooly/demo.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/demo.py 2009-03-20 14:31:17 UTC (rev 3184)
+++ mgmt/trunk/wooly/python/wooly/demo.py 2009-03-20 15:01:50 UTC (rev 3185)
@@ -70,8 +70,8 @@
def __init__(self, app, name):
super(DemoPage, self).__init__(app, name)
- main = MainView(app, "main")
- self.add_child(main)
+ self.main_view = MainView(app, "main")
+ self.add_child(self.main_view)
class MainView(Widget):
def __init__(self, app, name):
@@ -80,8 +80,45 @@
tabs = TabbedModeSet(app, "tabs")
self.add_child(tabs)
- tabs.add_tab(ToggleDemo(app, "toggle"))
+ self.intro_tab = Introduction(app, "intro")
+ tabs.add_tab(self.intro_tab)
-class ToggleDemo(Widget):
+ self.link_tab = LinkDemo(app, "link")
+ tabs.add_tab(self.link_tab)
+
+class Introduction(Widget):
def render_title(self, session):
- return "Toggles"
+ return "Introduction"
+
+class LinkDemo(Widget):
+ def __init__(self, app, name):
+ super(LinkDemo, self).__init__(app, name)
+
+ self.visit_intro_link = self.VisitIntroLink(app, "visit_intro_link")
+ self.add_child(self.visit_intro_link)
+
+ self.secret_toggle = self.SecretToggle(app, "secret_toggle")
+ self.add_child(self.secret_toggle)
+
+ def render_title(self, session):
+ return "Links"
+
+ def render_secret(self, session):
+ if self.secret_toggle.get(session):
+ return "Above all things, I love persimmons."
+
+ class VisitIntroLink(Link):
+ def render_href(self, session):
+ branch = session.branch()
+ self.app.main_page.main_view.intro_tab.show(branch)
+ return branch.marshal()
+
+ def render_content(self, session):
+ return "See the Egress!"
+
+ class SecretToggle(Toggle):
+ def render_content(self, session):
+ if self.get(session):
+ return "Hide that secret"
+ else:
+ return "Show me a secret"
Added: mgmt/trunk/wooly/python/wooly/demo.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/demo.strings (rev 0)
+++ mgmt/trunk/wooly/python/wooly/demo.strings 2009-03-20 15:01:50 UTC (rev 3185)
@@ -0,0 +1,64 @@
+[DemoPage.css]
+.initial {
+ margin-top: 0;
+}
+
+div.instance {
+ background-color: #f0f0f0;
+ border: 1px dotted #e7e7e7;
+ padding: 1em 1.2em;
+}
+
+[MainView.html]
+<h1>Wooly Demo</h1>
+
+{tabs}
+
+[Introduction.html]
+<p class="initial">Hello. This is a little application to explain the
+features of the <strong>Wooly</strong> web user-interface toolkit.</p>
+
+<p>The code for this demo is available in the <tt>wooly.demo</tt>
+module.</p>
+
+[LinkDemo.css]
+div.secret {
+ display: inline;
+ float: right;
+ width: 66%;
+}
+
+[LinkDemo.html]
+<h2 class="initial">Basic Links</h2>
+
+<p>A <tt>Link</tt> renders an HTML link with a URL to an alternate
+page state. In Wooly, this is how transitions from one view or state
+to another are accomplished.</p>
+
+<p>A <tt>Link</tt> is really just a thin wrapper around the more
+fundamental ability in Wooly to take an existing <tt>Session</tt>
+object, with all its current state, and change just one part of it in
+order to produce a new, different URL and view.</p>
+
+<div class="instance">
+ <h3 class="initial">A link that changes the view to the intro tab</h3>
+
+ <p>{visit_intro_link}</p>
+</div>
+
+<h2>Toggles</h2>
+
+<p>A <tt>Toggle</tt> is a <tt>Link</tt> that remembers whether it is
+toggled or not. It's often useful to use that state to trigger other
+behaviors.</p>
+
+<p>Internally, <tt>Toggle</tt> holds a <tt>BooleanParameter</tt>
+called "toggled". Each time the <tt>Toggle</tt> is rendered, it
+generates a URL for its other possible state, toggled if it's
+currently untoggled and vice versa.</p>
+
+<div class="instance">
+ <h3 class="initial">A single toggle with a conditionally rendered message</h3>
+
+ <p><div class="secret">{secret}</div> {secret_toggle}</p>
+</div>
15 years, 10 months
rhmessaging commits: r3184 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-03-20 10:31:17 -0400 (Fri, 20 Mar 2009)
New Revision: 3184
Modified:
mgmt/trunk/wooly/python/wooly/forms.strings
Log:
Fix for bz 491218: webkit based browsers not logging in when enter is pressed.
The problem was that webkit browsers don't fire the onclick event for the submit button when Enter is pressed.
Modified: mgmt/trunk/wooly/python/wooly/forms.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.strings 2009-03-19 21:57:58 UTC (rev 3183)
+++ mgmt/trunk/wooly/python/wooly/forms.strings 2009-03-20 14:31:17 UTC (rev 3184)
@@ -26,8 +26,7 @@
}
[FormButton.html]
-<button class="{class}" type="{type}" tabindex="{tab_index}" {disabled_attr} onclick="return {onclick}('{name}', '{value}')">{content}</button>
-<input type="hidden" name="{name}" value="" />
+<button class="{class}" type="{type}" tabindex="{tab_index}" {disabled_attr} name="{name}" value="{value}" onclick="return {onclick}('{name}', '{value}')">{content}</button>
[ScalarInput.html]
<input type="text" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr} size="{size}"/>
15 years, 10 months
rhmessaging commits: r3183 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-19 17:57:58 -0400 (Thu, 19 Mar 2009)
New Revision: 3183
Modified:
mgmt/trunk/wooly/python/wooly/demo.py
Log:
Add some content to the wooly demo main view
Modified: mgmt/trunk/wooly/python/wooly/demo.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/demo.py 2009-03-19 19:35:18 UTC (rev 3182)
+++ mgmt/trunk/wooly/python/wooly/demo.py 2009-03-19 21:57:58 UTC (rev 3183)
@@ -6,7 +6,11 @@
from wooly import Application
from wooly.server import WebServer
from wooly.pages import HtmlPage
+from wooly.widgets import *
+from wooly.resources import StringCatalog
+strings = StringCatalog(__file__)
+
class DemoServer(WebServer):
def authorized(self, session):
return True
@@ -66,5 +70,18 @@
def __init__(self, app, name):
super(DemoPage, self).__init__(app, name)
- def render_content(self, session):
- return self.app.model.incrementing_counter
+ main = MainView(app, "main")
+ self.add_child(main)
+
+class MainView(Widget):
+ def __init__(self, app, name):
+ super(MainView, self).__init__(app, name)
+
+ tabs = TabbedModeSet(app, "tabs")
+ self.add_child(tabs)
+
+ tabs.add_tab(ToggleDemo(app, "toggle"))
+
+class ToggleDemo(Widget):
+ def render_title(self, session):
+ return "Toggles"
15 years, 10 months
rhmessaging commits: r3182 - in mgmt/trunk: etc and 4 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-19 15:35:18 -0400 (Thu, 19 Mar 2009)
New Revision: 3182
Added:
mgmt/trunk/wooly/bin/
mgmt/trunk/wooly/bin/wooly-demo
mgmt/trunk/wooly/python/wooly/demo.py
mgmt/trunk/wooly/wooly-demo-instance/
mgmt/trunk/wooly/wooly-demo-instance/resources
Modified:
mgmt/trunk/basil/python/basil/server.py
mgmt/trunk/etc/devel.profile
Log:
Add an at this point very simple demo app to wooly
Modified: mgmt/trunk/basil/python/basil/server.py
===================================================================
--- mgmt/trunk/basil/python/basil/server.py 2009-03-19 19:33:59 UTC (rev 3181)
+++ mgmt/trunk/basil/python/basil/server.py 2009-03-19 19:35:18 UTC (rev 3182)
@@ -1,7 +1,6 @@
from qmf.console import *
from wooly import Application
from wooly.server import WebServer
-from wooly.pages import CssPage, ResourcePage
from model import BasilModel
from page import BasilPage
Modified: mgmt/trunk/etc/devel.profile
===================================================================
--- mgmt/trunk/etc/devel.profile 2009-03-19 19:33:59 UTC (rev 3181)
+++ mgmt/trunk/etc/devel.profile 2009-03-19 19:35:18 UTC (rev 3182)
@@ -31,3 +31,4 @@
# cumin test instance
export CUMIN_HOME="${DEVEL_HOME}/cumin-test-0"
+export WOOLY_DEMO_HOME="${DEVEL_HOME}/wooly/wooly-demo-instance"
Added: mgmt/trunk/wooly/bin/wooly-demo
===================================================================
--- mgmt/trunk/wooly/bin/wooly-demo (rev 0)
+++ mgmt/trunk/wooly/bin/wooly-demo 2009-03-19 19:35:18 UTC (rev 3182)
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+
+import sys
+import os
+
+from wooly.demo import *
+
+def usage():
+ print "Usage: wooly-demo [HOST:PORT]"
+ print "Example: wooly-demo localhost:8888"
+ sys.exit(1)
+
+def do_main(host, port):
+ app = DemoApplication()
+ server = DemoServer(app, host, port)
+
+ print "Initializing"
+
+ app.init()
+ app.start()
+
+ try:
+ print "Starting web service at %s:%i" % (host, port)
+
+ try:
+ server.start()
+ finally:
+ server.stop()
+ finally:
+ app.stop()
+
+def main():
+ try:
+ addr = sys.argv[1]
+ except IndexError:
+ addr = "localhost:8888"
+
+ try:
+ host, port = addr.split(":")
+ port = int(port)
+ except:
+ print "Error: Malformed address"
+ usage()
+
+ try:
+ do_main(host, port)
+ except KeyboardInterrupt:
+ pass
+
+if __name__ == "__main__":
+ main()
Property changes on: mgmt/trunk/wooly/bin/wooly-demo
___________________________________________________________________
Name: svn:executable
+ *
Added: mgmt/trunk/wooly/python/wooly/demo.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/demo.py (rev 0)
+++ mgmt/trunk/wooly/python/wooly/demo.py 2009-03-19 19:35:18 UTC (rev 3182)
@@ -0,0 +1,70 @@
+import os
+
+from threading import Thread
+from time import sleep
+
+from wooly import Application
+from wooly.server import WebServer
+from wooly.pages import HtmlPage
+
+class DemoServer(WebServer):
+ def authorized(self, session):
+ return True
+
+class DemoApplication(Application):
+ def __init__(self):
+ super(DemoApplication, self).__init__()
+
+ self.model = DemoModel(self)
+
+ self.main_page = DemoPage(self, "index")
+ self.add_page(self.main_page)
+ self.set_default_page(self.main_page)
+
+ hdef = os.path.normpath("/usr/share/wooly")
+ self.home = os.environ.get("WOOLY_DEMO_HOME", hdef)
+
+ self.add_resource_dir(os.path.join(self.home, "resources"))
+
+ #self.enable_debug()
+
+ def start(self):
+ self.model.start()
+
+ def stop(self):
+ self.model.stop()
+
+class DemoModel(object):
+ def __init__(self, app):
+ super(DemoModel, self).__init__()
+
+ self.app = app
+ self.incrementing_counter = 0
+
+ self.update_thread = self.UpdateThread(self)
+
+ def start(self):
+ self.update_thread.start()
+
+ def stop(self):
+ pass
+
+ class UpdateThread(Thread):
+ def __init__(self, model):
+ super(DemoModel.UpdateThread, self).__init__()
+
+ self.model = model
+ self.setDaemon(True)
+
+ def run(self):
+ while True:
+ sleep(1)
+
+ self.model.incrementing_counter += 1
+
+class DemoPage(HtmlPage):
+ def __init__(self, app, name):
+ super(DemoPage, self).__init__(app, name)
+
+ def render_content(self, session):
+ return self.app.model.incrementing_counter
Added: mgmt/trunk/wooly/wooly-demo-instance/resources
===================================================================
--- mgmt/trunk/wooly/wooly-demo-instance/resources (rev 0)
+++ mgmt/trunk/wooly/wooly-demo-instance/resources 2009-03-19 19:35:18 UTC (rev 3182)
@@ -0,0 +1 @@
+link ../resources
\ No newline at end of file
Property changes on: mgmt/trunk/wooly/wooly-demo-instance/resources
___________________________________________________________________
Name: svn:special
+ *
15 years, 10 months
rhmessaging commits: r3181 - mgmt/trunk/wooly/resources.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-19 15:33:59 -0400 (Thu, 19 Mar 2009)
New Revision: 3181
Modified:
mgmt/trunk/wooly/resources/wooly.css
Log:
Restore some page margin
Modified: mgmt/trunk/wooly/resources/wooly.css
===================================================================
--- mgmt/trunk/wooly/resources/wooly.css 2009-03-19 18:23:52 UTC (rev 3180)
+++ mgmt/trunk/wooly/resources/wooly.css 2009-03-19 19:33:59 UTC (rev 3181)
@@ -1,5 +1,5 @@
body {
- margin: 0;
+ margin: 1em;
padding: 0;
background-color: #fff;
font-size: 0.9em;
15 years, 10 months
rhmessaging commits: r3180 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-19 14:23:52 -0400 (Thu, 19 Mar 2009)
New Revision: 3180
Modified:
mgmt/trunk/wooly/python/wooly/pages.py
Log:
Fix reference to widgets on page
Modified: mgmt/trunk/wooly/python/wooly/pages.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/pages.py 2009-03-19 18:21:52 UTC (rev 3179)
+++ mgmt/trunk/wooly/python/wooly/pages.py 2009-03-19 18:23:52 UTC (rev 3180)
@@ -164,7 +164,7 @@
return widget.path
def do_unmarshal(self, path):
- return self.page.widgets_by_path.get(path)
+ return self.page.page_widgets_by_path.get(path)
class CssPage(Page):
def __init__(self, app, name):
15 years, 10 months
rhmessaging commits: r3179 - in mgmt/trunk: cumin/python/cumin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-19 14:21:52 -0400 (Thu, 19 Mar 2009)
New Revision: 3179
Modified:
mgmt/trunk/basil/python/basil/server.py
mgmt/trunk/cumin/python/cumin/__init__.py
mgmt/trunk/cumin/python/cumin/broker.py
mgmt/trunk/cumin/python/cumin/brokerlink.py
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/wooly/python/wooly/__init__.py
mgmt/trunk/wooly/python/wooly/tables.py
Log:
Rename get_orderby_sql to get_order_by_sql.
Initialize app pages starting from an app-level init method; that's
more straightforward than doing it on page add as we were doing
before.
Modified: mgmt/trunk/basil/python/basil/server.py
===================================================================
--- mgmt/trunk/basil/python/basil/server.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/basil/python/basil/server.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -27,6 +27,8 @@
self.enable_debug()
def init(self):
+ super(BasilApplication, self).init()
+
self.model.init()
def start(self):
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -76,6 +76,8 @@
self.model.check()
def init(self):
+ super(Cumin, self).init()
+
self.model.init()
def start(self):
Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/broker.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -101,7 +101,7 @@
def render_title(self, session, data):
return "Groups"
- def get_orderby_sql(self, session):
+ def get_order_by_sql(self, session):
return None
def render_content(self, session, data):
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -75,7 +75,7 @@
name = "%s:%i" % (data["host"], data["port"])
return fmt_link(href, fmt_shorten(name))
- def get_orderby_sql(self, session):
+ def get_order_by_sql(self, session):
dir = self.parent.is_reversed(session) and "desc" or "asc"
return "order by host, port %s" % dir
@@ -170,7 +170,7 @@
def render_content(self, session, data):
return "%s:%i" % (data["host"], data["port"])
- def get_orderby_sql(self, session):
+ def get_order_by_sql(self, session):
dir = self.parent.is_reversed(session) and "desc" or "asc"
return "order by l.host, l.port %s" % dir
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -731,7 +731,7 @@
return "where %s" % " and ".join(constraints)
class NullSortColumn(SqlTableColumn):
- def get_orderby_sql(self, session):
+ def get_order_by_sql(self, session):
key = self.get_column_key(session)
if key:
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -423,6 +423,10 @@
def enable_debug(self):
self.debug = self.Debug(self)
+ def init(self):
+ for page in self.pages:
+ page.init()
+
class Debug(object):
def __init__(self, app):
self.app = app
@@ -440,9 +444,6 @@
self.pages.append(page)
self.pages_by_name[page.name] = page
- # XXX I don't think this should be triggered here
- page.init()
-
def set_default_page(self, page):
self.pages_by_name[""] = page
Modified: mgmt/trunk/wooly/python/wooly/tables.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/tables.py 2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/wooly/python/wooly/tables.py 2009-03-19 18:21:52 UTC (rev 3179)
@@ -129,7 +129,7 @@
return str(value)
# in case a non-sql column is included in an sqltable # XXX ugh
- def get_orderby_sql(self, session):
+ def get_order_by_sql(self, session):
pass
class ItemTableColumnHeader(Widget):
@@ -193,7 +193,7 @@
def render_sql_orderby(self, session, *args):
scol = self.get_selected_column(session)
if scol:
- return scol.get_orderby_sql(session)
+ return scol.get_order_by_sql(session)
def render_sql_limit(self, session, *args):
return None
@@ -312,10 +312,7 @@
return rows
class SqlTableColumn(ItemTableColumn):
- # XXX to be consistent with similar methods, rename to
- # get_sql_order_by
-
- def get_orderby_sql(self, session):
+ def get_order_by_sql(self, session):
key = self.get_column_key(session)
if key:
15 years, 10 months
rhmessaging commits: r3178 - mgmt/trunk/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-03-19 14:06:01 -0400 (Thu, 19 Mar 2009)
New Revision: 3178
Added:
mgmt/trunk/bin/recursive-string-replace
Log:
Add a convencience script for doing string replaces
Added: mgmt/trunk/bin/recursive-string-replace
===================================================================
--- mgmt/trunk/bin/recursive-string-replace (rev 0)
+++ mgmt/trunk/bin/recursive-string-replace 2009-03-19 18:06:01 UTC (rev 3178)
@@ -0,0 +1,8 @@
+#!/bin/bash -ex
+
+if [[ $# != 3 ]]; then
+ echo "Usage: recursive-string-replace GLOB MATCH-EXPR REPLACEMENT"
+ exit 1
+fi
+
+sed -i "s/$2/$3/g" $(find . -name $1)
Property changes on: mgmt/trunk/bin/recursive-string-replace
___________________________________________________________________
Name: svn:executable
+ *
15 years, 10 months