#1537 new defect

fix some Interface violations — at Initial Version

Reported by: warner Owned by: somebody
Priority: minor Milestone: soon
Component: code Version: 1.9.0a1
Keywords: interface cleanup Cc:
Launchpad Bug:

Description

David-Sarah ran a script (in #1474) and found a list of places where classes that claim to implement some Interface don't in fact do it correctly. Here's the list and a quick note about what I think should be done about each:

  • foolscap.slicer.BaseUnslicer does not correctly implement foolscap.tokens.IUnslicer: The 'where' method was not provided.
    • ISTR BaseUnslicer.where is purely abstract, meant to be overridden by subclasses. Not sure if that makes it easier to remove the IUnslicer annotation from BaseUnslicer (and add it to all subclasses, which is kinda verbose), or to add a dummy method to BaseUnslicer (which throws NotImplementedError if ever called, and maybe a tiny test to keep that line of code exercised so the coverage metrics don't drop :)
  • foolscap.slicers.root.RootSlicer does not correctly implement foolscap.tokens.ISlicer: The implementation of slice violates its contract because implementation doesn't allow enough arguments.
    • I think (but not sure) RootSlicer.slice is never called.. it should probably be modified to match signatures with tokens.ISlicer and also throw an error if ever called, just to be sure
  • foolscap.referenceable.Referenceable does not correctly implement foolscap.ipb.IRemotelyCallable: The 'getInterfaceNames' method was not provided.
    • getInterfaceNames() looks like it's misspelled in ipb.py (should be singular, not plural)
  • foolscap.referenceable.RemoteReferenceOnly does not correctly implement foolscap.ipb.IRemoteReference: The 'callRemoteOnly' method was not provided. The 'callRemote' method was not provided.
    • IRemoteReference should be split, or moved: RemoteReferenceOnly isn't supposed to have callRemote/callRemoteOnly
  • allmydata.codec.CRSEncoder does not correctly implement allmydata.interfaces.ICodecEncoder: The 'encode_proposal' method was not provided.
  • allmydata.immutable.encode.Encoder does not correctly implement allmydata.interfaces.IEncoder: The 'set_params' method was not provided. The 'set_size' method was not provided.
    • IEncoder should probably be split into two interfaces (one for CRSEncoder with set_params/set_size, the rest for the higher-level encode.Encoder)
  • allmydata.immutable.offloaded.LocalCiphertextReader does not correctly implement allmydata.interfaces.IEncryptedUploadable: The 'set_upload_status' method was not provided.
    • should probably be implemented
  • allmydata.immutable.literal.LiteralProducer does not correctly implement twisted.internet.interfaces.IPushProducer: The 'pauseProducing' method was not provided.
    • should be implemented

Change History (1)

Changed at 2011-10-03T19:55:11Z by davidsarah

immutable/literal.py: add pauseProducing method to LiteralProducer?. refs #1537

Note: See TracTickets for help on using tickets.