pypicloud.storage.files module¶
Store packages as files on disk
- class pypicloud.storage.files.FileStorage(request=None, **kwargs)[source]¶
Bases:
IStorage
Stores package files on the filesystem
- download_response(package)[source]¶
Return a HTTP Response that will download this package
This is called from the download endpoint
- list(factory=<class 'pypicloud.models.Package'>)[source]¶
Return a list or generator of all packages
- open(package)[source]¶
Get a buffer object that can read the package data
This should be a context manager. It is used in migration scripts, not directly by the web application.
- Parameters
- package
Package
- package
Examples
with storage.open(package) as pkg_data: with open('outfile.tar.gz', 'w') as ofile: ofile.write(pkg_data.read())