Skip to content

Commit

Permalink
swc-windows-installer.py: Use the stdlib's urlopen()
Browse files Browse the repository at this point in the history
This way I can test the script (on Linux, but whatever) without having
to install an additional package.
  • Loading branch information
wking committed Mar 20, 2013
1 parent 8255ff6 commit 6bcf6d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions setup/swc-windows-installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@
except ImportError: # Python 2
from StringIO import StringIO as _BytesIO
import os.path
try: # Python 3
from urllib.request import urlopen as _urlopen
except ImportError: # Python 2
from urllib2 import urlopen as _urlopen
import zipfile

import requests


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)
nano_zip_content = _BytesIO(r.content)
r = _urlopen(url)
nano_zip_content = _BytesIO(r.read())
nano_zip = zipfile.ZipFile(nano_zip_content)
nano_files = ['nano.exe', 'cygwin1.dll', 'cygintl-8.dll',
'cygiconv-2.dll', 'cyggcc_s-1.dll']
Expand Down

0 comments on commit 6bcf6d4

Please sign in to comment.