swc-windows-installer.py: Simplify `ipython` wrapper
authorW. Trevor King <wking@tremily.us>
Wed, 20 Mar 2013 22:42:49 +0000 (18:42 -0400)
committerW. Trevor King <wking@tremily.us>
Mon, 21 Oct 2013 03:55:18 +0000 (20:55 -0700)
This matches my system's `/usr/bin/ipython-2.7`, and is the hook
defined in IPython's setupbase.py:

  'ipython%s = IPython.frontend.terminal.ipapp:launch_new_instance'

This should handle the 'notebook' option internally.

setup/swc-windows-installer.py

index 61d1f93713bfc5a680a1808c7f42be83621eed31..3ce1fbf229f1211d9c32ea3b03ce9e2dc5dd13bc 100755 (executable)
@@ -44,18 +44,8 @@ def create_ipython_entry_point(python_scripts_directory):
     """Creates a terminal-based IPython entry point for msysgit"""
     output_file = open(python_scripts_directory + 'ipython', 'w')
     file_contents = """#!/usr/bin/env python
-import sys
-from IPython.frontend.html.notebook.notebookapp import launch_new_instance as launch_notebook
-from IPython.frontend.terminal.ipapp import launch_new_instance as launch_ipython
-
-def main():
-    if len(sys.argv) > 1 and sys.argv[1] == 'notebook':
-        sys.exit(launch_notebook())
-    else:
-        sys.exit(launch_ipython())
-
-if __name__ == '__main__':
-    main()
+from IPython.frontend.terminal.ipapp import launch_new_instance
+launch_new_instance()
 """
 
     output_file.write(file_contents)