##// 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 4 // Distributed under the terms of the BSD License. The full license is in
5 5 // the file COPYING, distributed as part of this software.
@@ -7,6 +7,8 b''
7 7
8 8 var IPython = IPython || {};
9 9
10 IPython.version = "2.0.0-dev";
11
10 12 IPython.namespace = function (ns_string) {
11 13 "use strict";
12 14
@@ -68,6 +68,7 b' from setupbase import ('
68 68 require_submodules,
69 69 UpdateSubmodules,
70 70 CompileCSS,
71 JavascriptVersion,
71 72 install_symlinked,
72 73 install_lib_symlink,
73 74 install_scripts_for_symlink,
@@ -236,6 +237,7 b" setup_args['cmdclass'] = {"
236 237 'symlink': install_symlinked,
237 238 'install_lib_symlink': install_lib_symlink,
238 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 565 def run(self):
566 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