You are not logged in.

#1 2012-04-29 21:41:47

bnb2235
Member
Registered: 2011-02-13
Posts: 119

zenity 3.4 broken?

Hello,
Is zenity 3.4 broken? I use audio-convert 0.3.1 from community and an image resize script. I use both of them as Nautilus scripts. Both of these are not working with zenity 3.4. When I downgrade to zenity 3.2,  both scripts work again. Anyone else have trouble? I wish I could say better where things fail, but I can't. I guess it is not interpreting an argument from the script...

Offline

#2 2012-04-30 07:47:24

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: zenity 3.4 broken?

The zenity calls in the image resize script all work fine for me. Perhaps it's due to Nautilus and not Zenity?

Offline

#3 2012-04-30 09:35:09

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: zenity 3.4 broken?

I considered that, but if I run them from the command line, they don't work there either with zenity 3.4. With 3.2. they work fine.

Offline

#4 2012-04-30 09:45:31

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: zenity 3.4 broken?

Not working in what way?
What do you get if you just run those zenity commands on there own?

Another thing you can do is put

set -o xtrace

at the start of your script, which should tell you where the failure is.
If you set PS4 to '$LINENO : ' it will tell you each line no that gets executed.

Last edited by skanky (2012-04-30 09:52:35)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2012-04-30 16:48:54

xamaco
Member
From: Corsica, France
Registered: 2010-04-05
Posts: 87

Re: zenity 3.4 broken?

I had a small problem with Zenity upgrade : It was displaying white text on a white background. It was due to the theme I was using...

Offline

#6 2012-04-30 21:38:29

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: zenity 3.4 broken?

It seems to not be able to detect whether or not cancel was pressed. I select a size or type and press OK. With zenity 3.4, I have to comment out the cancel check to make the scripts run.

The resize script is exiting from this code:

#if $? != 0, user click on cancel button, so exit
if [ "$?" != 0 ] ; then
	exit
fi

The output of:

[bryan@HPUSDT ~]$ ~/.gnome2/nautilus-scripts/ResizeImages picture.jpg
+ '[' 1 -eq 0 ']'
+ title='Choose which sizes to scale to'
++ zenity --title 'Choose which sizes to scale to' --list '--separator= ' --column=size 160x120 320x240 640x480 800x600 800x600 1024x768
+ imgsize=320x240
+ '[' 139 '!=' 0 ']'
+ exit

The audio convert script is exiting from this code:

       formatout=`zenity --title "$title" --list --column="Format" $depformat --text "$choix"`
        ###### Choix -> Sortie boucle ######
        if  [ $? != 0 ]; then
                exit 1
        fi
       [ $? -ne 0 ] && exit 2 # Annulation

The output of:

[bryan@HPUSDT ~]$ ~/.gnome2/nautilus-scripts/audio-convert2 music.m4a
+ version=0.3.1
+ title='audio convert 0.3.1'
+ pleasesel='please select at least one file.'
+ noselec='audio convert 0.3.1 converts audio files. please select at least one file.'
+ choix='extension of output file:'
+ warning=warning
+ proceed='already exists. overwrite?'
+ recur='audio convert 0.3.1 can'\''t convert a directory. please select at least one file.'
+ conversion='converting file:'
+ ask_artist='enter the artist name:'
+ ask_album='enter the album name:'
+ ask_song='enter the song name:'
+ ask_track='enter the track number:'
+ ask_quality='select the desired quality:'
+ ask_compression='select the desired compression level:'
+ confirmation='do you want to convert'
+ decoding='decoding file:'
+ ask_fields='manually enter file metatags'
+ ask_confirmation_question='get prompted a confirmation question before convertin'\'' each file'
+ no_codec='you don'\''t have the right codec to decode the selected file. missin'\'' codec:'
+ not_supported='format not supported'
+ completed='conversion completed. goodbye!'
+ ask_to_pass='pass the metatags on to the new files'
+ options='choose from the followin'\'' options:'
+ options_conflict='options one and two conflict. please unselect one of them'
+ case $LANG in
+ '[' 1 -eq 0 ']'
+ is_mp3 music.m4a
+ file -b music.m4a
+ grep MP3
+ echo music.m4a
+ grep -i '\.mp3$'
+ is_ogg music.m4a
+ file -b music.m4a
+ grep Vorbis
+ echo music.m4a
+ grep -i '\.ogg$'
+ is_mpc music.m4a
+ file -b music.m4a
+ grep Musepack
+ echo music.m4a
+ grep -i '\.mpc$'
+ is_flac music.m4a
+ file -b music.m4a
+ grep FLAC
+ echo music.m4a
+ grep -i '\.flac$'
+ is_mac music.m4a
+ file -b music.m4a
+ grep data
+ is_aac music.m4a
+ file -b music.m4a
+ grep AAC
ISO Media, MPEG v4 system, iTunes AAC-LC
+ depformat=
+ which lame
/usr/bin/lame
+ is_mp3 music.m4a
+ file -b music.m4a
+ grep MP3
+ echo music.m4a
+ grep -i '\.mp3$'
+ depformat=mp3
+ which oggenc
/usr/bin/oggenc
+ is_ogg music.m4a
+ file -b music.m4a
+ grep Vorbis
+ echo music.m4a
+ grep -i '\.ogg$'
+ depformat='mp3 ogg'
+ which mppenc
+ which mppdec
+ is_mpc music.m4a
+ file -b music.m4a
+ grep Musepack
+ echo music.m4a
+ grep -i '\.mpc$'
+ which flac
/usr/bin/flac
+ is_flac music.m4a
+ file -b music.m4a
+ grep FLAC
+ echo music.m4a
+ grep -i '\.flac$'
+ depformat='mp3 ogg flac'
+ which mac
+ is_mac music.m4a
+ file -b music.m4a
+ grep data
+ which faac
/usr/bin/faac
+ is_aac music.m4a
+ grep AAC
+ file -b music.m4a
ISO Media, MPEG v4 system, iTunes AAC-LC
+ which faad
/usr/bin/faad
+ which mplayer
/usr/bin/mplayer
+ is_wav music.m4a
+ file -b music.m4a
+ grep WAVE
+ echo music.m4a
+ grep -i '\.wav$'
+ depformat='mp3 ogg flac wav'
+ '[' '!' '' ']'
++ zenity --title 'audio convert 0.3.1' --list --column=Format mp3 ogg flac wav --text 'extension of output file:'
+ formatout=mp3
+ '[' 139 '!=' 0 ']'
+ exit 1

