safe.utilities.file_downloader module

InaSAFE Disaster risk assessment tool developed by AusAid -
IS Utilities implementation.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.utilities.file_downloader.FileDownloader(manager, url, output_path, progress_dialog=None)[source]

Bases: object

The blueprint for downloading file from url.

download()[source]

Downloading the file.

Returns:True if success, otherwise returns a tuple with format like this (QNetworkReply.NetworkError, error_message)
Raises:IOError - when cannot create output_path
get_buffer()[source]

Get buffer from self.reply and store it to our buffer container.

write_data()[source]

Write data to a file.