Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue12947] Examples in library/doctest.html lack the flags

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Apr 18, 2012, 1:55 AM

Post #1 of 5 (105 views)
Permalink
[issue12947] Examples in library/doctest.html lack the flags

Stefano Taschini <taschini [at] ieee> added the comment:

Concrete examples can be seen in the section

http://docs.python.org/library/doctest.html#option-flags-and-directives

For instance at

http://docs.python.org/library/doctest.html#doctest.IGNORE_EXCEPTION_DETAIL

The doctest flags present in the sources in

http://docs.python.org/_sources/library/doctest.txt

are all stripped.

----------
nosy: +taschini

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue12947>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 18, 2012, 6:52 AM

Post #2 of 5 (119 views)
Permalink
[issue12947] Examples in library/doctest.html lack the flags [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

Thank you. I think it’s clear that for the docs of the doctest flags we need to display snippets with the flags.

----------
resolution: invalid ->
stage: committed/rejected -> test needed
status: closed -> open

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue12947>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 19, 2012, 7:32 AM

Post #3 of 5 (100 views)
Permalink
[issue12947] Examples in library/doctest.html lack the flags [In reply to]

Stefano Taschini <taschini [at] ieee> added the comment:

As far as I can see, Sphinx has a global setting for trim_doctest_flags but lacks the possibility of locally disabling the trimming.

A quick workaround would be to have the following sphinx extension added:

class ProxyLexer(object):

def __init__(self, underlying):
self.__underlying = underlying

def __getattr__(self, attr):
return getattr(self.__underlying, attr)

def setup(app):
from sphinx.highlighting import lexers
if lexers is not None:
lexers['pycon-literal'] = ProxyLexer(lexers['pycon'])
lexers['pycon3-literal'] = ProxyLexer(lexers['pycon3'])

That would allow blocks marked as

.. code-block:: pycon-literal

or preceded by

.. highlight:: pycon-literal

to escape the trimming of doctest flags.

If that's of any interest I can submit a patch.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue12947>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 29, 2012, 2:25 AM

Post #4 of 5 (94 views)
Permalink
[issue12947] Examples in library/doctest.html lack the flags [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

Is there a way to add a :keep-doctest-flags: options to literal blocks?

----------
stage: test needed -> needs patch
type: -> enhancement

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue12947>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 30, 2012, 7:15 AM

Post #5 of 5 (93 views)
Permalink
[issue12947] Examples in library/doctest.html lack the flags [In reply to]

Stefano Taschini <taschini [at] ieee> added the comment:

Ezio, the patch I attached goes into that direction, by adding a ":trim-doctest-flags: disable" option to the code blocks.

I thought I had a good reason for having the option worded as ":trim-doctest-flags: disable" instead of ":keep-doctest-flags:", now I'm not so sure.

Note: the patch is against the 2.7 branch.

----------
keywords: +patch
Added file: http://bugs.python.org/file25424/issue12947_v0.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue12947>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.