Moin, Am Wed, 05 Sep 2007 03:53:17 +0200 schrieb Lars Hallberg:
> Over to Your problem. Your Python is probably to old. According to > the python docs (3.6.1 String Methods) You need python 2.5: I had the same problem and whipped up a quick partition(). Works ok for me (patch attached). -- Henryk Plötz Grüße aus Berlin ~ Help Microsoft fight software piracy: Give Linux to a friend today! ~
--- key2key.py.old 2007-09-02 20:10:56.000000000 +0200 +++ key2key.py 2007-09-05 10:38:39.000000000 +0200 @@ -12,6 +12,12 @@ scale = scale * 4.0 / cols hscale = hscale * scale +def partition(s, sep): + if sep in s: + a,b = s.split(sep,1) + return (a,sep,b) + else: return (s, "","") + keymap = [ [ # What function each 'key' vill have [ ["1:@#$\"", "'", "\"", "`", "x", "x" ], ["@", "$", "%", "~", "x", "x" ], @@ -97,7 +103,7 @@ def build_label(self, l): p = pango.AttrList() - (ll, sep, s) = l.partition(":") + (ll, sep, s) = partition(l,":") if sep == ":": l = "\n".join([ll, s]) p.insert(pango.AttrScale(hscale, 0, len(ll))) @@ -168,7 +174,7 @@ c = keymap[row][col][ii][jj] if (ii == row) and (jj == col): - (c, text, t) = c.partition(":") + (c, text, t) = partition(c,":") text = c if c == "enter": self.txt.insert_at_cursor("\n")
_______________________________________________ OpenMoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community