New submission from Krys Lawrence <k...@krys.ca>:

Hi there,

I have created a patch that makes repoze.sphinx.autointerface entries show up
automatically in Sphinx automodule listings.

I really like autointerface, but I use automodule in my docs and I wanted the
interfaces to show up as well.

The patch is against version autointerface 0.6.2, but works as far back as 0.4.
 It is a unified diff.  It has been tested under Sphinx 1.0.8 and earlier, but
not yet against 1.1.2.

I would love to see this included in the next release of autointerface, if you
find it worthy. :)

Thanks for making this great package! :)

----------
files: work_with_automodule.patch
messages: 523
nosy: krys
priority: feature
status: unread
title: [Patch] Have repoze.sphinx.autointerface interfaces included in Sphinx 
automudule listings.

__________________________________
Repoze Bugs <b...@bugs.repoze.org>
<http://bugs.repoze.org/issue183>
__________________________________
diff -r c51f33df2e23 repoze/sphinx/autointerface.py
--- a/repoze/sphinx/autointerface.py	Sun Feb 12 18:54:23 2012 -0500
+++ b/repoze/sphinx/autointerface.py	Mon Feb 13 23:19:43 2012 -0500
@@ -8,6 +8,7 @@
     from sphinx.domains.python import PyClasslike
 from sphinx.ext import autodoc
 from zope.interface import Interface
+from zope.interface.interface import InterfaceClass
 
 class InterfaceDesc(PyClasslike):
     def get_index_text(self, modname, name_cls):
@@ -28,8 +29,7 @@
 
     @classmethod
     def can_document_member(cls, member, membername, isattr, parent):
-        return isinstance(member, types.ClassType) and \
-                issubclass(member, Interface)
+        return isinstance(member, InterfaceClass)
 
     def add_directive_header(self, sig):
         if self.doc_as_attr:
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to