plugin XEP-0363: updated to namespace "urn:xmpp:http:upload:0", handle headers

This commit is contained in:
Goffi 2019-03-22 19:26:08 +01:00
commit 9335194f7b

View file

@ -37,6 +37,7 @@ class IStreamProducer(interface.Interface):
@return (D): deferred fired when stream is finished
"""
pass
class SatFile(object):
@ -44,17 +45,8 @@ class SatFile(object):
# TODO: manage "with" statement
def __init__(
self,
host,
client,
path,
mode="rb",
uid=None,
size=None,
data_cb=None,
auto_end_signals=True,
):
def __init__(self, host, client, path, mode="rb", uid=None, size=None, data_cb=None,
auto_end_signals=True):
"""
@param host: %(doc_host)s
@param path(str): path of the file to get
@ -65,8 +57,10 @@ class SatFile(object):
@param size(None, int): size of the file (when known in advance)
@param data_cb(None, callable): method to call on each data read/write
mainly useful to do things like calculating hash
@param auto_end_signals(bool): if True, progressFinished and progressError signals are automatically sent
if False, you'll have to call self.progressFinished and self.progressError yourself
@param auto_end_signals(bool): if True, progressFinished and progressError signals
are automatically sent.
if False, you'll have to call self.progressFinished and self.progressError
yourself.
progressStarted signal is always sent automatically
"""
self.host = host