zenity_list: can't handle ( nor =

View: New views
2 Messages — Rating Filter:   Alert me  

zenity_list: can't handle ( nor =

by Hielos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello. I searched for "zenity_list" in the bugs' forum, but I didn't find anything. I am not looking for a solution. I just want to say that there is a bug in 'zenity_list':

octave> zmsg = "Hello";
octave> zcols = {"Choice", " ", "Description"};
octave> zopts = {"TRUE", "FALSE";"1", "2";"f", "df/dx"};
octave> zenity_list(zmsg, zcols, zopts, "checklist", "all");
WORKS

DOESN'T WORK:
octave> zmsg = "Hello";
octave> zcols = {"Choice", " ", "Description"};
octave> zopts = {"TRUE", "FALSE";"1", "2";"f(x)", "df(x)/dx"};
octave> zenity_list(zmsg, zcols, zopts, "checklist", "all");
sh: Syntax error: "(" unexpected
error: zenity_list:
error: called from:
error:   /home/user/octave/zenity-0.5.7/zenity_list.m at line 103, column 5

DOESN'T WORK:
octave> zmsg = "Hello";
octave> zcols = {"Choice", " ", "Description"};
octave> zopts = {"TRUE", "FALSE";"1", "2";"f=k", "df/dx"};
octave> zenity_list(zmsg, zcols, zopts, "checklist", "all");
(This one creates a very odd pop-up list)

I hope this helps

Re: zenity_list: can't handle ( nor =

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

tir, 20 10 2009 kl. 10:58 -0700, skrev Hielos:
> Hello. I searched for "zenity_list" in the bugs' forum, but I didn't find
> anything. I am not looking for a solution. I just want to say that there is
> a bug in 'zenity_list':

Thanks for bringing this up. For future reference, please file bugs
against packages at the octave-forge mailing list:
octave-dev@...

> DOESN'T WORK:
> octave> zmsg = "Hello";
> octave> zcols = {"Choice", " ", "Description"};
> octave> zopts = {"TRUE", "FALSE";"1", "2";"f(x)", "df(x)/dx"};
> octave> zenity_list(zmsg, zcols, zopts, "checklist", "all");
> sh: Syntax error: "(" unexpected
> error: zenity_list:
> error: called from:
> error:   /home/user/octave/zenity-0.5.7/zenity_list.m at line 103, column 5

The attached patch seems to fix this.

> DOESN'T WORK:
> octave> zmsg = "Hello";
> octave> zcols = {"Choice", " ", "Description"};
> octave> zopts = {"TRUE", "FALSE";"1", "2";"f=k", "df/dx"};
> octave> zenity_list(zmsg, zcols, zopts, "checklist", "all");
> (This one creates a very odd pop-up list)

You'll need to explain why this one is odd. It looks quite fine to me,
but perhaps I'm not looking the right places? It could also relate to
the choice of shell as the 'zenity' package just calls the shell. I'm
using bash. Do you use something else?

Søren

[zenity.patch]

Index: zenity_list.m
===================================================================
--- zenity_list.m (revision 6317)
+++ zenity_list.m (working copy)
@@ -78,6 +78,11 @@
 
   columns = sprintf('--column="%s" ', columns{:});
   data = sprintf("%s ", data{:});
+  
+  ## Escape certain characters
+  data = strrep (data, "\\", "\\\\");
+  data = strrep (data, "(", "\\(");
+  data = strrep (data, ")", "\\)");
 
   cmd = sprintf('zenity --list --title="%s" %s %s %s --print-column="%s" --separator=":" %s %s', ...
                 title, checklist, radiolist, editable, print_column, columns, data);



_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave