예제 #1
0
 def decline(self):
     self.yahoo.send('peerrequest', 'available',
                     ['frombuddy', self.packet.to,
                      'to', self.packet.buddyname,
                      'p2pcookie', self.packet.p2pcookie,
                      'acceptxfer', '4'])
     self.state    = self.states.CANCELLED_BY_YOU
     IncomingFileTransfer.decline(self)
예제 #2
0
 def _ondone(self):
     try:
         self.yahoo.file_transfers.pop((self.packet.buddyname, self.packet.p2pcookie))
     except Exception:
         log.warning('_ondone pop failed')
     try:
         IncomingFileTransfer._ondone(self)
     except Exception:
         log.warning('_ondone call failed')
예제 #3
0
    def __init__(self, yahoo, buddy, **kws):
        IncomingFileTransfer.__init__(self)
        self.yahoo = yahoo
        self.buddy = buddy
        self.name = kws['filename']
        self.packet = Storage(**kws)
        self.numfiles = 1
        self.size = int(kws['filesize'])

        self.on_get_buddy(self.buddy)
예제 #4
0
    def __init__(self, si_handler, iq):
        self.si_handler = si_handler
        self.stanza = iq
        self.si_ft = SI_FileTransfer.from_iq(iq)
        self.bytestream = None
        self._lock = threading.RLock()

        if self.check_streams():
            #CAS: fix this with fail cases, i.e. check to see if this is a valid offer

            ft = self.si_ft
            self.numfiles = 1
            self.name     = ft.file.name
            self.size     = ft.file.size
            self.buddy    = self.si_handler.j.buddies[iq.get_from()]
            file_desc = unicode(ft.file.desc)
            IncomingFileTransfer.__init__(self)
            si_handler.j.hub.on_file_request(si_handler.j, self)

            self.on_get_buddy(self.buddy)
예제 #5
0
    def __init__(self, si_handler, iq):
        self.si_handler = si_handler
        self.stanza = iq
        self.si_ft = SI_FileTransfer.from_iq(iq)
        self.bytestream = None
        self._lock = threading.RLock()

        if self.check_streams():
            #CAS: fix this with fail cases, i.e. check to see if this is a valid offer

            ft = self.si_ft
            self.numfiles = 1
            self.name = ft.file.name
            self.size = ft.file.size
            self.buddy = self.si_handler.j.buddies[iq.get_from()]
            file_desc = unicode(ft.file.desc)
            IncomingFileTransfer.__init__(self)
            si_handler.j.hub.on_file_request(si_handler.j, self)

            self.on_get_buddy(self.buddy)
예제 #6
0
 def decline(self, reason = None):
     self.si_handler.reject(self.stanza, reason)
     self.state = self.states.CANCELLED_BY_YOU
     IncomingFileTransfer.decline(self)
예제 #7
0
 def decline(self, reason=None):
     self.si_handler.reject(self.stanza, reason)
     self.state = self.states.CANCELLED_BY_YOU
     IncomingFileTransfer.decline(self)