From f6bddba1c55448fae6674bb03838fceb4bd982ba Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Sun, 9 Aug 2009 18:45:28 -0400 Subject: [PATCH 1/1] Move the help popup code into the templates where it belongs svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2672 --- code/main.py | 11 ----------- code/templates/functions.mako | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/code/main.py b/code/main.py index 17bbd62..ab0d1cd 100755 --- a/code/main.py +++ b/code/main.py @@ -93,16 +93,6 @@ class Checkpoint: checkpoint = Checkpoint() -def jquote(string): - return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'" - -def helppopup(subj): - """Return HTML code for a (?) link to a specified help topic""" - return ('(?)') - def makeErrorPre(old, addition): if addition is None: return @@ -113,7 +103,6 @@ def makeErrorPre(old, addition): Template.database = database Template.config = config -Template.helppopup = staticmethod(helppopup) Template.err = None class JsonDict: diff --git a/code/templates/functions.mako b/code/templates/functions.mako index 99c0d30..a72648a 100644 --- a/code/templates/functions.mako +++ b/code/templates/functions.mako @@ -39,3 +39,13 @@ ${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description) % endif + +<%! +def jquote(string): + return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'" +%> + +<%def name="helppopup(subj)"> +## Return HTML code for a (?) link to a specified help topic +(?) + -- 1.7.9.5