]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/python | |
2 | ||
3 | import sys | |
4 | import cgi | |
5 | import imputil | |
6 | ||
7 | from web import Page | |
8 | ||
9 | site = cgi.FieldStorage().getfirst("site") or "main" | |
10 | ||
11 | sys.path = [ "pages",] + sys.path | |
12 | for page in (site, "static"): | |
13 | try: | |
14 | found = imputil.imp.find_module(page) | |
15 | loaded = imputil.imp.load_module(page, found[0], found[1], found[2]) | |
16 | content = loaded.__dict__["Content"] | |
17 | sidebar = loaded.__dict__["Sidebar"] | |
18 | break | |
19 | except ImportError, e: | |
20 | pass | |
21 | ||
22 | c = content(site) | |
23 | s = sidebar(site) | |
24 | ||
25 | p = Page(site, c, s) | |
26 | p() |