Opened 4 years ago

Closed 4 years ago

#4580 task closed fixed (fixed)

Turn `twisted.protocols.ftp.SenderProtocol` into a regular `IConsumer`

Reported by: exarkun Owned by:
Priority: normal Milestone:
Component: core Keywords: easy
Cc: thijs Branch: branches/convert-SenderProtocol-4580-2
(diff, github, buildbot, log)
Author: cyli, exarkun Launchpad Bug:

Description

SenderProtocol implements IFinishableConsumer which is going to be deprecated (#2661). We should change this to be a plain IConsumer.

Change History (16)

comment:1 Changed 4 years ago by exarkun

It seems there are several possible approaches here:

  1. Move IFinishableConsumer into ftp.py and just treat it as an ftp-specific interface. Let SenderProtocol continue to implement it.
  2. Delete the declaration in SenderProtocol that the class implements IFinishableConsumer. Change any documentation which talks about an object that provides IFinishableConsumer to instead talk about an object that provides IFinishableConsumer and also has a finish method.
  3. Delete the declaration in SenderProtocol that the class implements IFinishableConsumer. Where an IFinishableConsumer was being returned (typically as part of a tuple), return an extra finish callable as a separate object.
  4. Invert the interfaces to accept a producer instead of returning a consumer. Define some interface to hook arbitrary producers up to consumers.

comment:2 Changed 4 years ago by cyli

  • Author set to cyli
  • Branch set to branches/convert-SenderProtocol-4580

(In [30433]) Branching to 'convert-SenderProtocol-4580'

comment:3 Changed 4 years ago by cyli

(In [30434]) Changed SenderProtocol to not implement interfaces.IFinishableConsumer

refs #4580

comment:4 Changed 4 years ago by cyli

  • Keywords easy review added
  • Owner glyph deleted

comment:5 Changed 4 years ago by thijs

  • Cc thijs added
  • Keywords review removed
  • Owner set to cyli

IFinishableConsumer needs an @since marker.

comment:6 follow-up: Changed 4 years ago by cyli

(In [30455]) Added @since marker to IFinishableConsumer

refs #4580

comment:7 Changed 4 years ago by cyli

  • Keywords review added
  • Owner cyli deleted

comment:8 in reply to: ↑ 6 Changed 4 years ago by thijs

Replying to cyli:

(In [30455]) Added @since marker to IFinishableConsumer

refs #4580

Sorry to be anal about this but I think the syntax is @since: 11.0 :)

comment:9 Changed 4 years ago by cyli

(In [30459]) Changed the @since marker text

refs #4580

comment:10 Changed 4 years ago by therve

  • Keywords review removed
  • Owner set to cyli

Almost there: '@since: 11.0', not '@since 11.0'

Please merge once fixed.

comment:11 Changed 4 years ago by <automation>

  • Owner cyli deleted

comment:12 Changed 4 years ago by exarkun

  • Author changed from cyli to cyli, exarkun
  • Branch changed from branches/convert-SenderProtocol-4580 to branches/convert-SenderProtocol-4580-2

(In [30984]) Branching to 'convert-SenderProtocol-4580-2'

comment:13 Changed 4 years ago by exarkun

(In [30986]) Fix epytext markup

refs #4580

comment:14 Changed 4 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(In [30987]) Merge convert-SenderProtocol-4580-2

Author: cyli
Reviewer: therve
Fixes: #4580

Add IFinishableConsumer to the ftp module, the only user of it, so that it can
be removed from the more general twisted.internet.interfaces module.

comment:15 Changed 4 years ago by exarkun

  • Resolution fixed deleted
  • Status changed from closed to reopened

(In [30991]) Revert r30987 - api doc regression caused by mis-merge

Reopens #4580

comment:16 Changed 4 years ago by exarkun

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [30992]) Merge convert-SenderProtocol-4580-2

Author: cyli
Reviewer: therve
Fixes: #4580

Add IFinishableConsumer to the ftp module, the only user of it, so that it can
be removed from the more general twisted.internet.interfaces module.

This commit should actually properly merge the branch, instead of a random
older revision of it.

Note: See TracTickets for help on using tickets.