]>
jfr.im git - irc/quakenet/qwebirc.git/blob - pagegen.py
3 IRC_BASE
= ["ircconnection", "irclib", "numerics", "baseircclient", "irctracker", "commandparser", "ircclient", "commandhistory"]
4 UI_BASE
= ["baseui", "baseuiwindow", "colour", "url", "theme", "genericlogin", "embedwizard", "hilightcontroller", "menuitems", "tabcompleter"]
6 DEBUG_BASE
= ["qwebirc", "version", "jslib", ["irc/%s" % x
for x
in IRC_BASE
], ["ui/%s" % x
for x
in UI_BASE
], "qwebircinterface"]
7 BUILD_BASE
= ["qwebirc"]
8 JS_BASE
= ["mootools-1.2.1-core"]
14 "extra": ["mootools-1.2-sortables"],
15 "buildextra": ["mootools-1.2-sortables"],
16 "doctype": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" + "\n" \
17 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
21 "uifiles": ["mochaui"],
22 "extra": ["mootools-1.2-more", "mochaui/mocha"],
23 "buildextra": ["mootools-1.2-more", "mochaui/mocha-compressed"],
24 "doctype": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">",
27 <div id="dockWrapper">
29 <div id="dockPlacement"></div>
30 <div id="dockAutoHide"></div>
31 <div id="dockSort"><div id="dockClear" class="clear"></div></div>
34 <div id="pageWrapper"></div>
36 "extracss": ["mochaui/ui", "mochaui/content"],
39 <script type="text/javascript" src="js/mochaui/excanvas-compressed.js"></script>
44 "uifiles": ["swmui", "swmuilayout"],
45 "doctype": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
49 "uifiles": ["uglyui"],
50 "doctype": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
56 if isinstance(x
, list):
62 DEBUG
= ["debug/%s" % x
for x
in flatten(DEBUG_BASE
)]
64 def jslist(name
, debug
):
67 x
= [JS_BASE
, ui
.get("extra", []), DEBUG
, ["debug/ui/%s" % y
for y
in ui
["uifiles"]]]
69 x
= [JS_BASE
, ui
.get("buildextra", ui
.get("extra", [])), BUILD_BASE
, name
]
71 return list("js/%s.js" % y
for y
in flatten(x
))
75 return list("css/%s.css" % x
for x
in flatten(["colours", ui
.get("extracss", []), "%s" % name
]))
77 def producehtml(name
, debug
):
79 js
= jslist(name
, debug
)
82 csshtml
= "\n".join(" <link rel=\"stylesheet\" href=\"%s\" type=\"text/css\"/>" % x
for x
in css
)
83 jshtml
= "\n".join(" <script type=\"text/javascript\" src=\"%s\"></script>" % x
for x
in js
)
85 div
= ui
.get("div", "")
86 customjs
= ui
.get("customjs", "")
89 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
91 <title>QuakeNet Web IRC</title>
92 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
93 <link rel="icon" type="image/png" href="images/favicon.png"/>
96 <script type="text/javascript">
97 var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.%s);
103 <div id="noscript">Javascript is required to use IRC.</div>
108 """ % (ui
["doctype"], csshtml
, customjs
, jshtml
, ui
["class"], div
)
111 p
= os
.path
.join(os
.path
.abspath(os
.path
.split(sys
.argv
[0])[0]), "static")
113 f
= open(os
.path
.join(p
, "%sdebug.html" % x
), "wb")
115 f
.write(producehtml(x
, debug
=True))
119 f
= open(os
.path
.join(p
, "%s.html" % x
), "wb")
121 f
.write(producehtml(x
, debug
=False))
125 if __name__
== "__main__":