Necoro’s Blog

Blog? Blog? There is no blog…

Posts Tagged ‘GUI

Portato’s new C-Modules

leave a comment »

As I’ve written yesterday I created an eix cache parser. But … it was overengineered: It took like ages and was way slower than the normal portage way:


$ python -m timeit "import test; test.eix()"
10 loops, best of 3: 3.18 sec per loop
$ python -m timeit "import test; test.portage()"
10 loops, best of 3: 280 msec per loop

Thus I had to improve it: The first thing was to re-implement it using Cython. And step after step I ripped out features (in the original approach, the parser was lazy, i.e. only reading data if he needed to do so) and trimmed it down to what I really needed (opposed to being complete). Oh – and some C-level improvements :) (like using | instead of +).

Well: This is where I ended:

$ python -m timeit "import test; test.eix()"
10 loops, best of 3: 56 msec per loop

Now it is usable :)

Well — and while testing the new eix parser, I noticed, that Portato segfaults sometimes during shutdown. I thought the shm module the culprit and thus replaced the external dependency by a self-written module (again in Cython). And this also now uses message queues instead of shared memory — which is more intuitive and easier (no stupid locks and stuff). Seems to work up to now :)

Result: In the future, portato ships with C-Modules :) (hence the title

Advertisements

Written by Necoro

August 15, 2009 at 13:38

Posted in Portato, Python

Tagged with , , , , ,

Portato Manpage

leave a comment »

Since long I wanted to add a manpage to portato. Though it not necessarily needed (as you get all infos also with portato --help ), it is a nice add-on.

Problem is: a) How do I write a manpage? – Looking through the web, it looks like I have to use nroff – which is soo basic, it makes my eyes bleed. And b) I need to keep it up2date.

Solution: I found this great post by Andi Albrecht … and used his script :) Et voil√†, there we have a basic manpage.

Written by Necoro

March 24, 2009 at 20:21

Posted in Portato

Tagged with , ,

ktsuss – Graphical su

leave a comment »

Portage needs (in most cases) root-access to install packages. That’s why Portato needs them too ;).¬† But Portato is a GUI, thus it can be expected, that it is not launched via commandline – so the user normally does not su manually. So we need a graphical application, which deals with this part. Portato supported kdesu and gksu. Unfortunately both have quite a bunch of dependencies — which made some users worry.

But yesterday while having a look at wicd, that has the same kind of problem, I noticed a third application: ktsuss. The only dependencies here: glib and gtk. Yeah! – Looks like a good choice. It is not as shiny as the other two … but hell, it’s only task is to take your root pwd ..

As of revision 383, this is now also supported by Portato. (Of course – as always – this was not as easy as thought, as ktsuss parses the commandline differently. But well – shit happens).

And while taking this “feature” of wicd, I also switched to determining the correct app at runtime (as wicd does too). This is one step towards the goal of getting rid of the ‘sed’-stuff in the ebuild … :)

Written by Necoro

March 19, 2009 at 23:04

Posted in Portato

Tagged with , ,