Download file from source app or url, and return local filename.

def download_file_from_url(self, source_app, url):
        """ Download file from source app or url, and return local filename. """
        if source_app:
            source_name = source_app
        else:
            source_name = urlparse.urlparse(url).netloc.replace('.', '_')

        filename = self.create_file_name(source_name)
        self.download_file(url, filename)
        return filename