Thanks!
Now my import plugin works fine, imports datetime, and constants too!

Only a little more question, my return statement now is something like this:
rerturn [ImportConstant(...bla bla...] + [datasetplugin.DatasetDateTime(columnNames[0],data[0])]+ ...

the ImportConstant() method in the future will become datasetplugin.Constant() or it will not change?


Valerio.

On 08/09/2011 20:24, Jeremy Sanders wrote:
[email protected] 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
[email protected]
https://mail.gna.org/listinfo/veusz-discuss


_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à