Beispiel #1
0
def main(outputdir=".", produce_debug=True):
    ID = pagegen.gethgid()

    pagegen.main(outputdir, produce_debug=produce_debug)

    coutputdir = os.path.join(outputdir, "compiled")
    try:
        os.mkdir(coutputdir)
    except:
        pass

    try:
        os.mkdir(os.path.join(outputdir, "static", "css"))
    except:
        pass

    #jmerge_files(outputdir, "js", "qwebirc", pages.DEBUG_BASE, lambda x: os.path.join("js", x + ".js"))

    for uiname, value in pages.UIs.items():
        csssrc = pagegen.csslist(uiname, True)
        jmerge_files(outputdir, "css", uiname + "-" + ID, csssrc)
        shutil.copy2(
            os.path.join(outputdir, "static", "css",
                         uiname + "-" + ID + ".css"),
            os.path.join(outputdir, "static", "css", uiname + ".css"))

        mcssname = os.path.join("css", uiname + ".mcss")
        if os.path.exists(mcssname):
            mcssdest = os.path.join(outputdir, "static", "css",
                                    uiname + ".mcss")
            shutil.copy2(mcssname, mcssdest)
            shutil.copy2(
                mcssdest,
                os.path.join(outputdir, "static", "css",
                             uiname + "-" + ID + ".mcss"))

        #jmerge_files(outputdir, "js", uiname, value["uifiles"], lambda x: os.path.join("js", "ui", "frontends", x + ".js"))

        alljs = []
        for y in pages.JS_BASE:
            alljs.append(os.path.join("static", "js", y + ".js"))
        for y in value.get("buildextra", []):
            alljs.append(os.path.join("static", "js", "%s.js" % y))
        for y in pages.DEBUG_BASE:
            alljs.append(os.path.join("js", y + ".js"))
        for y in value["uifiles"]:
            alljs.append(os.path.join("js", "ui", "frontends", y + ".js"))
        jmerge_files(outputdir,
                     "js",
                     uiname + "-" + ID,
                     alljs,
                     file_prefix="QWEBIRC_BUILD=\"" + ID + "\";\n")

    os.rmdir(coutputdir)

    f = open(".compiled", "w")
    f.close()
def main(outputdir=".", produce_debug=True):

  path = "/".join(os.path.join(os.path.dirname(__file__).split("/"))[:-1]) + "/"
  outputdir = path

  ID = pagegen.gethgid()
  
  pagegen.main(outputdir, produce_debug=produce_debug)

  coutputdir = os.path.join(outputdir, "compiled")
  try:
    os.mkdir(coutputdir)
  except:
    pass
    
  try:
    os.mkdir(os.path.join(outputdir, "static", "css"))
  except:
    pass
  
  #jmerge_files(outputdir, "js", "qwebirc", pages.DEBUG_BASE, lambda x: os.path.join("js", x + ".js"))

  path = "/".join(os.path.join(os.path.dirname(__file__).split("/"))[:-1]) + "/"

  for uiname, value in pages.UIs.items():
    csssrc = pagegen.csslist(uiname, True)
    jmerge_files(outputdir, "css", uiname + "-" + ID, [path + src for src in csssrc])
    shutil.copy2(os.path.join(outputdir, "static", "css", uiname + "-" + ID + ".css"), os.path.join(outputdir, "static", "css", uiname + ".css"))
    
    mcssname = os.path.join("css", uiname + ".mcss")
    if os.path.exists(mcssname):
      mcssdest = os.path.join(outputdir, "static", "css", uiname + ".mcss")
      shutil.copy2(mcssname, mcssdest)
      shutil.copy2(mcssdest, os.path.join(outputdir, "static", "css", uiname + "-" + ID + ".mcss"))
    
    #jmerge_files(outputdir, "js", uiname, value["uifiles"], lambda x: os.path.join("js", "ui", "frontends", x + ".js"))
    
    alljs = []
    path = "/".join(os.path.join(os.path.dirname(__file__).split("/"))[:-1]) + "/"

    for y in pages.JS_BASE:
      alljs.append(os.path.join(path, "static", "js", y + ".js"))
    for y in value.get("buildextra", []):
      alljs.append(os.path.join(path, "static", "js", "%s.js" % y))
    for y in pages.DEBUG_BASE:
      alljs.append(os.path.join(path, "js", y + ".js"))
    for y in value["uifiles"]:
      alljs.append(os.path.join(path, "js", "ui", "frontends", y + ".js"))
    jmerge_files(outputdir, "js", uiname + "-" + ID, alljs, file_prefix="QWEBIRC_BUILD=\"" + ID + "\";\n")
    
  os.rmdir(coutputdir)
  
  f = open(".compiled", "w")
  f.close()
Beispiel #3
0
def main(outputdir=".", produce_debug=True):
  ID = pagegen.getgitid()
  
  pagegen.main(outputdir, produce_debug=produce_debug)

  coutputdir = os.path.join(outputdir, "compiled")
  try:
    os.mkdir(coutputdir)
  except:
    pass
    
  try:
    os.mkdir(os.path.join(outputdir, "static", "css"))
  except:
    pass
  
  for uiname, value in pages.UIs.items():
    csssrc = pagegen.csslist(uiname, True)
    jmerge_files(outputdir, "css", uiname + "-" + ID, csssrc)
    shutil.copy2(os.path.join(outputdir, "static", "css", uiname + "-" + ID + ".css"), os.path.join(outputdir, "static", "css", uiname + ".css"))
    
    mcssname = os.path.join("css", uiname + ".mcss")
    if os.path.exists(mcssname):
      mcssdest = os.path.join(outputdir, "static", "css", uiname + ".mcss")
      shutil.copy2(mcssname, mcssdest)
      shutil.copy2(mcssdest, os.path.join(outputdir, "static", "css", uiname + "-" + ID + ".mcss"))
    
    alljs = []
    for y in pages.JS_BASE:
      alljs.append(os.path.join("static", "js", y + ".js"))
    for y in value.get("buildextra", []):
      alljs.append(os.path.join("static", "js", "%s.js" % y))
    alljs.extend(pages.DEBUG_BASE)
    for y in value["uifiles"]:
      alljs.append(os.path.join("js", "ui", "frontends", y + ".js"))
    jmerge_files(outputdir, "js", uiname + "-" + ID, alljs, file_prefix="QWEBIRC_BUILD=\"" + ID + "\";\n")
    
  os.rmdir(coutputdir)
  
  f = open(".compiled", "w")
  f.close()