[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings in a filter
From: |
Bernhard Herzog |
Subject: |
Re: Warnings in a filter |
Date: |
25 Feb 2003 21:15:37 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 |
Antoon Pardon <address@hidden> writes:
> What is the best way to give a warning in a sketch filter.
>
> Some format don't allow for all the possibilities available
> in sketch. What would be the best way to give the user
> a warning when the users has a design with such facilities
> that he wants to export?
The import filters have a warning mechanism with the add_message method.
Export filter don't have that, though.
For export filters it's probably best to implement something similar to
the add_message method which just accumulates all the warnings generated
during the export and at the end to call
Sketch.warn.warn(USER, complete_message)
with complete_message being an aggregate of all messages (see
Sketch/Base/load.py for the implementation of add_message and the
Messages method which creates a aggregated message).
The necessary import statement should be something like
from Sketch.warn import warn, USER
Bernhard
--
Intevation GmbH http://intevation.de/
Sketch http://sketch.sourceforge.net/
MapIt! http://www.mapit.de/