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.
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.
Things are chugging along for the Gutsy release of Ubuntu Studio. All the art packages are in the repos and we are moving towards getting a testing disk out into the wild. I have not done anything really for Gutsy on the packaging front, but am looking to change that.
As for my goals for Hardy, I would really like to try and get Celtx into universe. The initial outlook is a bit bleak, the upstream code ships standard libraries and I will have to modify the upstream tarball but I will look at how other Firefox based apps are packaged in Ubuntu. Jussi has also encouraged me to look at packaging Genpo for Hardy.
I will be posting progress information on the packaging of those two apps as it goes along. Hopefully I will have plenty of free time to do both this sort of work and for film (Which is the whole reason I am in England for this year :P)
Ok, stupid moment. I unplugged my iPod as Amarok was writing the iTunesDB file. crap. So now, my music is there, I just don’t know where it is. I am posting the solution that I have found for Linux and Amarok.
Amarok complains that it can not find an iTunesDB file (it is actually there, just corrupted) and wont mount it.
Solution:
1) Unmount, remount.
Amarok is nice enough to make a backup before any changes. Try and replace the current iTunesDB file with the backup.
1a) if you are getting a read-only error message, unmount and run:
sudo dosfsck -a /dev/ and remount.
2) Open up Amarok, look for a “Stale and Orphaned” option. This will take some time. Once it is done, Amarok will display a list of files.
3) Once that is done, right click and “add to database”.
And there you have it, a completely recovered iPod in under 5 minutes.
And now, to let Google get this information to the masses.