In my previous post, I have shown how to integrate OpenCV with pygtk to show images. In this post, I’ll be showing how to use OpenCV/SimpleCV with pygtk to show multiple images simultaneously, a continuous streaming of images (like a … Continue reading
I am currently working on an undisclosed project with a senior. It requires a GUI, and bunch of OpenCV codes. We started using pygtk, and openCV. python wrapper for openCV is literally slow and we need a much better performance … Continue reading
DeskWid! Yeah, I couldn’t find any other name and it doesn’t matter that much. From the name only, I guess you can recognize what it means. Desktop Widget. It’s not exactly a widget, but more kind of an application.
So, I had a program to fetch movie details from IMDb, a program to tweet, a program to get timeline, a program for sticky notes! After wasting time on internet to get a good sticky note application, I made one myself in python. I had to open all of them separately and three different windows would open. And it’s a buzzkill if your taskbar if full. Hence I combined all of them together and made a GUI.
In the beginning, I thought of making separate boxes for imdb and timeline, but then again it where would I put all of it individually. So, I combined and made only two textviews. One for timelines, imdb, etc and other for notes.
Now the problem was how to give command to do all the stuff. In my previously mentioned twitterBox application, whenever my mouse pointer left the window, it would fetch timeline. And yeah, it turns out that mouse pointer goes in and out too many times, so I had to include flags, and stuff and became a bit messy. So, no eventbox this time.
And I was still stuck at the problem of giving commands. Then, I remembered Rowz. They have this command dialog box, in which you add /b to save the bookmark, /s code to save the snippet, etc. So using similar idea, I combined all the commands and then segregated them afterwards. So to tweet, I would enter \t my tweet, etc.
It was going good until tweeting and fetching timeline was concerned. But I couldn’t fetch IMDb movie details. There was some problem with the thread. Searched for an hour so, and then I realized, I had forgot to add gtk.gdk.threads_init() which would initialize mutltithreading in pygtk/gtk+!
Okay. Basic GUI and operations done! Now due to slow connectivity of BITS net, sometimes it took long time to fetch timelines, movie details, and tweets. And sometimes, I don’t know why but twitter doesn’t respond on BITS net. Hence, I needed something to show whether timeline is being fetched or not or there is some error and for that I added a label, and since most of my fetches are done in different threads, I have to add gobject.idle_add(), which would as I have mentioned in the previous post add a function (specified by callback) to be called whenever there are no higher priority events pending to the default main loop.
And then there was the biggest buzzkill! Manually adding proxy and all the api keys in the code. So my first priority was to make another window to add that, but it was 4 in the morning, and I was half asleep and then making boxes, adding labels, adding entries felt kind of redundant. I added that facility in the command prompt.
–consumer_key “consumer key here”
For all the information, you must read README!
Made few changes in the morning(afternoon actually) and added on GitHub. And gave it to couple of friends for testing.
I have always been curious about open source and open source licensing. And I wanted to copyright DeskWid with some open source license. Read about open source license. Didn’t understand much. Licensed it with MIT license. Hope it’s good!
2. Modification to make it more accurate.
3. Code in more pythonic way.
4. Add more things like google search, more twitter commands, file search, etc.
P.S. There are so many things that I have to learn about open source, python, packaging, documentation.
I started making an application/desktop widget for twitter! I made this thing which I call “tweetBox“! It’s just this widget/application written in python using pygtk/gtk+ for GUI, using which you can tweet! Only tweet! It was easy. No messed up … Continue reading