33
33
"""Handler for the Help application."""
34
34
(appurl, subpath) = util.split_path(req.path)
35
# app must be valid and have help available
36
if appurl not in conf.apps.app_url:
37
req.throw_error(req.HTTP_NOT_FOUND)
38
app = conf.apps.app_url[appurl]
40
req.throw_error(req.HTTP_NOT_FOUND)
41
# subpath must be empty, for now, as there is only one help file per app
43
req.throw_error(req.HTTP_NOT_FOUND)
39
# app must be valid and have help available
40
if appurl not in conf.apps.app_url:
41
req.throw_error(req.HTTP_NOT_FOUND)
42
app = conf.apps.app_url[appurl]
44
req.throw_error(req.HTTP_NOT_FOUND)
45
# subpath must be empty, for now, as there is only one help file per app
47
req.throw_error(req.HTTP_NOT_FOUND)
48
show_help_app(req, app)
50
def show_help_menu(req):
51
"""Show the help menu."""
53
# Set request attributes
54
req.content_type = "text/html"
55
req.write_html_head_foot = True
58
req.write("<h1>Help</h1>\n")
60
# Write a list of links to all apps with help modules
62
for (appurl, app) in conf.apps.app_url.items():
64
req.write(' <li><a href="%s">%s</a></li>\n'
65
% (os.path.join(util.make_path("help"), appurl), app.name))
68
def show_help_app(req, app):
69
"""Show help for an application."""
44
70
helpfile = os.path.join(util.make_local_path("apps"), app.dir, "help.html")
46
72
# Set request attributes