[pkg-fso-commits] [SCM] freesmartphone.org demo GUI branch, master, updated. milestone2-25-gf72c138
Jan Luebbe
jluebbe at debian.org
Tue Sep 2 10:26:30 UTC 2008
The following commit has been merged in the master branch:
commit 9b62f2867303985a29667013d389b324bdd71032
Author: Jan Luebbe <jluebbe at debian.org>
Date: Mon Aug 25 12:36:27 2008 +0200
the python edje bindings already encode to utf-8
The old code breaks on systems where the python default encoding is not utf-8
(check the default encoding with sys.getdefaultencoding()). Debian and Gentoo
have acsii as the default codec. So we need do explicitly encode and decode,
but at the right place (which is in the python bindings for edje in this case).
In OE we have a patch for python-edje which handles this, i'm trying to get
it upstream.
diff --git a/src/zhone b/src/zhone
index 0bfbcae..38bd1ea 100755
--- a/src/zhone
+++ b/src/zhone
@@ -454,7 +454,7 @@ class pyphone_sms(edje_group):
if self.page < 0:
self.page = 0
self.current = self.messagebook[self.page*6:(self.page+1)*6]
- text = u"".join( [u"□"]*self.page+[u"▣"]+[u"□"]*(self.pages-self.page-1) ).encode( 'utf-8', 'replace' )
+ text = u"".join( [u"□"]*self.page+[u"▣"]+[u"□"]*(self.pages-self.page-1) )
self.part_text_set( "pager", text )
for i in range( 0, len( self.current ) ):
main_text = self.main.groups["contacts"].tryNumberToName( self.current[i][2] )
@@ -750,7 +750,7 @@ class pyphone_contacts(edje_group):
if self.page < 0:
self.page = 0
self.current = self.phonebook[self.page*6:(self.page+1)*6]
- text = u"".join( [u"□"]*self.page+[u"▣"]+[u"□"]*(self.pages-self.page-1) ).encode('utf-8', 'replace')
+ text = u"".join( [u"□"]*self.page+[u"▣"]+[u"□"]*(self.pages-self.page-1) )
self.part_text_set( "pager", text )
for i in range( 0, len( self.current ) ):
self.part_text_set( "label_main_list_%i" % i, self.current[i][1] )
@@ -1181,7 +1181,7 @@ class pyphone_message(edje_group):
def set_button_text(self, num):
for i in xrange(4):
for j in xrange(4):
- text = self.button_labels[num][j][i].encode('utf-8', 'replace')
+ text = self.button_labels[num][j][i]
self.part_text_set("label_%d_%d" % (i,j) , text)
self.active = num
@@ -1190,7 +1190,7 @@ class pyphone_message(edje_group):
for i in xrange(4):
for j in xrange(4):
- text = self.button_labels2[num][j][i].encode('utf-8', 'replace')
+ text = self.button_labels2[num][j][i]
self.part_text_set("label2_%d_%d" % (i,j) , text)
#----------------------------------------------------------------------------#
--
freesmartphone.org demo GUI
More information about the pkg-fso-commits
mailing list