X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/fbe5af7709ff70c49b70817793fc39664ddca96b..fb28e394a2670944ee36f7c386cbc884d9207daa:/bin/pagegen.py
diff --git a/bin/pagegen.py b/bin/pagegen.py
index 862082e..7423a2b 100755
--- a/bin/pagegen.py
+++ b/bin/pagegen.py
@@ -6,14 +6,14 @@ class HGException(Exception):
def jslist(name, debug):
ui = pages.UIs[name]
if debug:
- x = [pages.JS_BASE, ui.get("extra", []), pages.DEBUG, ["debug/ui/frontends/%s" % y for y in ui["uifiles"]]]
+ x = [pages.JS_DEBUG_BASE, ui.get("extra", []), pages.DEBUG, ["debug/ui/frontends/%s" % y for y in ui["uifiles"]]]
hgid = ""
else:
#x = [pages.JS_BASE, ui.get("buildextra", ui.get("extra", [])), pages.BUILD_BASE, name]
- x = [name]
+ x = [pages.JS_RAW_BASE, name]
hgid = "-" + gethgid()
- return list("js/%s%s.js" % (y, hgid) for y in pages.flatten(x))
+ return list(y if y.startswith("//") else "js/%s%s.js" % (y, hgid) for y in pages.flatten(x))
def csslist(name, debug, gen=False):
ui = pages.UIs[name]
@@ -27,7 +27,7 @@ def csslist(name, debug, gen=False):
def _gethgid():
try:
- p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE)
+ p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, shell=os.name == "nt")
except Exception, e:
if hasattr(e, "errno") and e.errno == 2:
raise HGException, "unable to execute"
@@ -54,7 +54,10 @@ def producehtml(name, debug):
js = jslist(name, debug)
css = csslist(name, debug, gen=True)
csshtml = "\n".join(" " % (config.STATIC_BASE_URL, x) for x in css)
- jshtml = "\n".join(" " % (config.STATIC_BASE_URL, x) for x in js)
+ jshtml = "\n".join(" " % ("" if x.startswith("//") else config.STATIC_BASE_URL, x) for x in js)
+
+ if hasattr(config, "ANALYTICS_HTML"):
+ jshtml+="\n" + config.ANALYTICS_HTML
div = ui.get("div", "")
customjs = ui.get("customjs", "")
@@ -65,8 +68,9 @@ def producehtml(name, debug):