~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to src/dispatch/html.py

  • Committer: mattgiuca
  • Date: 2007-12-13 23:41:26 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:53
dispatch/html.py: Refactor string writing code to use '%' operator.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    write to."""
35
35
 
36
36
    # Write the XHTML opening and head element
 
37
    if req.title != None:
 
38
        titlepart = ' - ' + req.title
 
39
    else:
 
40
        titlepart = ''
37
41
    req.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
38
42
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
39
43
<html xmlns="http://www.w3.org/1999/xhtml">
40
44
<head>
41
 
  <title>IVLE""")
42
 
    if req.title != None:
43
 
        req.write(' - ' + req.title)
44
 
    req.write("""</title>
 
45
  <title>IVLE%s</title>
45
46
  <meta http-equiv="Content-Type"
46
 
    content=""" + '"' + req.content_type + """; charset=utf-8" />
 
47
    content="%s"; charset=utf-8" />
47
48
</head>
48
49
 
49
 
""")
 
50
""" % (titlepart, req.content_type))
50
51
 
51
52
    # Open the body element and write a bunch of stuff there (the header)
52
53
    req.write("""<body>
72
73
 
73
74
    for urlname in conf.apps.apps_in_tabs:
74
75
        app = conf.apps.app_url[urlname]
75
 
        file.write('  <li><a href="')
76
 
        file.write(util.make_path(app.dir))
77
 
        file.write('">')
78
 
        file.write(app.name)
79
 
        file.write('</a></li>\n')
 
76
        file.write('  <li><a href="%s">%s</a></li>\n'
 
77
            % (util.make_path(app.dir), app.name))
80
78
 
81
79
    file.write('</ul>\n')