Re: dia barfing on valid xml input



Am 01.05.2008 17:13, Aaron Trevena schrieb:
2008/5/1 Hans Breuer <hans breuer org>:
 Yes. And there is one importer registering for xml now : doxml.py.
 So the automatic detection does not pick-up the one you want. If you call
 your file filename.dia that would certainly help.

That fixes it, but is definately a workaround rather than solution.

I knew you would say this ;-)

 Formerly there was no importer registering for xml so you cgot the Dia
 format reader by fallback.

May I politely suggest checking the namespace of an xml file before
deciding which importer to use, failing that a graceful fallback would
be to revert to previous behaviour if using the python importer breaks
rather than barfing on a valid file because of the extension.

Sure you can. I would probably even accept a patch doing this.
But I'm not sure how this approach would fit into Dia's plug-in architecture, i.e. where to place it. So for the moment I've commited something which has the same user-visible effect and also solves some other imprter related issues:

2008-05-02  Hans Breuer  <hans breuer org>

        * lib/filter.[hc] : introduce the ability to influence guessing of
        import/export -filters. If one is marked as FILTER_DONT_GUESS it is
        only selected by the guessing if it is the only one registering a
        certain extension
        * lib/plug-in.h : increase DIA_PLUGIN_API_VERSION
        * plug-ins/python/diamodule.c : set FILTER_DONT_GUESS for all
        filters implemented in Python
        * plug-ins/pixbuf/pixbuf.c : set FILTER_DONT_GUESS for vector
        formats supported by GdkPixbuf. This way a Dia importer capable
        to process vectors gets preferred


-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]