user-avatar
Today is Wednesday
February 22, 2012

Archives: November 2008

November 14, 2008

Mercurial bulk update

by Thomas Capricelli — Categories: Admin, Gentoo, KDE — Tags: 6 Comments

I don’t know about you, but I have on a lot of different places a directory called ‘hg’ with lot of different mercurial clones inside. Whether on the home of my several computers for my own projects, or inside other directories for external projects, and so on.

Now, remember one important aspect of distributed source control : your clone is actually both a repository and a working directory. This is why you usually (git and others do the same) have two different commands : one to synchronize the  repository (pull) and one to update the working directory (update).

Updating comes with a risk : you can have conflicts. This is why I never update a svn repository without thinking first (do I have local modifications ?). But pulling is a lot less problematic. And, especially on my laptop, I often want to ‘sync them all’ as soon as I have some internet connection. Until now i had a script syncall with the path of all (svn,unison and) mercurial repositories hardcoded. This does not scale, and I now need that in at least 5 different places. I dont feel like maintaining such scripts.

And now comes the magic alias that made my day. I’m usually lame at shell scripting, so I’m sure there are better ways. But it works, now, on my computer. And this is so useful.

alias hgbulk '\ls */.hg -d | cut -d\/ -f1 | xargs -i bash -c  "(cd {}; hg pull )"'

(yes, I use tcsh, but i’ve tested that in bash too. Don’t ask why I use tcsh.)

November 13, 2008

Yet another activity graph : how often do you emerge ?

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

Really, I seem to be fond of activity graphs those days. I have reused part of this previous code, but this time I parse the emerge log file to display the activity of your successful emerges. Think of it as a graphical view of ‘genlop -l’.

Those examples are the emerge activity of my two main computers.

The current code does the bare minimum, and  I need to add at least command line options for

  • logfile to use (currently/default : /var/log/emerge.log)
  • filename to create (currently/default : activity.png)
  • width/height of the image (currently/default : 800×600)

The usage is straightforward:

orzel@berlioz EmergeActivity% ./EmergeActivity.py
There are 9896 emerge completed successfully
Created the file 'activity.png'
orzel@berlioz EmergeActivity% xv activity.png &

You can grab the source (browse, tarballs, mercurial clone, even RSS) from :

http://sources.freehackers.org/EmergeActivity/

November 12, 2008

Full blown kde-aware opale version

by Thomas Capricelli — Categories: KDE — Tags: , 1 Comment
KDE version of opale

KDE version of opale

Since the release of opale-0.9, I have mostly worked on improving the (optional) KDE integration. And now if KDE is available, opale will use things like : KMainWindow, KApplication (session management..), XML GUI, KFileDialog and specific menu entries (Switch application language, configure shortcuts/toolbars, KDE-aware recent files submenu,…).

While I was there, the Qt-only version now also has a ‘recent files’ dialog popping-up at the start if no file is given on the command line (my personal top-missing feature).

Now, some people noticed that I want to port Opale to the Mac. I have an old ibook lying here, but MacOS has died and I need to re-install it before trying qt/Mac (that I have never tested yet).

As an answer to your blog entry, Orville (I guess that’s your first name, right?):

  • The kde version is now really finished, please try if you want.
  • I guess there’s no menu on the screenshot because Mac still has those on the top of the screen, right ?
  • I would be delighted if you could provide testing on the mac. You can find me on freenode as orzel.
  • I’m also interested with hints about the interface, I’m not afraid of you being mean.
  • What’s the problem with my help menu ? Everything’s fine here. Use the ‘report a bug’ entry in the very same menu!
  • Don’t be scared by a photo :-)

Opale homepage

Project page

November 12, 2008

KDE standard aboutbox is kind of close-minded

by Thomas Capricelli — Categories: KDE5 Comments

Back in the days of kde3, while writing a KDE application, I encountered quite a big problem while trying to use the aboutbox stuff from KDE (that means kaboutdata and the now called kaboutapplicationdialog). I talked to some guys on #kde-devel, and I have been told that, yes, this will be changed for KDE4.

