Ticket #3462: t3462.diff

File t3462.diff, 1.8 KB (added by warner, 8 years ago)

patch to implement the interface+implementation change

  • twisted/protocols/ftp.py

     
    10491049                cons = ASCIIConsumerWrapper(cons)
    10501050
    10511051            d = self.dtpInstance.registerConsumer(cons)
    1052             d.addCallbacks(cbSent, ebSent)
    10531052
    10541053            # Tell them what to doooo
    10551054            if self.dtpInstance.isConnected:
     
    10621061        def cbOpened(file):
    10631062            d = file.receive()
    10641063            d.addCallback(cbConsumer)
     1064            d.addCallback(lambda ignored: file.close())
     1065            d.addCallbacks(cbSent, ebSent)
    10651066            return d
    10661067
    10671068        def ebOpened(err):
     
    14341435        @rtype: C{Deferred} of C{IConsumer}
    14351436        """
    14361437
     1438    def close():
     1439        """
     1440        Perform any post-write work that needs to be done. This method may
     1441        only be invoked once on each provider, and will always be invoked
     1442        after receive().
    14371443
     1444        @rtype: C{Deferred} of anything: the value is ignored
     1445        """
    14381446
    14391447def _getgroups(uid):
    14401448    """Return the primary and supplementary groups for the given UID.
     
    17951803        # FileConsumer will close the file object
    17961804        return defer.succeed(FileConsumer(self.fObj))
    17971805
     1806    def close(self):
     1807        return defer.succeed(None)
    17981808
    17991809
    18001810class FTPRealm:
  • twisted/vfs/adapters/ftp.py

     
    295295        """
    296296        return defer.succeed(IConsumer(self.node))
    297297
     298    def close(self):
     299        """
     300        Perform post-write actions.
     301        """
     302        return defer.succeed(None)
    298303
    299304
    300305class _FileToConsumerAdapter(object):