Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit ca1cc89b2bbd3b4ef17dc98f28a8ede05d75334c

  • avatar
  • Chris Porter <slug @quak…et.org>
  • Sun Feb 01 21:29:39 EST 2009
Produce compiled files based on hg id.
  
2828 f.close()
2929
3030def main(outputdir=".", produce_debug=True):
31 ID = pagegen.gethgid()
32
3133 pagegen.main(outputdir, produce_debug=produce_debug)
3234
3335 coutputdir = os.path.join(outputdir, "compiled")
4747
4848 for uiname, value in pages.UIs.items():
4949 csssrc = pagegen.csslist(uiname, True)
50 jmerge_files(outputdir, "css", uiname, csssrc)
50 jmerge_files(outputdir, "css", uiname + "-" + ID, csssrc)
5151 #jmerge_files(outputdir, "js", uiname, value["uifiles"], lambda x: os.path.join("js", "ui", "frontends", x + ".js"))
5252
5353 alljs = []
5959 alljs.append(os.path.join("js", y + ".js"))
6060 for y in value["uifiles"]:
6161 alljs.append(os.path.join("js", "ui", "frontends", y + ".js"))
62 jmerge_files(outputdir, "js", uiname, alljs)
62 jmerge_files(outputdir, "js", uiname + "-" + ID, alljs)
6363
6464 os.rmdir(coutputdir)
6565
  
1import os, sys, pages
1import os, sys, pages, subprocess, re
22
33def jslist(name, debug):
44 ui = pages.UIs[name]
55 if debug:
66 x = [pages.JS_BASE, ui.get("extra", []), pages.DEBUG, ["debug/ui/frontends/%s" % y for y in ui["uifiles"]]]
7 hgid = ""
78 else:
89 #x = [pages.JS_BASE, ui.get("buildextra", ui.get("extra", [])), pages.BUILD_BASE, name]
910 x = [name]
10
11 return list("js/%s.js" % y for y in pages.flatten(x))
11 hgid = "-" + gethgid()
12
13 return list("js/%s%s.js" % (y, hgid) for y in pages.flatten(x))
1214
1315def csslist(name, debug, gen=False):
1416 if not debug:
15 return ["css/%s.css" % name]
17 return ["css/%s-%s.css" % (name, gethgid())]
1618 ui = pages.UIs[name]
1719 return list("css/%s%s.css" % ("debug/" if gen else "", x) for x in pages.flatten([ui.get("extracss", []), "colours", "dialogs", "%s" % name]))
20
21HGID = None
22def gethgid():
23 global HGID
24 if HGID is None:
25 hgid = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE).communicate()[0]
26 HGID = re.match("^([0-9a-f]+).*", hgid).group(1)
27 return HGID
1828
1929def producehtml(name, debug):
2030 ui = pages.UIs[name]
clean.py
(5 / 2)
  
11#!/usr/bin/env python
22
3import bin.pages as pages, os, bin.cleanpyc as cleanpyc
3import bin.pages as pages, os, bin.cleanpyc as cleanpyc, glob
44from bin.cleanpyc import tryunlink
55
66for x in pages.UIs:
7 for y in glob.glob(os.path.join("static", "js", "%s-*.js" % x)):
8 tryunlink(y)
9 for y in glob.glob(os.path.join("static", "css", "%s-*.js" % x)):
10 tryunlink(y)
711 tryunlink("static", "%s.html" % x)
812 tryunlink("static", "%sdebug.html" % x)
9 tryunlink("static", "js", "%s.js" % x)
1013
1114if __name__ == "__main__":
1215 tryunlink("static", "js", "qwebirc.js")