Redirecting Ply error messages

104 views
Skip to first unread message

Steve Garland

unread,
Jan 14, 2013, 2:37:33 PM1/14/13
to ply-...@googlegroups.com
I am using Ply to parse information supplied to an HTML form. Is there some way
to have Ply append error messages to a list from which they can be retrieved by
the Python script I use to process the form? Since the HTML form and the Python
script will be hosted on a machine that is not under my control, I would prefer
not to use Ply's logging interface to write error messages to a log file.

David Beazley

unread,
Jan 14, 2013, 3:26:08 PM1/14/13
to ply-...@googlegroups.com, David Beazley
The whole reason for using the logging interface is to make it something that could be completely customized in various ways. To accomplish what you suggest, simply make a class that implements the basic logging interface and stores the messages in a list. You should be able to pass your object into Ply using the debug or errorlog arguments to various functions such as yacc() or parse().

Cheers,
Dave
> --
> You received this message because you are subscribed to the Google Groups "ply-hack" group.
> To post to this group, send email to ply-...@googlegroups.com.
> To unsubscribe from this group, send email to ply-hack+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages