Well, seeing as I posted about this earlier, I might as well give it an update.
Thanks to my own testing (I wish I had a userbase, but that would have meant some very angry people due to data loss bugs), I have fixed several bugs in changesettings.py in regards to reading the file and changing the line replacement while the class is instanced. (As I write this right now, I am realizing I need to make a similar change to the set up of the regular expression…. just to make the whole thing nice and manageable)
The previous revisions could eat your data because: 1) when you read a buffer in python, it is emptied (very c like if you ask me) and 2) the class was not re-searching the file after the inital change. The end result of both of those two things were that if you changed the setting twice, it would overwrite the file with the empty buffer and all that would be left would be the replacement string. The other issue resulted in the append/update logic being static.
Both of theseĀ issues have been fixed as of rev 35 iirc in the mainline ubuntustudio-controls branch.
Well after two days MIA, I have made it back to Toronto from Newcastle. Its great to spend time with one’s family and even better not to have to think about what you are going to have for dinner. :p
I felt the need to blog about this small settings app that is being developed by Luis and myself called ubuntustudio-controls. The aim of this app is create an easier way for users to modify several settings that are currently modified by hand.
The design of -controls is such that it is DE agnostic. Currently we are only developing a front-end for Gnome, but the backend class that I wrote can be used in any python code.
A quick explanation on how it works
When the changesettings class is initialized it needs to be given three pieces of information :
1) The file to operate on
2) A python regular expression
3) The string you want to replace or add.
import changesettings
inst = changesettings('file', '\d', '1')
inst.ch_setting()
inst.rm_setting()
changesettings defines two methods, ch_setting and rm_setting. ch_setting will search the file for a string matching the python regular expression and if it exists, change it. Otherwise, it will append it to the second last line. (This may change in the future to allow the class to append it anywhere in the file.)
The second method defined does the same as the first, except it will remove the string.
The code is available from the ubuntustudio-controls project page on launchpad, but here is a link for all you lazy people.
Well, new and interesting new from the hardy packaging front. Genpo is coming along nicely. Currently I am waiting for upstream to either fix some file licensing issues themselves or to accept the patch I sent them. A testing version of Genpo can be found in my PPA:
deb http://ppa.launchpad.net/rexbron/ubuntu gutsy main
I have also got an ubuntufied version of OpenLibraries available for any hardy users (I just upgraded my macbook earlier today) at that same address but replacing gutsy with hardy.
OpenLibraries has proven interesting to package. All of the original debianization work was courtesy of debian-multimedia.org, for which I am much appreciative of. Beyond the general grunt work, that initial start has given me a good idea on how to approach these kinds of packages. The biggest problem with the packages current state is that, because of a dependency on libboost-python to provide the python extensions, it can only work with the version of python compiled against that. I initially tried to compile python-openlibraries against python2.4, but got some very nasty symbol mismatches.
Now hard coding a dependency on a particular version of python may not seem like a huge problem but it does fly in the face of Debian’s Python policy. I am afraid that when it comes time to submit the package to the archive, it will be rejected on those grounds, hence why I am actively looking for a way to implement it with python-central. If any python guru’s happen across this, please send me an email with your suggestions or look for rexbron on irc.freenode.net.
It is 2:30 in the morning and insomnia, or perhaps memories of home and Thanksgiving dinner (which should be wrapping up around now), are keeping me awake. I can not help but wonder at what all of my classmates back at York are doing right now, most likely enjoying time with family and feasting on turkey.
I had spaghetti with pesto for dinner.