Many months ago I was dealing with OpenGL, shaders and C++, the usual tools of a graphics programmer wannabe. 🙂
This time I’m writing about something completely different, the recent developments of PacStats.
The new PacStats logo
PacStats is a 2007 project that was born as a toy experiment borrowing a lot of GL O.B.S. code: it is a program that analyzes the log of pacman, the ArchLinux package manager, and then plots a bunch of statistical charts about its activity.
Have you ever wandered how many packages have a name that begins with the letter “F”, or who is the packager that has contributed the most? With PacStats you can easily answer to those questions. 😉
But what have been the main changes since 2007?
Well, first of all I have renewed the code as already done for GL O.B.S., so the GUI is now based on GtkBuilder, Matplotlib imports NumPy and the Python print statements have been converted to functions.
The program have also gained a toon shaded Blender made logo, and the possibility to be installed thanks to distutils through a very simple PKGBUILD that is already on AUR.
While some tables of the database have been refactored, the parsers made more robust and the base/derived chart classes relationship more polished, the most important news for the end users are represented by the possibility to configure the program through the GUI or a text file, the addition of a database information window and a menu item to optimize it and the addition of a couple of new charts and a toolbar to control them.
The Preferences window
The Database Information window
The original project have been hosted for a long time on my personal site, but the efforts spent to reboot it have suggested the possibility to have it published in a more “official” way: as a matter of facts you can find it on Google Code.
I have been interested in this open source project hosting platform for a long time and until now I’m really satisfied by its streamlined yet flexible interface.
I’m also very glad to have employed Mercurial for source revision control, after having been positively struck by the git experience and been advocating distributed systems for quite some time now, my decision to use it instead of Subversion feels very natural. Sure enough it is a really nice tool, easier to grasp than git but capable of most of the things of its famous contender, written in Python but yet not suffering too much when coming to performance.
Just like every other free software I have been responsible for, I have created a project page on Ohloh too, have a look at it and enjoy your charts! 😉
You’re reading about GL O.B.S. after *exactly* 730 days (I swear it was not made on purpose ;-)): today revision 50 has been committed.
No new feature has been added, I’ve dedicated the efforts of the last days to a case study about updating an application after a very long time, the process mainly involved removing deprecated things and adding support for new ones.
GL O.B.S. GUI is now based on GtkBuider
Let’s read together some lines from the revision log:
- GUI migrated from libglade to GtkBuilder
This was, with no doubt, the most time consuming task: gtk-builder-convert tool was not so reliable and I was compelled to recreate the GUI from scratch with Glade. I have also set the minimum GTK version required to 2.16
- using JSON format for storing benchmark information dictionaries
This feature is a way to get rid of the deprecated execfile() built-in function, instead of executing a python script to read a dictionary, the Benchmark class now parses a JSON file with the new integrated json module.
Comparing an old and a new file you can notice how simple it was the conversion, I’ve only lost the ability to comment a line. 😉
- importing numpy instead of numerix in matplotlib
This is another deprecation related issue, matplotlib is now based upon numpy.
- matplotlib canvas get refreshed instead of being destroyed and then recreated
I don’t know why two years ago I was destroying and recreating the object instead of just calling the draw() method every time it had to be refreshed. 😀
- some more attributes and objects integrated in the GtkBuilder XML file
I’ve integrated more attributes in the XML GUI file, like default size for secondary windows or Paned positions.
Moreover, thanks to GtkBuilder, even some objects have been integrated, like Adjustment or TextBuffer.
Actually also TreeModel objects should be configurable inside Glade and integrated inside the XML, but I didn’t manage to make them work. 🙂
Other remarkable changes in the field of Python3 future support and deprecated features removal were:
- all the print statements converted to functions
Well, we all know the content of PEP 3105… 😉
- using hashlib.md5 instead of md5
The md5 module has been deprecated in favour of the hashlib one
- using “key in dict” instead of dict.has_key()
The has_key() method no longer exists in Python 3
- using subprocess.Popen instead of os.popen()
os.popen() have been deprecated in favour of the subprocess module
- using urllib2.urlopen() instead of urllib.urlopen()
Another deprecation suggested substitution, from urllib.urlopen() to urllib2.urlopen()
- removed “copyright” argument and added “classifiers” in setup.py
The distutils.core.setup() function loses the “copyright” argument but gains “classifiers”. 🙂
- dropped support for pysqlite2 and old webbrowser module
Now that the minimum requirement is Python 2.6, there is no need for pysqlite2 or old webbrowser module support
- I have also removed the deprecated Options class in some SCons scripts.
I’m not sure I will have some time in the future to continue developing, but this was a nice “reboot” and I also have some new ideas in my to-do list. 😉
Three months and three weeks after rev. 43 (ignoring rev. 44 which was related to the site only) I committed a new revision of globs.
I would like to show some of the tiny refinements cited in the ChangeLog which I made to the interface.
In the new Information tab all the info are displayed inside a single TextView widget with gtk.WRAP_WORD which makes use of a bold TextTag to highlight the relevant text.
The policy of the surrounding ScrolledWindow widget is set to gtk.POLICY_AUTOMATIC for both scrollbars, which really makes it less cluttered.
Inside the updated Options tab you can see a new resolution ComboBox and a Frame surrounding benchmark options, this permits to perform a simpler and cleaner self.options_frame.set_sensitive(False) to gray out everything in case the “Lock current” ToggleButton is checked.
This is all very cute but the hard work, the adaptation of the submit code to the new database, is still postponed… 🙂