Guenter Milde | 1 Sep 2011 10:23
Picon

Re: Test suite failure

On 2011-08-31, Bill Thayer wrote:

Dear Bill,

thanks for your test report.

The test passes here (Linux with locale ('de_DE', 'UTF8')).
Unfortunately, I cannot try with
> Microsoft Windows XP

The test failure 

> AssertionError: u'Dornr\xf7schen' != u'Dornr\xf6schen'

might indicate a bug in Docutils or it could be a false
positive.

Could you start rst2html.py from the command line (DOS prompt) with the
option --title=Dornröschen and see if the title is correctly set

 Dornröschen with Character 'ö' (246, 0xF6) LATIN SMALL LETTER O WITH DIAERESIS

or becomes

 Dornr÷schen with Character '÷' (247, 0xF7) DIVISION SIGN

as indicated by the test.

Also I might need to know the "locale" setting.

(Continue reading)

BRIAN, Paul | 2 Sep 2011 19:19

function or otherwise to convert a ReSt table into python dict

All

(Sorry this got longer than I planned)

I would like to ask a question of the list.  I have been a long time
front end user of docutils (thank you!)
but just realised I have a need for deeper digging.  Gmane and a quick
grep seem not to give me the answer.

I want to use docutils to allow me to store data as nice tabular format,
but be able to parse that string in docutils 
and get out a usable python object (not a docutils object).  For example
I would like to take

input = """
==== ====
test feed
==== ====
A     B
C     D
==== ===="""

and get

[
{'test':'A', 'feed':'B'},
{'test':'C', 'feed':'D'},
]

