From: Stefan Berger Subject: [PATCH] [TOOLS] Unicode support for ezpolicy tool Date: Sat, 23 Jun 2007 16:26:45 -0400 Message-ID: <1182630405.23370.11.camel@gsal-3.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-KLFrDowDQQtx2pAw/rgT" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --=-KLFrDowDQQtx2pAw/rgT Content-Type: text/plain Content-Transfer-Encoding: 7bit Support for initial unicode handling of strings in policies. Signed-off-by: Stefan Berger --=-KLFrDowDQQtx2pAw/rgT Content-Disposition: attachment; filename=ezpolicy_utf8.diff Content-Type: text/x-patch; name=ezpolicy_utf8.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/security/xensec_ezpolicy =================================================================== --- root.orig/xen-unstable.hg/tools/security/xensec_ezpolicy +++ root/xen-unstable.hg/tools/security/xensec_ezpolicy @@ -1102,8 +1102,10 @@ def org2dict(): for i in iterchildren(app.win.orgs.GetRootItem()): d = [] for j in iterchildren(i): - d.append(str(app.win.orgspanel.orgs.GetItemText(j))) - o.append([str(app.win.orgspanel.orgs.GetItemText(i)) , d]) + d.append( + str(app.win.orgspanel.orgs.GetItemText(j).encode("utf-8"))) + o.append([str(app.win.orgspanel.orgs.GetItemText(i).encode("utf-8")), + d]) dic['orgs'] = o c=[] for i in app.win.conspanel.conflictsets: @@ -1175,12 +1177,14 @@ def printPolicy(fd, types, cons): continue #name is optional but must be set if i[0]: - rer_name = str(i[0]) + rer_name = i[0] else: - rer_name = str("RER") - fd.write(""" \n""" % rer_name) + rer_name = "RER" + fd.write(""" \n""") for j in i[1]: - fd.write(""" %s\n""" % str(j)) + typ = j.encode("utf-8") + fd.write(""" %s\n""" % typ) fd.write(""" \n""") fd.write(""" \n""") --=-KLFrDowDQQtx2pAw/rgT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-KLFrDowDQQtx2pAw/rgT--