eg/tryhy: add server_sofware to welcome message

This commit is contained in:
Johan Euphrosine 2013-11-02 01:25:17 -07:00
parent b099925eb2
commit 68891f5d32
3 changed files with 9 additions and 3 deletions

View File

@ -25,7 +25,10 @@ $(document).ready(function(){
animateScroll:true,
promptHistory:true,
autofocus:true,
welcomeMessage: 'hy ({hy_version})'.supplant({hy_version: hy_version})
welcomeMessage: 'hy ({hy_version}) [{server_software}]'.supplant({
hy_version: hy_version,
server_software: server_software
})
});
console.promptText('(+ 41 1)');
});

View File

@ -1,4 +1,5 @@
(import [sys]
(import [os]
[sys]
[StringIO [StringIO]]
[json]
[hy.cmdline [HyREPL]]
@ -22,7 +23,8 @@
(with-decorator (kwapply (app.route "/") {"methods" ["GET"]})
(fn []
(kwapply (render_template "index.html") {"hy_version" hy.__version__})
(kwapply (render_template "index.html")
{"hy_version" hy.__version__ "server_software" (get os.environ "SERVER_SOFTWARE")})
))
(with-decorator (kwapply (app.route "/eval") {"methods" ["POST"]})

View File

@ -8,6 +8,7 @@
<script type="text/javascript" src="js/repl.js"></script>
<script type="text/javascript">
var hy_version = '{{hy_version}}';
var server_software = '{{server_software}}';
</script>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>