Hi guys,
Been battling with trying to create an output extension today, and am having real trouble with the script I'm trying to call not having parameters that I've got in the command bit of the inx being passed to it. my inx has the following
<?xml version="1.0" encoding="UTF-8"?> <inkscape-extension xmlns=" http://www.inkscape.org/namespace/inkscape/extension"> <_name>gmail file storage</_name> <id>org.ekips.output.gml</id> <dependency type="extension">org.inkscape.output.svg.inkscape</dependency> <dependency type="executable" location="extensions">gecp_ink.py</dependency> <output> <extension>.svg</extension> <mimetype>image/svg</mimetype> <_filetypename>Write svg to a gmail account(*.svg)</_filetypename> <_filetypetooltip>Export to a gmail account</_filetypetooltip> <dataloss>false</dataloss> </output> <script> <command reldir="extensions" interpreter="python">gecp_ink.py username:Inkscape_Files password</command> </script> </inkscape-extension>
The script expects the username as arg 1, password as 2 and the filename as 3.
all its getting is the temp filename. Anyone got any ideas why?
Also any suggestions for asking for a user/pass combo in a secure way?
Cheers
John
john cliff wrote:
The script expects the username as arg 1, password as 2 and the filename as 3.
all its getting is the temp filename. Anyone got any ideas why?
Yes, we're calling in a way that explicitly sets the parameters to the function. So I would imagine if you look at argv[0] you'd see your username and password in there separated by a space, just as in the INX file.
There are some other ways to handle this. I don't remember if this was for 0.46, but parameters can be hidden from the GUI so that they can be in the INX file and no show up to the user when running the script. That'd be a better way to pass them.
You call also do a wrapper script.
Also any suggestions for asking for a user/pass combo in a secure way?
Username/password and secure change things a lot. I would say probably the best way would to be implementing your own preferences dialog. I've wanted to implement for a long time (I swear I'm doing it shortly) a way that a second script can be set in the INX file such that it would be used to get the preferences if the script didn't want to use AutoGUI. That's the only secure way I can think of.
--Ted
2008/8/23 Ted Gould <ted@...11...>
john cliff wrote:
The script expects the username as arg 1, password as 2 and the filename as 3.
all its getting is the temp filename. Anyone got any ideas why?
Yes, we're calling in a way that explicitly sets the parameters to the function. So I would imagine if you look at argv[0] you'd see your username and password in there separated by a space, just as in the INX file.
Nope, sys.argv[0] gives the script path, and just it. all the bits other than the script name itself are getting dropped.
sys.arg[1] gives the filename.
There are some other ways to handle this. I don't remember if this was for 0.46, but parameters can be hidden from the GUI so that they can be in the INX file and no show up to the user when running the script. That'd be a better way to pass them.
You call also do a wrapper script.
Also any suggestions for asking for a user/pass combo in a secure way?
Username/password and secure change things a lot. I would say probably the best way would to be implementing your own preferences dialog. I've wanted to implement for a long time (I swear I'm doing it shortly) a way that a second script can be set in the INX file such that it would be used to get the preferences if the script didn't want to use AutoGUI. That's the only secure way I can think of.
--Ted
have you tried declaring a textbox parameter, as in :
hmm, something got lost there, maybe it didn't like the brackets in there:
have you tried declaring a textbox parameter, as in :
param name="filename" type="string" _gui-text="File Name "
Thanks Alvin, thats working quite nicely.
2008/8/24 Alvin Penner <penner@...1856...>
hmm, something got lost there, maybe it didn't like the brackets in there:
have you tried declaring a textbox parameter, as in :
param name="filename" type="string" _gui-text="File Name "
-- View this message in context: http://www.nabble.com/extension-parameters-tp19127357p19129822.html Sent from the Inkscape - Dev mailing list archive at Nabble.com.
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (3)
-
Alvin Penner
-
john cliff
-
Ted Gould