← Back to team overview

zim-wiki team mailing list archive

writing plugins

 

hi people,
it is a bit of time since I'm thinking about trying to write some simple plugin - to start with, I wanted to try with an <insert GNUplot plot>, since I prefer GNUplot in place of R. I read in the manual to check the HACKING directory, and I tried to follow the code in gnu_r_ploteditor.py to take it as example. I don't know if it is me, but I probably lack a good understanding of the basics. I have in gnuplot_ploteditor.py three classes (InsertGNUPlotPlugin, InsertPlotDialog, PlotGenerator), I have a template _gnuplot.gnu in place, and I have basically changed gnu_r_ploteditor.py as less as possible, just to call gnuplot instead of R. In Zim I have now a Insert->GNUplot option, which calls up an insert window. But any code I use inside it returns a "Looks like you found a bug" window, telling me "AttributeError: 'NoneType' object has no attribute 'basename' "

Of course you have better things to do than lead me by the hand thru Python development, but - since the HACKING folder is a bit lacking - could you tell me exactly what is expected from a zim plugin, in terms of defined classes etc?
Also, what you do suggest as tricks to debug it?

Thank you!


alessandro


--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/  Dr.Alessandro Magni
\        Electromagnetics Division
/        INRiM Strada delle Cacce 91, 10135 Torino (ITALIA)
\        Email magni@xxxxxxxx
/        Tel: 0039-011-3919821  Fax: 0039-011-3919834
\        URL http://www.inrim.it/~magni
/ Our business in life is not to succeed but to continue to fail
\ in high spirits.  -- Robert Louis Stevenson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Follow ups