mimisa...@gmail.com wrote:

> I tried also to return a constant from the import plugin (using the
> development version in the repository) but probably something was wrong
> in my code, because I got an error.
> My code for the import plugin is:
>     def doImport(self, params):
>          #bla bla bla
>          return [ImportConstant("constName","10")]

Thanks - I've fixed the code in the development tree. The import dialog also 
prints returned constants/functions.
 
> Doing my trials I noticed two things:
> 1.
> In the on-line manual the documentation for AddCustom says:
> AddCustom(name, type, value) but I think It should be AddCustom(type,
> name, value)

Correct - I've fixed the docs. I should get the API docs out of the Python 
docstrings, but I haven't done this yet.

> 2.
> I was a bit silly, but writing my importplugin I used a string with a
> whitespace ("Split Datasets") as the "name" of an ImportFieldCheck. The
> plugin worked well, but when I saved the document containing the
> imported data, and tried to reopen it I got an error, because of this
> line of document:
>      ImportFilePlugin(u'MUSP furnace import plugin',
> u'2011-05-10_Spezzone 04.txt', linked=True, encoding='latin_1',
> name=u'name', split Datasets=False)
> The problem is that my "Split Dataset" is not a valid variable name, it
> is not a bug. In my opinion it could be useful to add a note in the
> documentation of the importfields explaining that the string "name" has
> to be a valid variable name.

Good idea. Feel free to update the wiki. I'll do it later when I remember.

Thanks

Jeremy





_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss

Répondre à