← Back to team overview

zim-wiki team mailing list archive

Re: writing plugins


Hi alessandro, 

(sorry for the PM, last mail should go to the mailinglist)

your code seems to be ok.  But you need a template to the gnuplot code
in data/templates/_gnuplot.gnu. I attached a template[1] that should work.

best regards,

[1] I do not know gnuplot, maybe there are better commands to produce a
png file.

On Thu, Feb 10, 2011 at 01:30:16PM +0100, Alessandro Magni wrote:
> On 02/10/2011 10:07 AM, smu@xxxxxxx wrote:
>> Hi alessandro,
>> you could post the code of your plugin, then it would be easier to
>> identify your bug. It sound as if a File object is expected somewhere
>> but None is returned and the basename function fails.
>> Does the preview function display your plot correctly? I get the same
>> exception (with the gnu_r_plugin), when I enter incorrect R code, press
>> OK and close the following 'An error occured...' dialog with yes.
>> best regards,
>>   stefan
>> On Thu, Feb 10, 2011 at 09:13:00AM +0100, Alessandro Magni wrote:
>>> 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
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~zim-wiki
>>> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~zim-wiki
>>> More help   : https://help.launchpad.net/ListHelp

Follow ups