From: W. Trevor King Date: Wed, 20 Mar 2013 22:21:56 +0000 (-0400) Subject: swc-windows-installer.py: Extract nano directly to the install directory X-Git-Tag: v0.1~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e43ac6d5f23aa2b5fe36b15cfd9a7c1077b8f6a;p=swc-setup-windows-installer.git swc-windows-installer.py: Extract nano directly to the install directory This is more efficient than "extract to . and then copy". I also renamed the install_nano() argument. The function doesn't care that we're currently passing the Python script directory; it will work perfectly well with a different directory in the PATH. --- diff --git a/setup/swc-windows-installer.py b/setup/swc-windows-installer.py index 74ee321..61d1f93 100755 --- a/setup/swc-windows-installer.py +++ b/setup/swc-windows-installer.py @@ -23,14 +23,13 @@ try: # Python 3 from io import BytesIO as _BytesIO except ImportError: # Python 2 from StringIO import StringIO as _BytesIO -import shutil import os.path import zipfile import requests -def install_nano(python_scripts_directory): +def install_nano(install_directory): """Download and install the nano text editor""" url = "http://www.nano-editor.org/dist/v2.2/NT/nano-2.2.6.zip" r = requests.get(url) @@ -39,8 +38,7 @@ def install_nano(python_scripts_directory): nano_files = ['nano.exe', 'cygwin1.dll', 'cygintl-8.dll', 'cygiconv-2.dll', 'cyggcc_s-1.dll'] for file_name in nano_files: - nano_zip.extract(file_name, '.') - shutil.move(file_name, python_scripts_directory) + nano_zip.extract(file_name, install_directory) def create_ipython_entry_point(python_scripts_directory): """Creates a terminal-based IPython entry point for msysgit"""