Technical discussions | Discussions techniques
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 tracebackTraceback (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
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
|
|
Technical discussions | Discussions techniques
|