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

« back to all changes in this revision

Viewing changes to www/dispatch/html.py

  • Committer: dcoles
  • Date: 2008-07-14 01:08:59 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:850
Console: Moved console up into dispatch. Now any application can, in theory, 
have it's own console just by adding 'useconsole = True' to the app settings.
Note: There are some cases where this may not be a good idea - ie. The full 
console app, public applications, etc. Removed the old single instances of 
console and made apps init functions use the new scripts_init section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import conf
31
31
import conf.apps
32
32
from common import util
 
33
import plugins.console
33
34
 
34
35
def write_html_head(req):
35
36
    """Writes the HTML header, given a request object.
37
38
    req: An IVLE request object. Reads attributes such as title. Also used to
38
39
    write to."""
39
40
 
 
41
    # Let the console plugin insert its own styles and scripts if an app
 
42
    # requests it
 
43
    if req.app is not None and conf.apps.app_url[req.app].useconsole:
 
44
        plugins.console.insert_scripts_styles(req.scripts, req.styles, \
 
45
            req.scripts_init)
 
46
 
40
47
    # Write the XHTML opening and head element
41
48
    # Note the inline JavaScript, which provides the client with constants
42
49
    # derived from the server configuration.
131
138
 
132
139
    req: An IVLE request object. Written to.
133
140
    """
 
141
    
 
142
    # Write the console html if the app requests it
 
143
    if req.app is not None and conf.apps.app_url[req.app].useconsole:
 
144
        plugins.console.present(req, windowpane=True)
 
145
 
134
146
    req.write("</div>\n</body>\n</html>\n")
135
147
 
136
148
def get_help_url(req):