Beispiel #1
0
    def __init__(self,
                 jid,
                 accountJid,
                 sourcePath,
                 uploadUrl,
                 resumeOffset=0,
                 successClbk=None,
                 errorClbk=None,
                 progressCallback=None,
                 asynchronous=True):
        WARequest.__init__(self)

        self.asynchronous = asynchronous
        self.jid = jid
        self.accountJid = accountJid
        self.sourcePath = sourcePath
        self.uploadUrl = uploadUrl
        self.resumeOffset = resumeOffset

        self.successCallback = successClbk
        self.errorCallback = errorClbk
        self.progressCallback = progressCallback

        self.pvars = [
            "name", "type", "size", "url", "error", "mimetype", "filehash",
            "width", "height"
        ]

        self.setParser(JSONResponseParser())

        self.sock = socket.socket()
Beispiel #2
0
    def __init__(self, jid, accountJid, sourcePath, uploadUrl, resumeOffset=0, successClbk=None, errorClbk=None, progressCallback=None, asynchronous=True):
        WARequest.__init__(self)

        self.asynchronous = asynchronous
        self.jid = jid
        self.accountJid = accountJid
        self.sourcePath = sourcePath
        self.uploadUrl = uploadUrl
        self.resumeOffset = resumeOffset

        self.successCallback = successClbk
        self.errorCallback = errorClbk
        self.progressCallback = progressCallback

        self.pvars = ["name", "type", "size", "url", "error",
                      "mimetype", "filehash", "width", "height"]

        self.setParser(JSONResponseParser())

        self.sock = socket.socket()
class MediaUploader(WARequest, threading.Thread):
    def __init__(self,
                 jid,
                 accountJid,
                 sourcePath,
                 uploadUrl,
                 resumeOffset=0,
                 successClbk=None,
                 errorClbk=None,
                 progressCallback=None,
                 async=True):
        WARequest.__init__(self)

        self. async = async