Tavmjong Bah wrote:
Could you take a look at the Function Plotter effect? It has got lots of problems which I can't figure out (it was working at the beginning of 0.46 development). It seems to me that all the parameters on the Range and Sampling tab are not working.
It appears to be a problem the command line parsing. The command line passed to the script looks sorta like like (from ' '.join(sys.argv)):
share\extensions\funcplot.py C:\DOCUME~1\NS\LOCALS~1\Temp\ink_ext_XXXXXX.svgVNX14T --id=rect2363 --tab="sampling" --xstart=-50 --xend=20 --times2pi=true --ybottom=-11.600000381469727 --ytop=24.600000381469727 --samples=180 --isoscale=false --polar=false --funcplotuse= --pythonfunctions= --fofx=sin(-x) --fponum=true --fpofx=x --remove=true --drawaxis=false
But Python parses it as:
['share\extensions\funcplot.py', 'C:\DOCUME~1\NS\LOCALS~1\Temp\ink_ext_XXXXXX.svgVNX14T', '--id=rect2363', '--tab="sampling" --xstart=-50 --xend=20 --times2pi=true --ybottom=-11.600000381469727 --ytop=24.600000381469727 --samples=180 --isoscale=false --polar=false --funcplotuse= --pythonfunctions=', '--fofx=sin(-x)', '--fponum=true', '--fpofx=x', '--remove=true', '--drawaxis=false']
And then optparse gets:
{'polar': False, 'ytop': 1.0, 'funcplotuse': '', 'drawaxis': False, 'fpofx': 'x', 'ybottom': -1.0, 'ids': ['rect2363'], 'remove': True, 'fofx': 'sin(-x)', 'pythonfunctions': '', 'isoscale': True, 'fponum': True, 'tab': '"sampling" --xstart=-50 --xend=20 --times2pi=true --ybottom=-11.600000381469727 --ytop=24.600000381469727 --samples=180 --isoscale=false --polar=false --funcplotuse= --pythonfunctions=', 'xstart': 0.0, 'xend': 1.0, 'times2pi': True, 'samples': 8}
But I think we need to put debug prints in Inkscape to see what the actual command line is that inkscape generates because when I give the same command line options to a simple python script like:
import sys print sys.argv
I get a properly parsed command line:
C:\Documents and Settings\NS\Desktop>cmd_parsing_test.py C:\DOCUME~1\NS\LOCALS~1\Temp\ink_ext_XXXXXX.svgVNX14T --id=rect2363 --tab="sampling" --xstart=-50 --xend=20 --times2pi=true --ybottom=-11.600000381469727 --ytop=24.600000381469727 --samples=180 --isoscale=false --polar=false --funcplotuse= --pythonfunctions= --fofx=sin(-x) --fponum=true --fpofx=x --remove=true --drawaxis=false ['C:\Documents and Settings\NS\Desktop\cmd_parsing_test.py', 'C:\DOCUME~1\NS\LOCALS~1\Temp\ink_ext_XXXXXX.svgVNX14T', '--id=rect2363 ', '--tab=sampling', '--xstart=-50', '--xend=20', '--times2pi=true', '--ybottom=-11.600000381469727', '--ytop=24.600000381469727', '--samples =180', '--isoscale=false', '--polar=false', '--funcplotuse=', '--pythonfunctions=', '--fofx=sin(-x)', '--fponum=true', '--fpofx=x', '--remove =true', '--drawaxis=false']
There must be some stray quotes somewhere. I also wonder why the temporary file is no longer the final argument to the script. I think this could screw up scripts with more primitive option parsing. It looks like the revision that I compiled here includes the .svg extension on the temp files. I never noticed that change. And lastly, can anyone tell me why "sampling" is quoted when it is passed to the script? I thought we had done something to address that.
Aaron Spike
On Fri, 2008-01-11 at 08:48 -0600, Aaron Spike wrote:
But I think we need to put debug prints in Inkscape to see what the actual command line is that inkscape generates because when I give the same command line options to a simple python script like:
We don't generate a command line anymore. It's a function call with parameter passed individually as a list. This is a direct call, so there is now shell f#$%$ing with the parameters.
So that's kinda what makes things odd to me, there is no parsing that should need to be done. Perhaps that's what the helper.exe's do in GTK +, turn everything back into command lines. I'd actually look at those to see how they handle the parameters. This may be a GTK+ win32 bug.
There must be some stray quotes somewhere. I also wonder why the temporary file is no longer the final argument to the script. I think this could screw up scripts with more primitive option parsing. It looks like the revision that I compiled here includes the .svg extension on the temp files. I never noticed that change. And lastly, can anyone tell me why "sampling" is quoted when it is passed to the script? I thought we had done something to address that.
I fixed the "over quoting" but I think that one is supposed to be quoted. Is it a string? I'm quoting all strings as they may have spaces in them.
--Ted
Ted Gould wrote:
On Fri, 2008-01-11 at 08:48 -0600, Aaron Spike wrote:
But I think we need to put debug prints in Inkscape to see what the actual command line is that inkscape generates because when I give the same command line options to a simple python script like:
We don't generate a command line anymore. It's a function call with parameter passed individually as a list. This is a direct call, so there is now shell f#$%$ing with the parameters.
So that's kinda what makes things odd to me, there is no parsing that should need to be done. Perhaps that's what the helper.exe's do in GTK +, turn everything back into command lines. I'd actually look at those to see how they handle the parameters. This may be a GTK+ win32 bug.
"On Windows, the low-level child process creation API (CreateProcess())doesn't use argument vectors, but a command line. The C runtime library's spawn*() family of functions (which g_spawn_async_with_pipes() eventually calls) paste the argument vector elements into a command line, and the C runtime startup code does a corresponding reconstruction of an argument vector from the command line, to be passed to main(). Complications arise when you have argument vector elements that contain spaces of double quotes. The spawn*() functions don't do any quoting or escaping, but on the other hand the startup code does do unquoting and unescaping in order to enable receiving arguments with embedded spaces or double quotes. To work around this asymmetry, g_spawn_async_with_pipes() will do quoting and escaping on argument vector elements that need it before calling the C runtime spawn() function."
http://www.gtk.org/api/2.6/glib/glib-Spawning-Processes.html#g-spawn-async-w...
What's that mean? If we put the filename on the right end of the list can we cause it to be the final argument passed the scripts?
Aaron Spike
On Fri, 2008-01-11 at 13:28 -0600, Aaron Spike wrote:
Ted Gould wrote:
On Fri, 2008-01-11 at 08:48 -0600, Aaron Spike wrote:
But I think we need to put debug prints in Inkscape to see what the actual command line is that inkscape generates because when I give the same command line options to a simple python script like:
We don't generate a command line anymore. It's a function call with parameter passed individually as a list. This is a direct call, so there is now shell f#$%$ing with the parameters.
So that's kinda what makes things odd to me, there is no parsing that should need to be done. Perhaps that's what the helper.exe's do in GTK +, turn everything back into command lines. I'd actually look at those to see how they handle the parameters. This may be a GTK+ win32 bug.
"On Windows, the low-level child process creation API (CreateProcess())doesn't use argument vectors, but a command line. The C runtime library's spawn*() family of functions (which g_spawn_async_with_pipes() eventually calls) paste the argument vector elements into a command line, and the C runtime startup code does a corresponding reconstruction of an argument vector from the command line, to be passed to main(). Complications arise when you have argument vector elements that contain spaces of double quotes. The spawn*() functions don't do any quoting or escaping, but on the other hand the startup code does do unquoting and unescaping in order to enable receiving arguments with embedded spaces or double quotes. To work around this asymmetry, g_spawn_async_with_pipes() will do quoting and escaping on argument vector elements that need it before calling the C runtime spawn() function."
http://www.gtk.org/api/2.6/glib/glib-Spawning-Processes.html#g-spawn-async-w...
What's that mean? If we put the filename on the right end of the list can we cause it to be the final argument passed the scripts?
Well, moving the file name shouldn't be a big deal. But I'm not sure about your other parsing issue. It sounds like on windows it does come down to a command line. FWIW we're using async_with_pipes.
--Ted
Ted Gould wrote:
On Fri, 2008-01-11 at 13:28 -0600, Aaron Spike wrote:
Ted Gould wrote:
On Fri, 2008-01-11 at 08:48 -0600, Aaron Spike wrote:
But I think we need to put debug prints in Inkscape to see what the actual command line is that inkscape generates because when I give the same command line options to a simple python script like:
We don't generate a command line anymore. It's a function call with parameter passed individually as a list. This is a direct call, so there is now shell f#$%$ing with the parameters.
So that's kinda what makes things odd to me, there is no parsing that should need to be done. Perhaps that's what the helper.exe's do in GTK +, turn everything back into command lines. I'd actually look at those to see how they handle the parameters. This may be a GTK+ win32 bug.
"On Windows, the low-level child process creation API (CreateProcess())doesn't use argument vectors, but a command line. The C runtime library's spawn*() family of functions (which g_spawn_async_with_pipes() eventually calls) paste the argument vector elements into a command line, and the C runtime startup code does a corresponding reconstruction of an argument vector from the command line, to be passed to main(). Complications arise when you have argument vector elements that contain spaces of double quotes. The spawn*() functions don't do any quoting or escaping, but on the other hand the startup code does do unquoting and unescaping in order to enable receiving arguments with embedded spaces or double quotes. To work around this asymmetry, g_spawn_async_with_pipes() will do quoting and escaping on argument vector elements that need it before calling the C runtime spawn() function."
http://www.gtk.org/api/2.6/glib/glib-Spawning-Processes.html#g-spawn-async-w...
What's that mean? If we put the filename on the right end of the list can we cause it to be the final argument passed the scripts?
Well, moving the file name shouldn't be a big deal. But I'm not sure about your other parsing issue. It sounds like on windows it does come down to a command line. FWIW we're using async_with_pipes.
Does this work properly on linux? I can't test right now because my linux box died last weekend. Is there anyway we can capture the command line on windows to get a better idea of what is actually happening?
Aaron
On Sun, 2008-01-13 at 16:21 -0600, Aaron Spike wrote:
Does this work properly on linux? I can't test right now because my linux box died last weekend. Is there anyway we can capture the command line on windows to get a better idea of what is actually happening?
Well, if you want I can send you a CD and you can start saying your Windows box died last weekend :)
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
--Ted
Ted Gould wrote:
Well, if you want I can send you a CD and you can start saying your Windows box died last weekend :)
I think I already have that CD. :-)
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Aaron
On Mon, 2008-01-14 at 08:23 -0600, Aaron Spike wrote:
Ted Gould wrote:
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Yes, it'll draw a function. Then I can click to add the axis and they get added appropriately. Is that what you're looking for?
--Ted
Ted Gould wrote:
On Mon, 2008-01-14 at 08:23 -0600, Aaron Spike wrote:
Ted Gould wrote:
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Yes, it'll draw a function. Then I can click to add the axis and they get added appropriately. Is that what you're looking for?
Tav's initial report was that items on the tab weren't working. But for me nothing works. So I think this may be sufficient proof of platform specific breakage. I don't know where to go from here.
Aaron Spike
On Mon, Jan 14, 2008 at 02:42:26PM -0600, Aaron Spike wrote:
Ted Gould wrote:
On Mon, 2008-01-14 at 08:23 -0600, Aaron Spike wrote:
Ted Gould wrote:
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Yes, it'll draw a function. Then I can click to add the axis and they get added appropriately. Is that what you're looking for?
Tav's initial report was that items on the tab weren't working. But for me nothing works. So I think this may be sufficient proof of platform specific breakage. I don't know where to go from here.
Maybe just disable it for the specific platform and list it as a known issue in the release notes?
Bryce
Is this the same bug as the one that crashes the Spirograph script in Windows? I'm hoping to do some investigation on that later in the week.
On Mon, 2008-01-14 at 13:36 -0800, Bryce Harrington wrote:
On Mon, Jan 14, 2008 at 02:42:26PM -0600, Aaron Spike wrote:
Ted Gould wrote:
On Mon, 2008-01-14 at 08:23 -0600, Aaron Spike wrote:
Ted Gould wrote:
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Yes, it'll draw a function. Then I can click to add the axis and they get added appropriately. Is that what you're looking for?
Tav's initial report was that items on the tab weren't working. But for me nothing works. So I think this may be sufficient proof of platform specific breakage. I don't know where to go from here.
Maybe just disable it for the specific platform and list it as a known issue in the release notes?
Bryce
Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
I don't think so. The spirograph script does not use the "notebook" parameter, and I am relatively sure that my bug is very specific to the notebook parameter.
I'm able to run the spirograph on my machine, Windows XP, Jan 14 code.
At 02:10 AM 1/15/2008 +0000, Joel Holdsworth wrote:
Is this the same bug as the one that crashes the Spirograph script in Windows? I'm hoping to do some investigation on that later in the week.
On Mon, 2008-01-14 at 13:36 -0800, Bryce Harrington wrote:
On Mon, Jan 14, 2008 at 02:42:26PM -0600, Aaron Spike wrote:
Ted Gould wrote:
On Mon, 2008-01-14 at 08:23 -0600, Aaron Spike wrote:
Ted Gould wrote:
I'm not exactly sure how to test it. When I run function plotter
with
the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Yes, it'll draw a function. Then I can click to add the axis and they get added appropriately. Is that what you're looking for?
Tav's initial report was that items on the tab weren't working. But for me nothing works. So I think this may be sufficient proof of platform specific breakage. I don't know where to go from here.
Maybe just disable it for the specific platform and list it as a known issue in the release notes?
Bryce
Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, 2008-01-14 at 14:42 -0600, Aaron Spike wrote:
Ted Gould wrote:
On Mon, 2008-01-14 at 08:23 -0600, Aaron Spike wrote:
Ted Gould wrote:
I'm not exactly sure how to test it. When I run function plotter with the default values I don't get any document changes, but I also don't get any errors. Is that expected?
Create and select a rectangle before running the effect. Then change parameters and see if the change affects the result.
Yes, it'll draw a function. Then I can click to add the axis and they get added appropriately. Is that what you're looking for?
Tav's initial report was that items on the tab weren't working. But for me nothing works. So I think this may be sufficient proof of platform specific breakage. I don't know where to go from here.
There was that CD that we discussed earlier... ;)
I'm kinda agreeing with Bryce, I think this is a GTK+ issue, but I have no idea how to debug it on Windows. We might have to remove this from the win32 build.
--Ted
participants (5)
-
Aaron Spike
-
Alvin Penner
-
Bryce Harrington
-
Joel Holdsworth
-
Ted Gould