Or let me phrase it another way. With the audio script, at the first dialog, I press cancel. With zenity 3.4 I get:
+ '[' 139 '!=' 0 ']'

with zenity 3.2 I get:
+ '[' 1 '!=' 0 ']'

Cancel should output the same value regarless of the zenity version (at least I would think so)

With zenity 3.4 "OK", $? returns 139
With zenity 3.2 "OK", $? returns 0

Offline

#7 2012-04-30 22:10:08

Gumper
Member
From: U.S.A.
Registered: 2009-10-26
Posts: 132

Re: zenity 3.4 broken?

Hey bnb2235,

The cancel button in a script where I use Zenity works ok here with version 3.4. In my case I know that it's returning a "1" because my script checks for a "1" to exit.

  if [ $? = 1 ]; then
                exit
            fi    

Ready yourselves, ready yourselves
Let us shine the light of Jesus in the darkest night
Ready yourselves, ready yourselves
May the powers of darkness tremble as our praises rise .... Casting Crowns-Until The Whole World Hears.

Offline

#8 2012-04-30 22:48:58

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: zenity 3.4 broken?

I guess I have a very fascinating problem then, don't I? On two different computers nonetheless. I even tried getting zenity 3.4 package from a differnet repo. Same results.

Offline

#9 2012-05-01 08:57:59

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: zenity 3.4 broken?

Okay, it looks to me like it might be a zenity bug in lists.

When I try this:

zenity --title 'audio convert 0.3.1' --list --column=Format mp3 ogg flac wav --text 'extension of output file:'

I get a segmentation fault and $? = 139

If I remove the list items - mp3, ogg, etc. then I don't get the segmentation fault. I also get one when I try this from the examples section of the manual:

zenity --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges FALSE Pears FALSE Toothpaste

"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#10 2012-05-01 09:27:33

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: zenity 3.4 broken?

Thank you skanky,
I thought I had a unique system here...

Offline

#11 2012-05-01 09:47:35

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: zenity 3.4 broken?

smile

If the user clicks on OK then the selected result is returned (though it still seg faults), so the workaround (aside from downgrading) looks to me to check for a returned value, rather than $?.

I couldn't see a bug report on the zenity tracker that matched this, so I'd report it there.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#12 2012-05-04 11:41:42

Paramvir
Member
Registered: 2009-08-06
Posts: 135
Website

Re: zenity 3.4 broken?

bnb2235 wrote:

Thank you skanky,
I thought I had a unique system here...

Yes there is a bug - the exit code returned is 139 for cancel or ok grrrrrrrrrrrrrrrr - downgrading to 3.2.0-1 does solve the issue !!

Offline

#13 2012-10-20 18:33:51

strummer
Member
Registered: 2007-01-11
Posts: 87

Re: zenity 3.4 broken?

Sorry, I know this thread is old, but I too am using audio-convert (love it), and the newest Zenity doesn't work. But I upgraded to 3.2.0-1 so it's ok.

Actually, i think audio-convert is like 7 years old? Maybe I should search a new program/script..


P4 530J, Arch Linux

Offline

Board footer

Powered by FluxBB