Python and CCTray Again
So after creating a python script that would use my tux droid to notify me when a build failed I decided to extend the script a little further. I decoupled it from the tux droid code and added in a status menu. It still requires that CruiseControl.NET has the webdashboard installed. This is my first venture into using GTK with python, as well as threads.
One of the problems that I encountered when trying to use thread was that they were not behaving correctly. The Thread would appear to start however it would not run. This was easy to fix but adding the following line to initialize the threading.
gtk.gdk.threads_init()
In addition to this the class that was running the thread not only had to inherit from the threading.Thread object but had to explicitly call the init on the threads base class
class ccnetworker(threading.Thread): # init def __init__(self,xmlPath,pycctray): threading.Thread.__init__(self) self.xmlPath = xmlPath self.pycctray = pycctray
Below is a screen shot of the system tray menu, listing the projects that are available to be force built.

# example usage python pycctray.py http://localhost/ccnet/XmlServerReport.aspx
You can get the latest source from the bazaar repository
bzr branch http://bzr.yeticode.co.uk/pycctray
Alternatively you can download the source files on their own: pycctray.tar.gz






Daniel Hommel 7:59 pm on April 10, 2009 Permalink |
I tried to make CCTray work on mono once and i had to comment out a lot of stuff to get it kind of working (all the windows-isms had to go)… After i got it running there were still a bunch of problems, like a ghost window with no content behind the CCTray window, all the projects showing up 2 times and the tray icon also didn’t work as it should. After all i think writing a Gtk# client is a good idea. I hope you will publish the code soon so i can try it out in my GNOME environment. BTW, do you use CCTrayLib for that project?
regards,
Daniel
Daniel Hommel 8:03 pm on April 10, 2009 Permalink |
Just found out that you did publish the code already and that also answered my question about CCTrayLib. I’ll try it out and let you know how it work.
regards,
Daniel