Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques A questions about testing applets.
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] A questions about testing applets.
rozen English 2 fabounet [Read]
27 June 2012 à 18:03

rozen, Tuesday 26 June 2012 à 08:40


Subscription date : 20 December 2009
Messages : 19
Hi,

I am a long time user of cairo-dock and would like to play around with some applets so I have a question about testing applet code.

I am running Linux Mint Debian Edition with Xfce. This evening I built version 3.0.2 from sources; that went fine and Cairo-Dock is now running without OpenGL just fine. One thing strange is that when I run from the terminal with -c, I get the black background. However, if start Cairo-Dock from the menu using the same command "/usr/local/bin/cairo-dock -c" it runs just fine. (I also found this behavior with version 2.4.0 installed from the debian.linuxmint repository. Thats why I went to the new version.)

Anyway, I would like to start by playing with the Calendar applet to get a taste of applet development and also, I would like to change its behavior. My approach to learning how a program really works is to run it in a test environment with debugging output to see what is happening. So I tried changing to the directory containing the Calendar which is " ~/.config/cairo-dock/third-party/Calendar" and executing Calendar. However, I got a python traceback
Traceback (most recent call last):
File "./Calendar", line 24, in <module>
CDBashApplet().run()
File "/usr/local/lib/python2.7/dist-packages/CDBashApplet.py", line 31, in __init__
CDApplet.__init__(self)
File "/usr/local/lib/python2.7/dist-packages/CDApplet.py", line 107, in __init__
self.cBusPath = sys.argv[2]
IndexError: list index out of range


So then I thought I would try Calendar.sh with a debugging 'echo "parameters: $*"' at the start and got
parameters:


Obviously, I don't have a testing environment set up.

That is my question: How do I set up a debugging environment where I can run an applet and while observing its behavior.

Is there a way to make a change to the code for an applet and then restart CD AND catch any output from debugging statements? That would be clumsy because I would like to be using CD while trying to debug the applet.

I will of course appreciate any suggestion.

Thanks in Advance,

Don

matttbe, Tuesday 26 June 2012 à 16:52


Subscription date : 24 January 2009
Messages : 12573
Hello,

One thing strange is that when I run from the terminal with -c, I get the black background. However, if start Cairo-Dock from the menu using the same command "/usr/local/bin/cairo-dock -c" it runs just fine. (I also found this behavior with version 2.4.0 installed from the debian.linuxmint repository.
It's maybe due to the packages but it's a bit strange. (I don't like these packages but it's really strange to have these kinds of bugs!)

My approach to learning how a program really works is to run it in a test environment with debugging output to see what is happening. So I tried changing to the directory containing the Calendar which is " ~/.config/cairo-dock/third-party/Calendar" and executing Calendar.
All applets in this directory have to be launched by the dock (because it launches these applets with a few arguments and this is why you've this Python traceback.

If you want to debug this kind of applets, simply launch the dock from a terminal and you'll see all output messages in your terminal (all applets will share the same standard output (stdout))
Note that you don't need to restart the dock if you want to see your modifications in these applets, simply restart these applets.

fabounet, Wednesday 27 June 2012 à 18:03


Subscription date : 30 November 2007
Messages : 17118
that's a big WTF !

executing Calendar

héhé, you can't just run the .sh, it's the dock that will run it when it starts the applet
well you could, but there are some parameters to give to the bash script, and anyway as Matttbe said, if you want the output of your applet, you can just run the dock in a terminal, you'll get the outputs of the applet.

the Calendar applet is written in bash, personnaly I prefer Python applets
the bash interface just wraps the python interface anyway.

simply restart these applets.

yep, by disabling/enabling the applet in the configuration window.

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] A questions about testing applets.
rozen English 2 fabounet [Read]
27 June 2012 à 18:03


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques A questions about testing applets. Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.