Re: [Repoze-dev] Problems with repoze.sphinx.autointerface

2009-07-08 Thread Thomas Lotze
Tres Seaver wrote:

> I just released version 0.2, whicn now requires Sphinx >= 0.6.1.

Wow, that was fast. Thank you very much.

-- 
Thomas



___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Problems with repoze.sphinx.autointerface

2009-07-08 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas Lotze wrote:
> Tres Seaver wrote:
> 
>> I haven't had a chance to look at it, and likely won't have for a bit. I
>> would be glad to apply a patch and release a new version, if that would
>> help.
> 
> Actually, the immediate reason for the registration of the directive to
> break seems to have been fixed on the trunk back in May. Therefore, just
> cutting a bug-fix release would be very helpful.
> 
>> I do know that newer versions of Sphinx are supposed to provide some
>> additional support for plugins like autointerface:  the release notes for
>> 0.6[1] say:
>>
>>  Autodoc now has a reusable Python API, which can be used to create custom
>>  types of objects to auto-document (e.g. Zope interfaces). See also
>>  Sphinx.add_autodocumenter().
> 
> OK, I've taken a glance at this, and it looks rather like a rewrite of the
> whole thing. I think I'd like to have that, so I might find some time for
> it at some point, but certainly not right away. Thank you for the pointer,
> anyway.

I just released version 0.2, whicn now requires Sphinx >= 0.6.1.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKVRSq+gerLs4ltQ4RAqvlAKCXksx6I24MOdWT9dsNt5zjff42dQCggr5+
G+nerLRIEr2p01OGYuo3YiA=
=eLUd
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Problems with repoze.sphinx.autointerface

2009-07-08 Thread Thomas Lotze
Tres Seaver wrote:

> I haven't had a chance to look at it, and likely won't have for a bit. I
> would be glad to apply a patch and release a new version, if that would
> help.

Actually, the immediate reason for the registration of the directive to
break seems to have been fixed on the trunk back in May. Therefore, just
cutting a bug-fix release would be very helpful.

> I do know that newer versions of Sphinx are supposed to provide some
> additional support for plugins like autointerface:  the release notes for
> 0.6[1] say:
> 
>  Autodoc now has a reusable Python API, which can be used to create custom
>  types of objects to auto-document (e.g. Zope interfaces). See also
>  Sphinx.add_autodocumenter().

OK, I've taken a glance at this, and it looks rather like a rewrite of the
whole thing. I think I'd like to have that, so I might find some time for
it at some point, but certainly not right away. Thank you for the pointer,
anyway.

-- 
Thomas



___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Problems with repoze.sphinx.autointerface

2009-07-08 Thread Thomas Lotze
Tres Seaver wrote:

> I haven't had a chance to look at it, and likely won't have for a bit. I
> would be glad to apply a patch and release a new version, if that would
> help.

OK, I'll try to come up with one.

-- 
Thomas



___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Problems with repoze.sphinx.autointerface

2009-07-08 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas Lotze wrote:
> Alec Munro wrote:
> 
>> Seems this depends on docutils 0.5, as when used with docutils 0.4, it
>> tries to import Directive from docutils.parsers.rst. Which isn't there.
>>
>> Upon updating docutils, it seems like it may not like sphinx 0.6.1. On
>> line 112, it calls:
>>
>> app.add_directive('autointerface', AutoInterfaceDirective,
>>   0, (1, 0, 1) )
>>
>> Which results in sphinx complaining:
>>
>> "when adding directive classes, no additional arguments may be given"
> [...]
> 
> What has become of this? The same issue is biting me as well...

I haven't had a chance to look at it, and likely won't have for a bit.
I would be glad to apply a patch and release a new version, if that
would help.

I do know that newer versions of Sphinx are supposed to provide some
additional support for plugins like autointerface:  the release notes
for 0.6[1] say:

 Autodoc now has a reusable Python API, which can be used to create
 custom types of objects to auto-document (e.g. Zope interfaces). See
 also Sphinx.add_autodocumenter().

