Entries For: November 2008
2008-11-23
Moving to Intrepid and KDE 4.1
I've migrated my laptop (my main workstation, these days) and I've done
a complete migration to the KDE 4.1 desktop. Things are not perfect,
(on the old KDE 3.5 I'd say things were 99% according to my tastes),
but I'm trying to accomodate and find replacements. I didn't like the
KDE 4.1 launcher at first and I've even tested Launcelot for a while,
but now I'm back to the default menu and I'm starting to like it (on
3.5 I was using Tasty Menu).
I'm using Scultptura style with the Scultura-Stone color scheme and Sculptura window decoration. I needed to add another plasmoid from kde-look, the panel spacer, to make the systray smaller and separate the buttons on the right side to those on the left.
Things that I'm missing:
- no "window" list menu widget, which I've tried to replace with a plasmoid. I might as well remove it, because it doesn't list all the windows from all desktops, just the current desktop.
- I don't like the double spacing of the clock & date widget, I wish that it was a single line. I saw that there's a plasmoid on kde-look.org, I might try that.
- I don't like the black background in the systray (at the right top)
- There's no working "app shortcuts buttons" plasmoid, although I may try to simulate that with the Quick Access plasmoid.
Things that I'm happy with:
- Shiny new software!
- KDE 4.1 is actually not that horrible, once I tweak it (although Kde 3.5 had the same problem, closest to my "visual" tastes comes Gnome, but I like Kde applications better).
- NetworkManager seems to deal a bit better with my wireless connection (when my girlfriend opens her Macbook I get terrible disconnects from the access point)
2008-11-18
Subversion 1.5 + default instalation Plone 3.1 buildout: no problems here
I've hit the setuptools + subversion 1.5 problem again with a freshly install Plone 3.1.7 buildout: I've added my egg develop folder in zinstance/src/, I've added the egg in the relevant sections in buildout.cfg, but it wouldn't work because of the incompatibility with the old setuptools version.
The solution is to upgrade the installed setuptools to the latest version. For example, for a standalone Plone installed at /home/tibi/Plone, we have this structure:
/home/tibi/Plone /Python-2.4 /buildout-cache /zinstance
I've changed directory to the Python-2.4 from above and ran:
bin/easy_install -U setuptools
Then I could succesfully run the buildout in the zinstance folder.
2008-11-01
A wxPython based tagcloud renderer
This is a small example app that will render a tag cloud with various font weights/height, based on their weight in the cloud. Not much to say here, hope it is useful to someone. It has actually been easier to design and create then expected, the only difficulty was in figuring out how to resize the buttons based on the size of their label. The algorithm could be improved to generate the cloud in a single pass, but I'm not gonna bother, it works fast enough right now.
import wx
TAGS = [
['animals', 0],
['architecture', 2],
['art', 5],
['august', 1],
['australia', 1],
['autumn', 3],
['baby', 5],
['band', 1],
['barcelona', 3],
['beach', 2],
['berlin', 5],
['bird', 1],
['birthday', 0],
['black', 1],
['blackandwhite', 5],
['blue', 2],
['boston', 3],
['bw', 5],
['california', 1],
['cameraphone', 1],
['camping', 1],
['canada', 4],
['canon', 0],
['car', 5],
['cat', 3],
['chicago', 4],
['china', 5],
['christmas', 0],
['church', 0],
['city', 1],
['clouds', 3],
['color', 5],
['concert', 5],
['cute', 3],
['dance', 0],
['day', 5],
['de', 4],
['dog', 0],
['england', 5],
['europe', 4],
['fall', 1],
['family', 4],
['festival', 1],
['film', 1],
['florida', 2],
['flower', 1]
]
WIDTH = 500
def getwidth(line):
return sum([l.GetSize()[0] for l in line])
def getheight(line):
return max([l.GetSize()[1] for l in line])
class TopFrame(wx.Frame):
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
self.SetSize((500,400))
lines = []
for tag in TAGS:
l = wx.Button(self, -1, tag[0], style=wx.NO_BORDER|wx.BU_EXACTFIT)
weight = ((tag[1] % 2) and wx.BOLD) or wx.NORMAL
l.SetFont(wx.Font(10 + tag[1], wx.DEFAULT, wx.NORMAL, weight, 0, ""))
l.SetSize(l.GetBestSize())
w, _h = l.GetSize()
if lines:
line_width = getwidth(lines[-1])
if (line_width + w) > WIDTH: #make a new line
lines.append([l])
else:
lines[-1].append(l)
else: #lines is empty
lines.append([l])
row_pos = 0
for line in lines:
height = getheight(line)
row_w = 0
w = getwidth(line)
spacer = (WIDTH - w) / len(line)
for l in line:
dh = row_pos + height - l.GetSize()[1]
l.MoveXY(row_w, dh)
row_w += l.GetSize()[0] + spacer
row_pos += height
class MyApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
frame = TopFrame(None, - 1, "")
self.SetTopWindow(frame)
frame.Show()
return 1
def start():
app = MyApp(0)
app.MainLoop()
if __name__ == "__main__":
start()