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

« back to all changes in this revision

Viewing changes to www/conf/apps.py

  • Committer: mattgiuca
  • Date: 2008-01-29 23:52:19 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:329
Converted Console from an "app" into a "plugin". It can now be plugged in to
any app.
Added "plugins" directory in www. Added "console" plugin. This contains all of
the functionality of what was previously the console app, but modularized so
it can be imported by another app.

apps/console: Removed most of the logic (moved to plugins/console). Replaced
with a simple import of the console plugin. Should behave exactly the same.
apps/tutorial: As proof of concept, imported the console plugin. It now
appears at the bottom of the page (yet to make it have "pop up" behaviour).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# These should not need to be modified by admins unless new applications are
5
5
# plugged in.
6
6
 
 
7
enable_debuginfo = False
 
8
 
7
9
# Allow App objects
 
10
# Note: icon is a string of a file basename. The icon files are found in
 
11
# app_icon_dir, defined below.
8
12
class App:
9
 
    def __init__(self, dir, name, requireauth = True, hashelp = False):
 
13
    def __init__(self, dir, name, icon = None, requireauth = True,
 
14
        hashelp = False):
10
15
        self.dir = dir
11
16
        self.name = name
 
17
        self.icon = icon
12
18
        self.requireauth = requireauth
13
19
        self.hashelp = hashelp
14
20
    def __repr__(self):
15
21
        return ("App(dir=" + repr(self.dir) + ", name=" + repr(self.name) +
 
22
            ", icon=" + repr(self.icon) +
16
23
            ", requireauth=" + repr(self.requireauth) + ", hashelp="
17
24
            + repr(self.hashelp) + ")")
18
25
 
 
26
# Directory where app icons are stored, relative to the IVLE root.
 
27
app_icon_dir = "media/images/apps"
 
28
# Small version of icons (16x16, for favicon)
 
29
app_icon_dir_small = "media/images/apps/small"
 
30
 
 
31
# Which application to load by default (if the user navigates to the top level
 
32
# of the site). This is the app's URL name.
 
33
# Note that if this app requires authentication, the user will first be
 
34
# presented with the login screen.
 
35
default_app = "files"
 
36
# Which application to use for "public host" URLs.
 
37
# (See conf.py)
 
38
public_app = "serve"
 
39
 
19
40
# Application definitions
20
41
 
21
 
app_dummy =     App(dir = "dummy",
22
 
                    name = "My Dummy App",
23
 
                    requireauth = True,
24
 
                    hashelp = True)
25
 
 
26
42
app_browser =   App(dir = "browser",
27
43
                    name = "File Browser",
 
44
                    icon = "browser.png",
 
45
                    requireauth = True,
 
46
                    hashelp = True)
 
47
 
 
48
app_editor =   App(dir = "editor",
 
49
                    name = "Text Editor",
 
50
                    icon = "editor.png",
28
51
                    requireauth = True,
29
52
                    hashelp = True)
30
53
 
33
56
                    requireauth = True,
34
57
                    hashelp = False)
35
58
 
 
59
app_console =     App(dir = "console",
 
60
                    name = "Console",
 
61
                    icon = "console.png",
 
62
                    requireauth = True,
 
63
                    hashelp = True)
 
64
 
 
65
app_consoleservice = App(dir = "consoleservice",
 
66
                    name = "Console Service",
 
67
                    requireauth = True,
 
68
                    hashelp = False)
 
69
 
 
70
app_tutorial =     App(dir = "tutorial",
 
71
                    name = "Tutorial",
 
72
                    icon = "tutorial.png",
 
73
                    requireauth = True,
 
74
                    hashelp = True)
 
75
 
 
76
app_tutorialservice = App(dir = "tutorialservice",
 
77
                    name = "Tutorial Service",
 
78
                    requireauth = True,
 
79
                    hashelp = False)
 
80
 
36
81
app_server =    App(dir = "server",
37
82
                    name = "Server",
38
 
                    requireauth = False,
 
83
                    requireauth = True,
39
84
                    hashelp = False)
40
85
 
41
86
app_download =  App(dir = "download",
45
90
 
46
91
app_help =      App(dir = "help",
47
92
                    name = "Help",
 
93
                    icon = "help.png",
48
94
                    requireauth = True,
49
95
                    hashelp = False)
50
96
 
56
102
# Mapping URL names to apps
57
103
 
58
104
app_url = {
59
 
    "dummy" : app_dummy,
60
105
    "files" : app_browser,
 
106
    "edit" : app_editor,
61
107
    "fileservice" : app_fileservice,
 
108
    "console" : app_console,
 
109
    "consoleservice" : app_consoleservice,
 
110
    "tutorial" : app_tutorial,
 
111
    "tutorialservice" : app_tutorialservice,
62
112
    "serve" : app_server,
63
113
    "download" : app_download,
64
114
    "help" : app_help,
65
 
    #"debuginfo" : app_debuginfo,
66
115
}
 
116
if enable_debuginfo:
 
117
    app_url["debuginfo"] = app_debuginfo
67
118
 
68
119
# List of apps that go in the tabs at the top
69
120
# (The others are hidden unless they are linked to)
70
121
# Note: The values in this list are the URL names as seen in app_url.
71
122
 
72
 
apps_in_tabs = ["dummy", "files", "help"]
 
123
apps_in_tabs = ["files", "edit", "console", "tutorial", "help"]