rhmessaging commits: r3138 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2009-02-26 12:19:48 -0500 (Thu, 26 Feb 2009)
New Revision: 3138
Modified:
store/trunk/cpp/tests/persistence.py
Log:
Added tests for LVQ
Modified: store/trunk/cpp/tests/persistence.py
===================================================================
--- store/trunk/cpp/tests/persistence.py 2009-02-25 19:30:17 UTC (rev 3137)
+++ store/trunk/cpp/tests/persistence.py 2009-02-26 17:19:48 UTC (rev 3138)
@@ -64,6 +64,15 @@
message=self.createMessage(routing_key="a", correlation_id="Msg0001", body="A_Message1"))
session.message_transfer(destination="amq.direct",
message=self.createMessage(routing_key="b", correlation_id="Msg0002", body="B_Message1"))
+
+ session.queue_declare(queue="lvq-test", durable=True, arguments={"qpid.last_value_queue":True})
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"B"}, body="B1"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"A"}, body="A1"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"A"}, body="A2"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"B"}, body="B2"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"B"}, body="B3"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"C"}, body="C1"))
+
def phase2(self):
@@ -100,9 +109,51 @@
session.message_transfer(destination="amq.topic",
message=self.createMessage(routing_key="abc", correlation_id="Msg0003", body="AB_Message2"))
+ #check LVQ exists and has exepected messages:
+ session.queue_declare(queue="lvq-test", durable=True, passive=True)
+ session.message_subscribe(destination="lvq", queue="lvq-test")
+ lvq = session.incoming("lvq")
+ lvq.start()
+ accepted = RangedSet()
+ for m in ["A2", "B3", "C1"]:
+ msg = lvq.get(timeout=1)
+ self.assertEquals(m, msg.body)
+ accepted.add(msg.id)
+ try:
+ extra = lvq.get(timeout=1)
+ self.fail("lvq-test not empty, contains: " + extra.body)
+ except Empty: None
+ #publish some more messages while subscriber is active (no replacement):
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"C"}, body="C2"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"C"}, body="C3"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"A"}, body="A3"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"A"}, body="A4"))
+ session.message_transfer(message=self.createMessage(routing_key="lvq-test", application_headers={"qpid.LVQ_key":"C"}, body="C4"))
+ #check that accepting replaced messages is safe
+ session.message_accept(accepted)
+
def phase3(self):
session = self.session
+
+ #lvq recovery validation
+ session.queue_declare(queue="lvq-test", durable=True, passive=True)
+ session.message_subscribe(destination="lvq", queue="lvq-test")
+ lvq = session.incoming("lvq")
+ lvq.start()
+ accepted = RangedSet()
+ lvq.start()
+ for m in ["C4", "A4"]:
+ msg = lvq.get(timeout=1)
+ self.assertEquals(m, msg.body)
+ accepted.add(msg.id)
+ session.message_accept(accepted)
+ try:
+ extra = lvq.get(timeout=1)
+ self.fail("lvq-test not empty, contains: " + extra.body)
+ except Empty: None
+ session.queue_delete(queue="lvq-test")
+
#check queues exists
session.queue_declare(queue="queue-a", durable=True, passive=True)
15 years, 10 months
rhmessaging commits: r3137 - mgmt/trunk/mint/bin.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2009-02-25 14:30:17 -0500 (Wed, 25 Feb 2009)
New Revision: 3137
Modified:
mgmt/trunk/mint/bin/mint-vacuumdb
Log:
fix typo
Modified: mgmt/trunk/mint/bin/mint-vacuumdb
===================================================================
--- mgmt/trunk/mint/bin/mint-vacuumdb 2009-02-25 19:04:18 UTC (rev 3136)
+++ mgmt/trunk/mint/bin/mint-vacuumdb 2009-02-25 19:30:17 UTC (rev 3137)
@@ -3,7 +3,7 @@
TABLES="slot slot_stats job job_stats sysimage sysimage_stats"
function check_pid() {
- PID=`pidof postmasterr`
+ PID=`pidof postmaster`
if [[ $? == 1 ]]; then
echo "Postgresql is not running, can't perform vacuum"
exit
15 years, 10 months
rhmessaging commits: r3136 - mgmt/trunk/mint/bin.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2009-02-25 14:04:18 -0500 (Wed, 25 Feb 2009)
New Revision: 3136
Modified:
mgmt/trunk/mint/bin/mint-vacuumdb
Log:
check for a running postgresql before attempting to vacuum
Modified: mgmt/trunk/mint/bin/mint-vacuumdb
===================================================================
--- mgmt/trunk/mint/bin/mint-vacuumdb 2009-02-25 18:02:19 UTC (rev 3135)
+++ mgmt/trunk/mint/bin/mint-vacuumdb 2009-02-25 19:04:18 UTC (rev 3136)
@@ -2,14 +2,24 @@
TABLES="slot slot_stats job job_stats sysimage sysimage_stats"
-if [ "$1" == "full" ]; then
+function check_pid() {
+ PID=`pidof postmasterr`
+ if [[ $? == 1 ]]; then
+ echo "Postgresql is not running, can't perform vacuum"
+ exit
+ fi
+}
+
+if [ "$1" == "all" ]; then
+ check_pid
/usr/bin/vacuumdb --dbname=cumin --analyze --echo --verbose --host=localhost --username=cumin
elif [ "$1" == "tables" ]; then
+ check_pid
for t in $TABLES ; do
/usr/bin/vacuumdb --dbname=cumin --table="$t" --analyze --echo --verbose --host=localhost --username=cumin;
done
else
- echo "Usage: mint-vacuumdb [full | tables]"
- echo " full = performs a database-wide vacuum/analyze"
+ echo "Usage: mint-vacuumdb [all | tables]"
+ echo " all = performs a database-wide vacuum/analyze on all tables"
echo " tables = performs a vacuum/analyze on a few pre-selected tables"
fi
15 years, 10 months
rhmessaging commits: r3135 - in mgmt/trunk: wooly/python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-02-25 13:02:19 -0500 (Wed, 25 Feb 2009)
New Revision: 3135
Modified:
mgmt/trunk/cumin/python/cumin/broker.py
mgmt/trunk/cumin/python/cumin/broker.strings
mgmt/trunk/cumin/python/cumin/user.strings
mgmt/trunk/wooly/python/wooly/__init__.py
mgmt/trunk/wooly/python/wooly/forms.py
mgmt/trunk/wooly/python/wooly/forms.strings
mgmt/trunk/wooly/python/wooly/server.py
Log:
Change the way <button>s are handled to work-around IE problem.
Save and inspect the HTTP_USER_AGENT for determining correct content_type to send to IE 6.
Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/cumin/python/cumin/broker.py 2009-02-25 18:02:19 UTC (rev 3135)
@@ -600,20 +600,13 @@
self.field_tmpl = Template(self, "field_html")
self.group_tmpl = Template(self, "group_html")
- self.more_button = self.MoreEntries(app, "more_button")
- self.add_child(self.more_button)
+ self.more = self.MoreEntries(app, "more")
+ self.add_child(self.more)
- self.more = self.More(app, "more")
- self.add_parameter(self.more)
-
class Errors(Attribute):
def get_default(self, session):
return dict()
- class More(Parameter):
- def get_default(self, session):
- return ""
-
def process_display(self, session):
if self.more.get(session):
self.fields.set(session, self.fields.get(session) + 3)
@@ -677,12 +670,6 @@
if groups[index] and group.id == groups[index].id:
return "selected=\"selected\""
- def render_more_id(self, session):
- return self.more_button.path
-
- def render_more_name(self, session):
- return self.more.path
-
class MoreEntries(FormButton):
def render_content(self, session):
return "More Entries"
@@ -691,7 +678,15 @@
return "more"
def render_type(self, session):
+ """ using type="button" so pressing
+ Enter on the form will not add more fields """
return "button"
+
+ def render_onclick(self, session):
+ """ since this isn't a type="submit" button,
+ we need javascript to submit the form when
+ the button is clicked """
+ return "click_more"
class BrokerSetAdd(BrokerSetForm):
def process_cancel(self, session):
@@ -761,7 +756,7 @@
if count:
errs = aerrs.setdefault(i, list())
- errs.append("The broker at %s " % (url) +
+ errs.append("The broker at %s " % (addr) +
"is already registered")
return not len(nerrs) and not len(aerrs)
Modified: mgmt/trunk/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.strings 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/cumin/python/cumin/broker.strings 2009-02-25 18:02:19 UTC (rev 3135)
@@ -242,7 +242,7 @@
{fields}
</table>
- {more_button}<input type="hidden" name="{more_name}" value="" />
+ {more}
</fieldset>
{hidden_inputs}
@@ -254,18 +254,16 @@
</div>
</form>
<script type="text/javascript" defer="defer">
-function attach_more_id() {
- var oMore = document.getElementById("{more_id}");
- if (oMore) {
- oMore.onclick = function() { document.forms[0].elements["{more_name}"].value = "t"; document.forms[0].submit(); return True;}
- }
+function click_more(id, value) {
+ click_button(id, value);
+ document.forms[0].submit();
+ return true;
}
(function() {
var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
-addEvent(window, "load", attach_more_id);
</script>
Modified: mgmt/trunk/cumin/python/cumin/user.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/user.strings 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/cumin/python/cumin/user.strings 2009-02-25 18:02:19 UTC (rev 3135)
@@ -44,6 +44,10 @@
width: 12em;
}
+form.LoginForm input.submit {
+ width: auto;
+}
+
form.LoginForm > div.buttons {
margin: 1.5em 0 0 0;
}
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-02-25 18:02:19 UTC (rev 3135)
@@ -299,6 +299,7 @@
class Page(Frame):
xml_content_type = "text/xml"
html_content_type = "text/html"
+ xhtml_content_type = "application/xhtml+xml"
xml_1_0_declaration = """<?xml version="1.0"?>"""
xhtml_1_1_doctype = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">"""
xhtml_namespace = "http://www.w3.org/1999/xhtml"
@@ -315,6 +316,9 @@
self.__saved_params = dict()
+ self.agent = Attribute(app, "agent")
+ self.add_attribute(self.agent)
+
def init(self):
assert not self.sealed
assert self.parent is None
@@ -332,10 +336,11 @@
return datetime.utcnow()
def get_content_type(self, session):
- if self.name.endswith(".html"):
- return "application/xhtml+xml"
+ agent = self.agent.get(session)
+ if self.name.endswith(".html") and (agent.find("MSIE 6") == -1):
+ return self.xhtml_content_type
else:
- return "text/html"
+ return self.html_content_type
def get_cache_control(self, session):
return None
@@ -370,6 +375,9 @@
#print "Popping current frame", frame
self.set_current_frame(session, frame.frame)
+ def set_agent(self, session, agent):
+ self.agent.set(session, agent)
+
def set_default_frame(self, frame):
self.current_frame.default = frame
Modified: mgmt/trunk/wooly/python/wooly/forms.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.py 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/wooly/python/wooly/forms.py 2009-02-25 18:02:19 UTC (rev 3135)
@@ -255,6 +255,9 @@
def render_type(self, session, *args):
return "submit"
+ def render_onclick(self, session, *args):
+ return "click_button"
+
class CheckboxInputSet(FormInput, ItemSet):
def render_item_value(self, session, *args):
return None
Modified: mgmt/trunk/wooly/python/wooly/forms.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.strings 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/wooly/python/wooly/forms.strings 2009-02-25 18:02:19 UTC (rev 3135)
@@ -10,8 +10,19 @@
[FormErrorSet.item_html]
<li>{item_content}</li>
+[FormButton.javascript]
+// needed because IE will send the content instead of the value for form buttons
+function click_button(id, value) {
+ var oHidden = document.getElementById(id);
+ if (oHidden) {
+ oHidden.value = value;
+ }
+ return true;
+}
+
[FormButton.html]
-<button class="{class}" id="{id}" type="{type}" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr}>{content}</button>
+<button class="{class}" type="{type}" tabindex="{tab_index}" {disabled_attr} onclick="return {onclick}('{id}', '{value}')">{content}</button>
+<input type="hidden" id="{id}" name="{name}" value="" />
[ScalarInput.html]
<input type="text" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr} size="{size}"/>
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-02-25 14:31:59 UTC (rev 3134)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-02-25 18:02:19 UTC (rev 3135)
@@ -48,13 +48,16 @@
session = Session(page, headers)
session.unmarshal_url_vars(env["QUERY_STRING"])
+ if "HTTP_USER_AGENT" in env:
+ page.set_agent(session, env["HTTP_USER_AGENT"])
+
if env["REQUEST_METHOD"] == "POST":
if env["CONTENT_TYPE"] == "application/x-www-form-urlencoded":
length = int(env["CONTENT_LENGTH"])
vars = env["wsgi.input"].read(length)
else:
raise Exception("Content type '%s' is not supported" \
- % content_type)
+ % env["CONTENT_TYPE"])
if vars:
session.unmarshal_url_vars(vars, "&")
15 years, 10 months
rhmessaging commits: r3134 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-02-25 09:31:59 -0500 (Wed, 25 Feb 2009)
New Revision: 3134
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Fix for BZ Bug 474366 #11 - "qpidd+store jcntl::check_owi() threw JERR_JCNTL_OWIMISMATCH on journal recovery". This bug was caused by a failure to check journal alignment when the last record read is incomplete and lies in the last logical file.
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-02-24 22:52:33 UTC (rev 3133)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-02-25 14:31:59 UTC (rev 3134)
@@ -853,7 +853,10 @@
return false;
}
if (!done && !jfile_cycle(fid, ifsp, lowi, rd, false))
+ {
+ check_journal_alignment(start_fid, start_file_offs, rd);
return false;
+ }
}
return true;
}
15 years, 10 months
rhmessaging commits: r3133 - mgmt/trunk/mint/etc.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2009-02-24 17:52:33 -0500 (Tue, 24 Feb 2009)
New Revision: 3133
Added:
mgmt/trunk/mint/etc/mint-vacuumdb.cron
Removed:
mgmt/trunk/mint/etc/mint-vacuum.cron
Log:
renamed file for consistency
Deleted: mgmt/trunk/mint/etc/mint-vacuum.cron
===================================================================
--- mgmt/trunk/mint/etc/mint-vacuum.cron 2009-02-24 22:42:29 UTC (rev 3132)
+++ mgmt/trunk/mint/etc/mint-vacuum.cron 2009-02-24 22:52:33 UTC (rev 3133)
@@ -1,4 +0,0 @@
-# run database-wide vacuum nightly
-0 2 * * * /usr/bin/mint-vacuumdb full >> /var/log/cumin/mint-vacuum.log 2>&1
-# run table-specific vacuum every 10 minutes
-*/10 * * * * /usr/bin/mint-vacuumdb tables >> /var/log/cumin/mint-vacuum.log 2>&1
Copied: mgmt/trunk/mint/etc/mint-vacuumdb.cron (from rev 3131, mgmt/trunk/mint/etc/mint-vacuum.cron)
===================================================================
--- mgmt/trunk/mint/etc/mint-vacuumdb.cron (rev 0)
+++ mgmt/trunk/mint/etc/mint-vacuumdb.cron 2009-02-24 22:52:33 UTC (rev 3133)
@@ -0,0 +1,4 @@
+# run database-wide vacuum nightly
+0 2 * * * /usr/bin/mint-vacuumdb full >> /var/log/cumin/mint-vacuum.log 2>&1
+# run table-specific vacuum every 10 minutes
+*/10 * * * * /usr/bin/mint-vacuumdb tables >> /var/log/cumin/mint-vacuum.log 2>&1
Property changes on: mgmt/trunk/mint/etc/mint-vacuumdb.cron
___________________________________________________________________
Name: svn:mergeinfo
+
15 years, 10 months
rhmessaging commits: r3132 - mgmt/trunk/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2009-02-24 17:42:29 -0500 (Tue, 24 Feb 2009)
New Revision: 3132
Modified:
mgmt/trunk/mint/Makefile
Log:
install cronjob
Modified: mgmt/trunk/mint/Makefile
===================================================================
--- mgmt/trunk/mint/Makefile 2009-02-24 22:29:46 UTC (rev 3131)
+++ mgmt/trunk/mint/Makefile 2009-02-24 22:42:29 UTC (rev 3132)
@@ -5,6 +5,7 @@
name := mint
lib := ${PYTHON_LIB_DIR}/${name}
+etc := ${ETC_DIR}/${name}
doc := ${DOC_DIR}/${name}
share := ${SHARE_DIR}/${name}
@@ -20,6 +21,8 @@
install LICENSE COPYING ${doc}
install -d ${share}/sql
install sql/* ${share}/sql
+ install -d ${etc}
+ install -pm 0644 etc/* ${etc}
schema:
$(MAKE) schema -C xml
15 years, 10 months
rhmessaging commits: r3131 - in mgmt/trunk/mint: bin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2009-02-24 17:29:46 -0500 (Tue, 24 Feb 2009)
New Revision: 3131
Added:
mgmt/trunk/mint/bin/mint-vacuumdb
mgmt/trunk/mint/etc/
mgmt/trunk/mint/etc/mint-vacuum.cron
Log:
add scripts for crontab-managed postgresql vacuuming
Added: mgmt/trunk/mint/bin/mint-vacuumdb
===================================================================
--- mgmt/trunk/mint/bin/mint-vacuumdb (rev 0)
+++ mgmt/trunk/mint/bin/mint-vacuumdb 2009-02-24 22:29:46 UTC (rev 3131)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+TABLES="slot slot_stats job job_stats sysimage sysimage_stats"
+
+if [ "$1" == "full" ]; then
+ /usr/bin/vacuumdb --dbname=cumin --analyze --echo --verbose --host=localhost --username=cumin
+elif [ "$1" == "tables" ]; then
+ for t in $TABLES ; do
+ /usr/bin/vacuumdb --dbname=cumin --table="$t" --analyze --echo --verbose --host=localhost --username=cumin;
+ done
+else
+ echo "Usage: mint-vacuumdb [full | tables]"
+ echo " full = performs a database-wide vacuum/analyze"
+ echo " tables = performs a vacuum/analyze on a few pre-selected tables"
+fi
Property changes on: mgmt/trunk/mint/bin/mint-vacuumdb
___________________________________________________________________
Name: svn:executable
+ *
Added: mgmt/trunk/mint/etc/mint-vacuum.cron
===================================================================
--- mgmt/trunk/mint/etc/mint-vacuum.cron (rev 0)
+++ mgmt/trunk/mint/etc/mint-vacuum.cron 2009-02-24 22:29:46 UTC (rev 3131)
@@ -0,0 +1,4 @@
+# run database-wide vacuum nightly
+0 2 * * * /usr/bin/mint-vacuumdb full >> /var/log/cumin/mint-vacuum.log 2>&1
+# run table-specific vacuum every 10 minutes
+*/10 * * * * /usr/bin/mint-vacuumdb tables >> /var/log/cumin/mint-vacuum.log 2>&1
15 years, 10 months
rhmessaging commits: r3130 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-02-24 14:29:47 -0500 (Tue, 24 Feb 2009)
New Revision: 3130
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Fixed BZ 485952. The submit/cancel buttons now do a manual redirect instead of relying on frame.origin.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2009-02-23 22:53:27 UTC (rev 3129)
+++ mgmt/trunk/cumin/python/cumin/job.py 2009-02-24 19:29:47 UTC (rev 3130)
@@ -796,7 +796,14 @@
else:
item_group = "Other"
return item_group == group
-
+
+ def process_cancel(self, session, job):
+ branch = session.branch()
+ self.ads.set(branch, None) # otherwise url is too long
+ self.page.pop_current_frame(branch)
+ self.page.get_current_frame(branch).show_view(branch)
+ self.page.set_redirect_url(session, branch.marshal())
+
def process_submit(self, session, job):
ads = self.ads.get(session)
errors = False
15 years, 10 months
rhmessaging commits: r3129 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-02-23 17:53:27 -0500 (Mon, 23 Feb 2009)
New Revision: 3129
Modified:
mgmt/trunk/cumin/python/cumin/__init__.py
mgmt/trunk/cumin/python/cumin/user.py
mgmt/trunk/cumin/python/cumin/user.strings
Log:
Add an operator-email config parameter and use it in the login text
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2009-02-23 20:03:59 UTC (rev 3128)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2009-02-23 22:53:27 UTC (rev 3129)
@@ -166,6 +166,8 @@
param = ConfigParameter(self, "expire-threshold", int)
param.default = 24 * 3600 # 1 day
+ param = ConfigParameter(self, "operator-email", str)
+
def init(self):
super(CuminConfig, self).init()
Modified: mgmt/trunk/cumin/python/cumin/user.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/user.py 2009-02-23 20:03:59 UTC (rev 3128)
+++ mgmt/trunk/cumin/python/cumin/user.py 2009-02-23 22:53:27 UTC (rev 3129)
@@ -125,6 +125,14 @@
else:
self.__login_invalid.set(session, True)
+ def render_operator_link(self, session):
+ email = self.app.config.operator_email
+
+ if email:
+ return "<a href=\"mailto:%s\">site operator</a>" % email
+ else:
+ return "site operator"
+
def render_login_invalid(self, session):
if self.__login_invalid.get(session):
return self.get_string("login_invalid")
Modified: mgmt/trunk/cumin/python/cumin/user.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/user.strings 2009-02-23 20:03:59 UTC (rev 3128)
+++ mgmt/trunk/cumin/python/cumin/user.strings 2009-02-23 22:53:27 UTC (rev 3129)
@@ -59,7 +59,7 @@
<p>Enter your user name and password to log in.</p>
<p>If you do not have an account or have trouble logging in, contact
- the <a href="{operator_email}">site operator</a>.</p>
+ the {operator_link}.</p>
{login_invalid}
15 years, 10 months