extras/audioUploader/transfer.py: use pycurl.XFERINFOFUNCTION; PROGRESSFUNCTION is deprecated since libcurl 7.32. Only convert_bytes is imported from utils module.

This commit is contained in:
Jose Manuel Delicado 2016-05-06 10:24:01 +02:00
parent 45f23a4c8a
commit ff49bd2488

View File

@ -5,7 +5,7 @@ import threading
import time import time
import json import json
import logging import logging
from utils import * from utils import convert_bytes
from pubsub import pub from pubsub import pub
log = logging.getLogger("extra.AudioUploader.transfer") log = logging.getLogger("extra.AudioUploader.transfer")
@ -20,7 +20,7 @@ class Transfer(object):
self.completed_callback = completed_callback self.completed_callback = completed_callback
self.background_thread = None self.background_thread = None
self.transfer_rate = 0 self.transfer_rate = 0
self.curl.setopt(self.curl.PROGRESSFUNCTION, self.progress_callback) self.curl.setopt(self.curl.XFERINFOFUNCTION, self.progress_callback)
self.curl.setopt(self.curl.URL, url) self.curl.setopt(self.curl.URL, url)
self.curl.setopt(self.curl.NOPROGRESS, 0) self.curl.setopt(self.curl.NOPROGRESS, 0)
self.curl.setopt(self.curl.HTTP_VERSION, self.curl.CURL_HTTP_VERSION_1_0) self.curl.setopt(self.curl.HTTP_VERSION, self.curl.CURL_HTTP_VERSION_1_0)