]>
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"]
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-core"]
14 "doctype": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" + "\n" \
15 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
19 "uifiles": ["mochaui"],
20 "extra": ["mootools-1.2-more", "mochaui/mocha"],
21 "buildextra": ["mootools-1.2-more", "mochaui/mocha-compressed"],
22 "doctype": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">",
25 <div id="dockWrapper">
27 <div id="dockPlacement"></div>
28 <div id="dockAutoHide"></div>
29 <div id="dockSort"><div id="dockClear" class="clear"></div></div>
32 <div id="pageWrapper"></div>
34 "extracss": ["mochaui/ui", "mochaui/content"],
37 <script type="text/javascript" src="js/mochaui/excanvas-compressed.js"></script>
42 "uifiles": ["swmui", "swmuilayout"],
43 "doctype": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
47 "uifiles": ["uglyui"],
48 "doctype": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
54 if isinstance(x
, list):
60 DEBUG
= ["debug/%s" % x
for x
in flatten(DEBUG_BASE
)]
62 def jslist(name
, debug
):
65 x
= [JS_BASE
, ui
.get("extra", []), DEBUG
, ["debug/ui/%s" % y
for y
in ui
["uifiles"]]]
67 x
= [JS_BASE
, ui
.get("buildextra", ui
.get("extra", [])), BUILD_BASE
, name
]
69 return list("js/%s.js" % y
for y
in flatten(x
))
73 return list("css/%s.css" % x
for x
in flatten(["colours", ui
.get("extracss", []), "%s" % name
]))
75 def producehtml(name
, debug
):
77 js
= jslist(name
, debug
)
80 csshtml
= "\n".join(" <link rel=\"stylesheet\" href=\"%s\" type=\"text/css\"/>" % x
for x
in css
)
81 jshtml
= "\n".join(" <script type=\"text/javascript\" src=\"%s\"></script>" % x
for x
in js
)
83 div
= ui
.get("div", "")
84 customjs
= ui
.get("customjs", "")
87 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
89 <title>QuakeNet Web IRC</title>
90 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
91 <link rel="icon" type="image/png" href="images/favicon.png"/>
94 <script type="text/javascript">
95 var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.%s);
103 """ % (ui
["doctype"], csshtml
, customjs
, jshtml
, ui
["class"], div
)
106 p
= os
.path
.join(os
.path
.abspath(os
.path
.split(sys
.argv
[0])[0]), "static")
108 f
= open(os
.path
.join(p
, "%sdebug.html" % x
), "wb")
110 f
.write(producehtml(x
, debug
=True))
114 f
= open(os
.path
.join(p
, "%s.html" % x
), "wb")
116 f
.write(producehtml(x
, debug
=False))
120 if __name__
== "__main__":