ZC buildout recipe to fetch urls
Project description
What is iw.recipe.fetcher ?
Download an url to a local directory.
How to use iw.recipe.fetcher ?
The recipe download from an http server:
>>> server_data = tmpdir('server_data') >>> write(server_data, 'file1.txt', 'test1') >>> write(server_data, 'file2.txt', 'test1') >>> write(server_data, 'file3.txt', 'test1') >>> server_url = start_server(server_data)
We need some buildout vars:
>>> write('buildout.cfg', ''' ... [buildout] ... parts=test1 ... ... [test1] ... recipe=iw.recipe.fetcher ... urls= ... %(server_url)s/file1.txt ... base_url=%(server_url)s ... files= ... file2.txt ... file3.txt ... ''' % dict(server_url=server_url))
Now we can fetch some urls:
>>> print system(buildout) Installing test1. <BLANKLINE>
It works:
>>> ls(sample_buildout, 'test1') - file1.txt - file2.txt - file3.txt >>> write('buildout.cfg', ''' ... [buildout] ... parts=test2 ... ... [test2] ... recipe=iw.recipe.fetcher ... urls= ... http://www.example.com/file1.txt ... find-links=%(server_url)s ... ''' % dict(server_url=server_url))
Now we can fetch some urls:
>>> print system(buildout) Uninstalling test1. Installing test2. <BLANKLINE>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iw.recipe.fetcher-0.2.tar.gz
(4.3 kB
view details)
Built Distribution
iw.recipe.fetcher-0.2-py2.4.egg
(10.4 kB
view details)
File details
Details for the file iw.recipe.fetcher-0.2.tar.gz
.
File metadata
- Download URL: iw.recipe.fetcher-0.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52487dfe3a9538712cf051c89c4c6bb8402a6685d2fbdf2efcac96cf2c2a6c7f |
|
MD5 | c200b73c998e54a963bd0cd7248ab298 |
|
BLAKE2b-256 | e55a56fc2a12f01cc4bcbacbe99f3c62215d73ca22e0f47c697e84debcc5ee18 |
File details
Details for the file iw.recipe.fetcher-0.2-py2.4.egg
.
File metadata
- Download URL: iw.recipe.fetcher-0.2-py2.4.egg
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05de36a647efb5571fad8a1d970e84e0c835abbe58d3575ac70ca205d9ee6268 |
|
MD5 | 710b35be21b2fb1cdd2d5897194e6fd5 |
|
BLAKE2b-256 | fc6e3b2e8856512d73b241824c0a96259df7b88e886d12a705b39d46e418f290 |