##// END OF EJS Templates
add `setup.py jsversion`...
MinRK -
Show More
@@ -1,5 +1,5 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
2 // Copyright (C) 2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
@@ -7,6 +7,8 b''
7
7
8 var IPython = IPython || {};
8 var IPython = IPython || {};
9
9
10 IPython.version = "2.0.0-dev";
11
10 IPython.namespace = function (ns_string) {
12 IPython.namespace = function (ns_string) {
11 "use strict";
13 "use strict";
12
14
@@ -68,6 +68,7 b' from setupbase import ('
68 require_submodules,
68 require_submodules,
69 UpdateSubmodules,
69 UpdateSubmodules,
70 CompileCSS,
70 CompileCSS,
71 JavascriptVersion,
71 install_symlinked,
72 install_symlinked,
72 install_lib_symlink,
73 install_lib_symlink,
73 install_scripts_for_symlink,
74 install_scripts_for_symlink,
@@ -236,6 +237,7 b" setup_args['cmdclass'] = {"
236 'symlink': install_symlinked,
237 'symlink': install_symlinked,
237 'install_lib_symlink': install_lib_symlink,
238 'install_lib_symlink': install_lib_symlink,
238 'install_scripts_sym': install_scripts_for_symlink,
239 'install_scripts_sym': install_scripts_for_symlink,
240 'jsversion' : JavascriptVersion,
239 }
241 }
240
242
241 #---------------------------------------------------------------------------
243 #---------------------------------------------------------------------------
@@ -564,3 +564,25 b' class CompileCSS(Command):'
564
564
565 def run(self):
565 def run(self):
566 call("fab css", shell=True, cwd=pjoin(repo_root, "IPython", "html"))
566 call("fab css", shell=True, cwd=pjoin(repo_root, "IPython", "html"))
567
568 class JavascriptVersion(Command):
569 """write the javascript version to notebook javascript"""
570 description = "Write IPython version to javascript"
571 user_options = []
572
573 def initialize_options(self):
574 pass
575
576 def finalize_options(self):
577 pass
578
579 def run(self):
580 nsfile = pjoin(repo_root, "IPython", "html", "static", "base", "js", "namespace.js")
581 with open(nsfile) as f:
582 lines = f.readlines()
583 with open(nsfile, 'w') as f:
584 for line in lines:
585 if line.startswith("IPython.version"):
586 line = 'IPython.version = "{0}";\n'.format(version)
587 f.write(line)
588
General Comments 0
You need to be logged in to leave comments. Login now