inx with notebook problem, help please

Discussion about writing code for Inkscape.
elliot.white
Posts: 7
Joined: Sun Oct 09, 2011 9:17 am

inx with notebook problem, help please

Postby elliot.white » Thu May 07, 2015 4:10 am

I have written several inkscape extensions but only now have I tried to use tabs using the "notebook" type in the inx file.

The problem is that with a single page the parameters are correctly passed to the python script,
but with a tabbed page (i.e using param with type="notebook") I get strange errors:

test.py: error: no such option: --some_name

Where does "some_name" come from?

I have searched for many hours for some clue as to what is going wrong but have failed to find a solution,
any help would be most welcome.

cheers, elliot.

elliot.white
Posts: 7
Joined: Sun Oct 09, 2011 9:17 am

Re: inx with notebook problem, help please

Postby elliot.white » Thu May 07, 2015 5:07 am

I have found a workaround, for some reason the xml parser treats the type="notebook" option i.e

<param name="tabb" type="notebook">

as a parameter to pass to the script like other <option> tags.

The workaround involves reading the parameter into the script (python):

self.OptionParser.add_option('--tabb',action='store',type='string', dest='tabb',default='')

cheers, elliot.

PS
thanks to pgarciat for his INX parser.


Return to “Programming”