Now that I (mostly) use and (rarely) develop for KDE4, I have been hit again by the same problem. Before reporting to the bugtracking system of KDE, I would like to know what people think. Most importantly, do people outside of KDE proper do actually use this ?

Description of the problem

There is a field called  bugsEmailAddress in the constructor of KAboutData, which is used by KAboutApplicationDialog to decide what to display. Using this field, something like

"Please report bugs to <a href=\"mailto:%1\">%2</a>.\n"

will be used to display the link in the about box. What does it mean ? First, it means that it is not possible to have a link to a web bug tracker. You need to provide a mail, and nothing else. Seeing how common are web bugtrackers, this is rather strange.

Though… what about KDE’s own applications ? The default value for bugsEmailAddress is “submit@bugs.kde.org”. So far, it makes perfectly sense. But if you open any KDE application, you’ll see a link to the web page. Why is it so ? look in kdelibs/kdeui/dialogs/kaboutapplicationdialog.cpp :

if ( .. || aboutData->bugAddress() == "submit@bugs.kde.org")
     text = "Please use http://bugs.kde.org..."

I can only guess why this was done this way : probably for some historical reason and then nobody bothered about fixing it. I’m sure they have not done something as ugly on purpose.

So as a conclusion

  • KDE uses a link to their web tracker.
  • You are not allowed to such a luxury and you need to provide an email address.

Toward a fix ?

The obvious fix is to store an URL or linkAddress in KAboutData and use that in the About dialog. Adding a clear sentence to the documentation : “if you want to use an email address, just add mailto: in front of the argument”.

Now, instead of ranting, my first reaction was to go and fix that (I swear, trust me). Even few years ago. But.. then I’m confronted to a problem : probably some people use this, and I would break quite a lot of about boxes, and everybody will hate me. Not something I want of course.. I tried to talk about this on IRC, but nobody is really interested in this. And finally, i did not dare changing this, and wend the old way : I wrote my own about box.

Turn around

Today, I have found a way to turn around the problem : You can use the method setCustomAuthorText() and then, KDE will not do anything and let you decide about what to display in this tab. Hourray :-)

November 11, 2008

Opale ported to qt4 and kde4

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , , , 4 Comments

Opale was an application written using koffice that I use to handle my personal accounts. Long ago I have dropped support for koffice (mainly because of the crappy/undocumented/buggy chart API) and since then opale was a kde-based application.

One year ago, i have started porting it to kde4, and, meanwhile, made it a Qt4 application. Using configuration, you can now have either a qt4 or a kde4 application. Actually, I have to say the kde4 stuff is not thoroughly tested. Anyway, the qt4 port is done and I now have Opale working under windows. Not that I really care, but that can be useful for others.

It was not until few weeks ago that kde4 was good enough for me (copyright me) so I can actually use this version of opale (yes, I know about running kde4 application under kde3, but no, thanks). Now that this version is tested enough, i release it as 0.9.

The roadmap for 0.10 is

  • macintosh version
  • well-tested kde4 application
  • template editing/removing

Opale homepage

Opale project on freehackers’laboratories.

November 2, 2008

Activities gallery

by Thomas Capricelli — Categories: Admin, Django, Gentoo, KDE, Linux kernel — Tags: , , , , , , , 3 Comments

While developing my recently released activity mercurial extension (and here too), I did a lot of tests on some quite famous/big projects. I’ve found the results to be quite interesting and decided to put up this gallery. Are you interested in the history of commits for kde, linux, django, portage(software), and others?

warning : this is just for fun (copyright Linus Torvalds), I’m perfectly aware that the number of commits is a very bad indicator for development.

The gallery : http://labs.freehackers.org/projects/hgactivity/wiki/Gallery

© 2012 Thomas Capricelli All rights reserved - Wallow theme v0.46.5 by ([][]) TwoBeers - Powered by WordPress - Have fun!