Hi folks,

I'm trying to catch the docutils error within Leo, and have added this 
to the node:  writeToDocutils (sets argv)

                g.es('--stylesheet=%s' % path)
                try:
                    res = pub.publish(argv=['--stylesheet=%s' % path])
                except Exception, inst:
                    print type(inst)     # the exception instance
                    print inst.args      # arguments stored in .args
                    print inst           # __str__ allows args to 
printed directly
                    raise inst

However, I can't seem to catch that publish error (I think it's a 
SystemExit error).

Anybody know of a way to do this?  If I run docutils from the command 
line, I get:

docutils.utils.SystemMessage: <string>:376: (SEVERE/4) Title level 
inconsistent:

I'd love a way to capture that error message and display it somehow.

TIA
Mike

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to