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"
div = ui.get("div", "")
customjs = ui.get("customjs", "")
- if debug:
- customjs = """<script type="text/javascript">
-QWEBIRC_DEBUG = true;
-</script>
-""" + customjs
-
return """%s
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<base />
<title>%s (qwebirc)</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
+ <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<link rel="shortcut icon" type="image/png" href="%simages/favicon.png"/>
-%s%s
+%s<script type="text/javascript">QWEBIRC_DEBUG=%s;</script>%s
%s
<script type="text/javascript">
var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.%s, %s);
</div>
</body>
</html>
-""" % (ui["doctype"], config.APP_TITLE, config.STATIC_BASE_URL, csshtml, customjs, jshtml, ui["class"], optionsgen.get_options(), div)
+""" % (ui["doctype"], config.APP_TITLE, config.STATIC_BASE_URL, csshtml, debug and "true" or "false", customjs, jshtml, ui["class"], optionsgen.get_options(), div)
def main(outputdir=".", produce_debug=True):
p = os.path.join(outputdir, "static")