I have tried the following (I brute forced the optparse.Values.  FOr
(Continue reading)

Terry Brown | 2 Sep 2011 23:38
Picon
Favicon
Gravatar

Re: function or otherwise to convert a ReSt table into python dict

On Fri, 2 Sep 2011 18:19:10 +0100
"BRIAN, Paul" <paul.brian <at> bupa.com> wrote:

> I want to use docutils to allow me to store data as nice tabular format,
> but be able to parse that string in docutils 
> and get out a usable python object (not a docutils object).

If I wanted to get something like that done in a hurry I'd convert text
to html with docutils, read the html with lxml, and use some python
code to grind the table into a dict using xpath.

I would think your approach should work, just depends whether you're
more comfortable digging in to docutils or using lxml.  Obviously
you've already started the former.

Cheers -Terry

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
engelbert gruber | 6 Sep 2011 13:20
Picon
Gravatar

Re: function or otherwise to convert a ReSt table into python dict

one could use csv tables ?

On Fri, Sep 2, 2011 at 11:38 PM, Terry Brown <terry_n_brown <at> yahoo.com> wrote:
> On Fri, 2 Sep 2011 18:19:10 +0100
> "BRIAN, Paul" <paul.brian <at> bupa.com> wrote:
>
>> I want to use docutils to allow me to store data as nice tabular format,
>> but be able to parse that string in docutils
>> and get out a usable python object (not a docutils object).
>
> If I wanted to get something like that done in a hurry I'd convert text
> to html with docutils, read the html with lxml, and use some python
> code to grind the table into a dict using xpath.
>
> I would think your approach should work, just depends whether you're
> more comfortable digging in to docutils or using lxml.  Obviously
> you've already started the former.
>
> Cheers -Terry
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Docutils-users mailing list
> Docutils-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/docutils-users
(Continue reading)

David Goodger | 6 Sep 2011 15:46
Favicon

Re: function or otherwise to convert a ReSt table into python dict

On Fri, Sep 2, 2011 at 13:19, BRIAN, Paul <paul.brian <at> bupa.com> wrote:
> All
>
> (Sorry this got longer than I planned)
>
> I would like to ask a question of the list.  I have been a long time
> front end user of docutils (thank you!)
> but just realised I have a need for deeper digging.  Gmane and a quick
> grep seem not to give me the answer.
>
> I want to use docutils to allow me to store data as nice tabular format,
> but be able to parse that string in docutils
> and get out a usable python object (not a docutils object).  For example
> I would like to take
>
> input = """
> ==== ====
> test feed
> ==== ====
> A     B
> C     D
> ==== ===="""
>
> and get
>
> [
> {'test':'A', 'feed':'B'},
> {'test':'C', 'feed':'D'},
> ]
>
(Continue reading)

Dan Green | 13 Sep 2011 17:22

Test suite failure

Hi,

System config:
dan <at> voldemort:~/docutils$ uname -a && ./tools/quicktest.py --v &&
python --version
    SunOS voldemort 5.11 snv_151a i86pc i386 i86pc Solaris
    quicktest.py (Docutils 0.9 [snapshot 2011-08-30, r7116])
    Python 2.6.4

Built docutils so I could build the full Mercurial source including man pages.

Everything seemed to compile ok, and hg works, but the man pages are
screwy so I ran the full test suite. Attached is the output of
"dan <at> voldemort:~/docutils$ ./test/alltests.py > ./test_results 2>&1"

Seems like this is a known bug on the Mercurial list:
http://mercurial.selenic.com/bts/issue2527 - not sure if it's docutils
or hg.

cheers
Dan
Attachment (test_results): application/octet-stream, 44 KiB
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
(Continue reading)

engelbert gruber | 15 Sep 2011 11:01
Picon
Gravatar

Re: Test suite failure

neither docutils nor mercurial

i see the same error on different pythons, on macosx python 2.6 (or
so) the error messages
are different. but it is one 2.6. subversion that brings up this
error, other 2.6 dont and other versions neither.

all the best
  engelbert

On Tue, Sep 13, 2011 at 5:22 PM, Dan Green <dan <at> green.name> wrote:
> Hi,
>
> System config:
> dan <at> voldemort:~/docutils$ uname -a && ./tools/quicktest.py --v &&
> python --version
>    SunOS voldemort 5.11 snv_151a i86pc i386 i86pc Solaris
>    quicktest.py (Docutils 0.9 [snapshot 2011-08-30, r7116])
>    Python 2.6.4
>
> Built docutils so I could build the full Mercurial source including man pages.
>
> Everything seemed to compile ok, and hg works, but the man pages are
> screwy so I ran the full test suite. Attached is the output of
> "dan <at> voldemort:~/docutils$ ./test/alltests.py > ./test_results 2>&1"
>
> Seems like this is a known bug on the Mercurial list:
> http://mercurial.selenic.com/bts/issue2527 - not sure if it's docutils
> or hg.
>
(Continue reading)

Ned Batchelder | 28 Sep 2011 16:24
Favicon
Gravatar

Using rest for more-structured content

Hi all,

I'm considering writing a Python tutorial site with embedded executable 
exercises.  I'd like to use ReST for the content, but I'm having trouble 
finding exemplars for the embedded exercises.  An exercise will have a 
number of components: name, starting code (often empty), supporting 
named files, instructor-supplied tests to run on the results, and so 
on.  If I were using XML, I'd use an <exercise> tag, with name="", 
<usercode>, <tests>, <file>, and so on sub-elements.

A single page of tutorial could of course have multiple exercises.

What would be the natural way to express something like this in ReST?  
I'd like to be able to process the result so that a page contains 
exercises, but also possibly, the exercises are available as standalone 
objects I could serve separately.  Hints as to how to go about extending 
docutils to handle the format would be appreciated also.

I'm not a subscriber to this list, so cc's are appreciated.

Thanks.

--Ned.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
(Continue reading)

Guenter Milde | 29 Sep 2011 10:46
Picon

Re: Using rest for more-structured content

On 2011-09-28, Ned Batchelder wrote:

> I'm considering writing a Python tutorial site with embedded executable 
> exercises.  I'd like to use ReST for the content, but I'm having trouble 
> finding exemplars for the embedded exercises.  An exercise will have a 
> number of components: name, starting code (often empty), supporting 
> named files, instructor-supplied tests to run on the results, and so 
> on.  If I were using XML, I'd use an <exercise> tag, with name="", 
><usercode>, <tests>, <file>, and so on sub-elements.

> A single page of tutorial could of course have multiple exercises.

> What would be the natural way to express something like this in ReST?  

> I'd like to be able to process the result so that a page contains 
> exercises, but also possibly, the exercises are available as standalone 
> objects I could serve separately.  Hints as to how to go about extending 
> docutils to handle the format would be appreciated also.

I don't think there is *one* "natural" way. Depending on the exact task,
I can imagine:

* Using Sphinx_ for the complete project. This would generate a
  complete "site", facilitate inter-document links and offers more
  configuration options (skipping elements with/without a special class
  argument value etc.)

  .. _Sphinx: http://sphinx.pocoo.org

* Separate files for every exercise. The tutorial would ``.. include::``
(Continue reading)

David Goodger | 29 Sep 2011 14:05
Favicon

Re: Using rest for more-structured content

Hi Ned,

In addition to Guenter's ideas, I suggest using the "container" directive [1]_::

    .. container:: exercise

       .. include:: exercise-file.py

In HTML you'll end up with <div class="exercise">, which you can style
as you'd like.

.. [1] http://docutils.sourceforge.net/docs/ref/rst/directives.html#container

-- David Goodger

On Wed, Sep 28, 2011 at 10:24, Ned Batchelder <ned <at> nedbatchelder.com> wrote:
> Hi all,
>
> I'm considering writing a Python tutorial site with embedded executable
> exercises.  I'd like to use ReST for the content, but I'm having trouble
> finding exemplars for the embedded exercises.  An exercise will have a
> number of components: name, starting code (often empty), supporting
> named files, instructor-supplied tests to run on the results, and so
> on.  If I were using XML, I'd use an <exercise> tag, with name="",
> <usercode>, <tests>, <file>, and so on sub-elements.
>
> A single page of tutorial could of course have multiple exercises.
>
> What would be the natural way to express something like this in ReST?
> I'd like to be able to process the result so that a page contains
(Continue reading)


Gmane