[tahoe-lafs-trac-stream] [tahoe-lafs] #1537: fix some Interface violations

tahoe-lafs trac at tahoe-lafs.org
Thu Dec 20 16:42:33 UTC 2012


#1537: fix some Interface violations
------------------------+-------------------------------
     Reporter:  warner  |      Owner:  davidsarah
         Type:  defect  |     Status:  assigned
     Priority:  minor   |  Milestone:  1.11.0
    Component:  code    |    Version:  1.9.0a1
   Resolution:          |   Keywords:  interface cleanup
Launchpad Bug:          |
------------------------+-------------------------------
Changes (by davidsarah):

 * milestone:  1.10.0 => 1.11.0


Old 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
>
> *
> [source:git/src/allmydata/codec.py?annotate=blame&rev=b315619d6b3e5f20015213eb2941205f6abbb0e2#L10
> allmydata.codec.CRSEncoder] does not correctly implement
>   allmydata.interfaces.ICodecEncoder: The
> [source:git/src/allmydata/interfaces.py?annotate=blame&rev=cf9bf2ea10f8043f910de971f5a736a9d9bced21#L1373
> 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

New 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

 *
 [source:git/src/allmydata/codec.py?annotate=blame&rev=b315619d6b3e5f20015213eb2941205f6abbb0e2#L10
 allmydata.codec.CRSEncoder] does not correctly implement
   allmydata.interfaces.ICodecEncoder: The
 [source:git/src/allmydata/interfaces.py?annotate=blame&rev=cf9bf2ea10f8043f910de971f5a736a9d9bced21#L1373
 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

--

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1537#comment:11>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list