but I haven't had a chance to figure that out yet, either.

]1] http://sphinx.pocoo.org/changes.html#release-0-6-mar-24-2009


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKVKtV+gerLs4ltQ4RAi08AKCa1NCpTQOxmj2087HHdhGdicTghACfSccd
G3gF3hn0eebYYREGyIzTqGY=
=H3/R
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Problems with repoze.sphinx.autointerface

2009-07-07 Thread Thomas Lotze
Alec Munro wrote:

> Seems this depends on docutils 0.5, as when used with docutils 0.4, it
> tries to import Directive from docutils.parsers.rst. Which isn't there.
> 
> Upon updating docutils, it seems like it may not like sphinx 0.6.1. On
> line 112, it calls:
> 
> app.add_directive('autointerface', AutoInterfaceDirective,
>   0, (1, 0, 1) )
> 
> Which results in sphinx complaining:
> 
> "when adding directive classes, no additional arguments may be given"
[...]

What has become of this? The same issue is biting me as well...

-- 
Thomas



___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] Problems with repoze.sphinx.autointerface

2009-05-28 Thread Alec Munro
Seems this depends on docutils 0.5, as when used with docutils 0.4, it
tries to import Directive from docutils.parsers.rst. Which isn't
there.

Upon updating docutils, it seems like it may not like sphinx 0.6.1. On
line 112, it calls:

app.add_directive('autointerface', AutoInterfaceDirective,
  0, (1, 0, 1) )

Which results in sphinx complaining:

"when adding directive classes, no additional arguments may be given"

add_directive comes from sphinx's application.py, and usage is here:

http://sphinx.pocoo.org/ext/appapi.html#sphinx.application.Sphinx.add_directive

What seems to be the relevant portion is:

--

There are two possible ways to write a directive:

In the docutils 0.4 style, func is the directive function. content,
arguments and options are set as attributes on the function and
determine whether the directive has content, arguments and options,
respectively.

In the docutils 0.5 style, directiveclass is the directive class. It
must already have attributes named has_content, required_arguments,
optional_arguments, final_argument_whitespace and option_spec that
correspond to the options for the function way. See the Docutils docs
for details.

The directive class normally must inherit from the class
docutils.parsers.rst.Directive. When writing a directive for usage in
a Sphinx extension, you inherit from sphinx.util.compat.Directive
instead which does the right thing even on docutils 0.4 (which doesn’t
support directive classes otherwise).

---

So I'm not sure how this ever worked, as it seems that it requires
docutils 0.5, but it uses the docutils 0.4 usage of add_directive.
Commenting out the additional parameters to add_directive seems to
solve it. It might also be solved by inheriting from
sphinx.util.compat.Directive, if you have not already installed
docutils 0.5.

Once installed, awesome!

Except that if you use autointerface like autoclass, and pass in a
relative class (which would be convenient), it raises a ValueError,
which is not caught and converted to a Sphinx warning, the way
IndexError and AttributeError are.

Lines 29-36 of autointerface.py:

def _buildLines(self):
try:
iface = _resolve_dotted_name(self.name)
except (ImportError, AttributeError):#, ValueError):
return [self.state.document.reporter.warning(
'autointerface can\'t import/find %r: \n'
'please check your spelling and sys.path' %
str(self.name), line=self.lineno)]

Adding ValueError to that list, it does get converted properly, and is
returned from _buildLines, however, there is a subsequent exception
generated, where Sphinx complains:

Exception occurred:
  File 
"c:\python25\lib\site-packages\docutils-0.5-py2.5.egg\docutils\statemachine.py",
line 434, in match
return pattern.match(self.line)
TypeError: expected string or buffer

(Note that this also occurs if you misspell the the interface path)

I don't have time to debug this any further, but I thought it would be
useful information.

Finally, thanks! autointerface is probably going to save me almost as
much time today as I took debugging it (and much more in the long
run). :)

Alec
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev