Coder Social home page Coder Social logo

hexagonit.recipe.download's Introduction

Download recipe for zc.buildout

The recipe downloads packages from the net and extracts them on the filesystem. It is based on the gocept.download recipe with a few additional features.

Supported Python versions: 2.6, 2.7, 3.2, 3.3, 3.4, 3.5

Supported zc.buildout versions: 1.x, 2.x

hexagonit.recipe.download's People

Contributors

dokai avatar domenkozar avatar desaintmartin avatar fschulze avatar toumorokoshi avatar thefunny42 avatar miano avatar jean avatar

Stargazers

Andreas Motl avatar Angus H. avatar  avatar Mantas Zimnickas avatar Sean Chen avatar Baiju Muthukadan avatar Stephen Day avatar 0x627832 avatar Bradford Toney avatar  avatar Bernd Dorn avatar  avatar

Watchers

 avatar  avatar James Cloos avatar  avatar

hexagonit.recipe.download's Issues

it is not possible to use recipe without cache

h.r.download is setting default cache directory, even if buildout:download-cache does not exists. In environments where destination files are changing often it does not redownloads changed files from network. It requires to delete those files in buildout:directory/downloads and reinstall part using h.r.download

Wanted behaviour would be possibility to pass parameter to h.r.download to not use cache at all, and only use temporary files. It would be nice if such parameter could be set globally in buildout: namespace, with falling back to part namespace.

Of course, current behaviour of automatic caching is perfect default for most of world.

ignore-existing

ignore-existing is set true, the recipe still attempts to copy source to target.

Allow to specify user agent

Recently jqueryui.com started to reject all requests from Python's urllib.urlretrieve:

Installing jquery-ui.
Downloading http://jqueryui.com/resources/download/jquery-ui-1.11.2.zip
While:
  Installing jquery-ui.
Error: Error downloading extends for URL http://jqueryui.com/resources/download/jquery-ui-1.11.2.zip: ('http error', 403, 'Forbidden', <httplib.HTTPMessage instance at 0x2b24654b3758>)

Maybe changing user agent would solve it. So it would be great to have possibility to change user agent.

allow specifying destination filename if download-only = true

it would be nice if there was a 'filename' option to use when "download-only = true".

Many times the original URL has no information about the intention of the downloaded file, so it would be nice if it was possible to specify the file name in the destination. This should have no impact on the file-name in the download cache directory and should only be effective if "download-only=true"

NameError: global name 'log' is not defined

While trying to work with https://launchpad.net/bzr-windows-installers I've encountered the following problem inside hexagonit:

C:\work\Bazaar\bzr-windows-installers>py26 build.py --standalone-only installers
Initialising C:\work\Bazaar\bzr-windows-installers\build-win32 directory
Running c:\Python26\python.exe bootstrap.py ...
Creating directory 'C:\work\Bazaar\bzr-windows-installers\build-win32\bin'.
Creating directory 'C:\work\Bazaar\bzr-windows-installers\build-win32\parts'.
Creating directory 'C:\work\Bazaar\bzr-windows-installers\build-win32\eggs'.
Creating directory 'C:\work\Bazaar\bzr-windows-installers\build-win32\develop-eggs'.
Generated script 'C:\work\Bazaar\bzr-windows-installers\build-win32\bin\buildout'.
Generating buildout configuration for bzr-2.2 ...
Generating buildout-bzr-2.2.cfg in .
Running bin\buildout -c buildout-bzr-2.2.cfg ...
Getting distribution for 'hexagonit.recipe.download==1.2.2'.
Got hexagonit.recipe.download 1.2.2.
c:\work\bazaar\bzr-windows-installers\build-win32\eggs\hexagonit.recipe.download-1.2.2-py2.6.egg\hexagonit\recipe\download__ini
t__.py:5: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
Getting distribution for 'gf.recipe.bzr==1.0rc8'.
Got gf.recipe.bzr 1.0rc8.
Installing svn-lib.
svn-lib: Creating download directory: C:\work\Bazaar\bzr-windows-installers\build-win32\downloads
While:
Installing svn-lib.

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "c:\work\bazaar\bzr-windows-installers\build-win32\eggs\zc.buildout-1.4.3-py2.6.egg\zc\buildout\buildout.py", line 1660,
in main
getattr(buildout, command)(args)
File "c:\work\bazaar\bzr-windows-installers\build-win32\eggs\zc.buildout-1.4.3-py2.6.egg\zc\buildout\buildout.py", line 532, i
n install
installed_files = self[part].call(recipe.install)
File "c:\work\bazaar\bzr-windows-installers\build-win32\eggs\zc.buildout-1.4.3-py2.6.egg\zc\buildout\buildout.py", line 1204,
in call
return f()
File "c:\work\bazaar\bzr-windows-installers\build-win32\eggs\hexagonit.recipe.download-1.2.2-py2.6.egg\hexagonit\recipe\downlo
ad__init
.py", line 125, in install
base = self.calculate_base(extract_dir)
File "c:\work\bazaar\bzr-windows-installers\build-win32\eggs\hexagonit.recipe.download-1.2.2-py2.6.egg\hexagonit\recipe\downlo
ad__init__.py", line 65, in calculate_base
log.error('Unable to strip top level directory because there are more '
NameError: global name 'log' is not defined

See https://bugs.launchpad.net/bzr-windows-installers/+bug/561240

"mode" support

Hello,
What would you think about a "mode" support in h.r.download? It would just chmod the output file if "download-only" is specified.

The new ignore-existing make this recipe useless in some cases

In older versions of the recipe we where able to overwrite existing files with new ones downloaded by the recipe itself.

Newer version now fail if one or more files are will be overwritten by the recipe.
The new versions introduced this ignore-existing option, but in the case above this is still useless as we can only

  • let buildout fail
  • ignore existings files

In facts we are no more able to overwrite files.

.gz support

Now hexagonit.recipe.download does not recognize .gz archives, for example, I have this section:

[geo-lite-country]
recipe = hexagonit.recipe.download
url = http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
destination = ${buildout:parts-directory}/geoip
hash-name = false

And running buildout I get this error:

Installing geo-lite-country.
Downloading http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
geo-lite-country: Unable to extract the package /home/sirex/.buildout/downloads/GeoIP.dat.gz. Unknown format.
While:
  Installing geo-lite-country.
Error: Package extraction error

ignore-existing=true doesn't work on Windows

When dest exists, shutil.move calls shutil.copytree, calls os.makedirs, call os.mkdir(dest), which throws an error. This is on Windows, but it's in keeping with the docs for move, copytree and makedirs. The problem shows up on Windows because on other platforms shutil.move usually manages to use os.rename to implement the move. When src and dest are on different filesystems you'd probably get the same issue.

if download-only = true, the destination filename should match the original filename

The version 1.4.0 caused filenames in the cache to be named as hash values by default.

This is fine, but when using:

download-only = true

The filename in the destination ends up being the hash name, which is not usually what was intended. In this cases there is very little chance of a name collision (as is the case in the download cache where names should be hashed by default) so naming the downloaded file in the destination as a hash does not seem like a good idea.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.