From ca0241840eb45d56cdbe1639446989afae092d7c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 20 Mar 2013 19:10:16 -0400 Subject: [PATCH] swc-windows-installer.py: Use lists for file content This allows us to keep the usual Python block indentation while still producing the appropriate wrapper content. --- setup/swc-windows-installer.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/setup/swc-windows-installer.py b/setup/swc-windows-installer.py index 42914ab..58c1b29 100755 --- a/setup/swc-windows-installer.py +++ b/setup/swc-windows-installer.py @@ -42,22 +42,25 @@ def install_nano(install_directory): def create_ipython_entry_point(python_scripts_directory): """Creates a terminal-based IPython entry point for msysgit""" - contents = """#!/usr/bin/env python -from IPython.frontend.terminal.ipapp import launch_new_instance -launch_new_instance() -""" + contents = '\n'.join([ + '#!/usr/bin/env python', + 'from IPython.frontend.terminal.ipapp import launch_new_instance', + 'launch_new_instance()', + '', + ]) with open(os.path.join(python_scripts_directory, 'ipython'), 'w') as f: f.write(contents) def create_nosetests_entry_point(python_scripts_directory): """Creates a terminal-based nosetests entry point for msysgit""" - contents = """#!/usr/bin/env/ python -import sys -import nose - -if __name__ == '__main__': - sys.exit(nose.core.main()) -""" + contents = '\n'.join([ + '#!/usr/bin/env/ python', + 'import sys', + 'import nose', + "if __name__ == '__main__':", + ' sys.exit(nose.core.main())', + '', + ]) with open(os.path.join(python_scripts_directory, 'nosetests'), 'w') as f: f.write(contents) -- 2.26.2