infile = urllib.urlopen(url)
shutil.copyfileobj(infile, outfile)
else:
- base = os.path.basename(args[0])
+ base = args[0]
# extract the files, but be smart: if only one directory is output,
# move the contents of that directory here
sh.call("tar", "xf", base)