From 98d2d9833d04a88d2e1b1f6f92668190d8d36195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Wed, 7 Apr 2010 04:55:32 +0200 Subject: Javascript to generate TOCs --- helper.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'helper.py') diff --git a/helper.py b/helper.py index e0d6aad..ec7950b 100644 --- a/helper.py +++ b/helper.py @@ -7,3 +7,7 @@ def appdir (*args): def url (path): return "\"%s\"" % web.url(path) + +def toJS (ls): + ls = ("'%s':'%s'" % x for x in ls) + return "{ %s }" % ", ".join(ls) -- cgit v1.2.3