[redland-dev] Suppressing parser warnings from Python
Ryan Shaw
ryanshaw at unc.edu
Sat Jun 11 15:28:31 CEST 2011
Great, thank you. I've been using parser.parse_as_stream so I didn't
notice that the model-based methods support error handling.
On Fri, Jun 10, 2011 at 10:24 PM, Dave Beckett <dave at dajobe.org> wrote:
> On 6/10/11 3:28 PM, Ryan Shaw wrote:
>> Hello,
>>
>> Is there any way to suppress Raptor's parser warnings when using the
>> Python bindings?
>>
>> I was hoping that
>>
>> import warnings
>> warnings.filterwarnings('ignore')
>>
>> would do the trick, but no such luck.
>
> You can set your own error handler with the handler option on the
> model.parse_into_model, model.load methods, model.parse_string_into_model
>
> Docs say:
> If handler is given, an error handler with the signature
> def handler(code, level, facility, message, line, column, byte,
> file, uri)
> is called.
>
> then you can choose what to do with the warnings - in this case, ignore them
>
> Dave
>
More information about the redland-dev
mailing list