Main index > Python programming > XFCE4 desklet testing/debugging

By mbokil (Desklet Author), on Tue Dec 13 09:12:46 2005: XFCE4 desklet testing/debugging.

I usually use 'adesklets --xfce4' to run all my desklets that are registered. I have a couple questions.

1. How can I use the --xfce4 option while testing an applet?

2. I noticied if I use the adesklets --xfce4 option I am not getting print statements going to my console. How can I get this to work

3. What is the best way to debug adesklets desklets?

Thanks,
mark

By ZeroDivide (Desklet Author), on Wed Dec 14 13:52:00 2005.

Hey mbokil,

You should be able to start your desklet with the --xfce4 flag.

Code:

./desklet-to-debug.py --xfce4

or

Code:

python ./desklet-to-debug.py --xfce4


You can also use the ADESKLETS_ID environment variable to pick a specific instance to start from that desklets config.txt file.

So if you desklets config.txt file looks like this

Code:


id0 = {'background_blur': '3',
 'background_effect': 'tint(alpha=128,red=200,green=200,blue=200);',
 'border': 'images/borders/sunken2/',
 'border_bottom': False}
id1 = {'background_blur': '0',
 'background_effect': 'tint(alpha=128,red=0,green=0,blue=0);',
 'border': 'images/borders/light/',
 'border_bottom': True}



You can pick the instance you want to start like this.

Code:

ADESKLETS_ID="0" ./desklet-to-debug.py --xfce4

or

Code:

ADESKLETS_ID="1" ./desklet-to-debug.py --xfce4


I hope this answers your questions,
ZeroDivide

By mbokil (Desklet Author), on Thu Dec 15 00:23:23 2005.

Thanks that helped me out a lot. Now I can debug things in a normal way.

-Mark

By mbokil (Desklet Author), on Mon Dec 19 10:14:23 2005.

I don't quite understand the syntax for specifying a desklet's id on the command line.

I have tried:

Code:

./my_desklet.py --xfce4 4


Adesklets isn't picking up the string_id argument at the end. I tried --4 -4 and neither option worked. Could you provide a working example?

Thanks,
Mark

By ZeroDivide (Desklet Author), on Mon Dec 19 14:34:14 2005.

What you need to do is set the environment variable ADESKLETS_ID to the id you want.

Here are a few examples that will work under the bash shell.

Code:

export ADESKELTS_ID=4
./my_desklet.py --xfce4


Code:

ADESKLETS_ID=4 ./my_desklet.py --xfce4

By mbokil (Desklet Author), on Mon Dec 19 22:08:57 2005.

Thanks I get it now. It is a little unclear in the adesklets --help option which shows:

Code:

Usage: adesklets [OPTION]... [string_id]

I would be a nice feature if you could specifiy two options on the command line such as ./my_deskley --nautilus --4. This would be good for testing desklets.

-mark

By syfou (Core Developer & Desklet Author), on Wed Jan 18 15:56:47 2006.

mbokil wrote:

Thanks I get it now. It is a little unclear in the adesklets --help option which shows:

Code:

Usage: adesklets [OPTION]... [string_id]

Well, it is because the usage is different. You could have looked at:

Code:


./my_desklet.py --help


mbokil wrote:


I would be a nice feature if you could specifiy two options on the command line such as ./my_deskley --nautilus --4. This would be good for testing desklets.

You can already specify as many options as you like. As for a shortcut for setting ADESKLETS_ID, it could be a good idea, but I am not sure yet... Let me think about it for a while.


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.