direct-io.hg

changeset 15479:d49e6a814d9a

[ACM] Support for initial unicode handling of strings in policies.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author kfraser@localhost.localdomain
date Fri Jul 06 14:43:51 2007 +0100 (2007-07-06)
parents 05331a29f3cb
children daa07db3ca84
files tools/security/xensec_ezpolicy
line diff
     1.1 --- a/tools/security/xensec_ezpolicy	Fri Jul 06 14:42:55 2007 +0100
     1.2 +++ b/tools/security/xensec_ezpolicy	Fri Jul 06 14:43:51 2007 +0100
     1.3 @@ -1102,8 +1102,10 @@ def org2dict():
     1.4      for i in iterchildren(app.win.orgs.GetRootItem()):
     1.5          d = []
     1.6          for j in iterchildren(i):
     1.7 -            d.append(str(app.win.orgspanel.orgs.GetItemText(j)))
     1.8 -        o.append([str(app.win.orgspanel.orgs.GetItemText(i)) , d])
     1.9 +            d.append(
    1.10 +                  str(app.win.orgspanel.orgs.GetItemText(j).encode("utf-8")))
    1.11 +        o.append([str(app.win.orgspanel.orgs.GetItemText(i).encode("utf-8")),
    1.12 +                 d])
    1.13      dic['orgs'] = o
    1.14      c=[]
    1.15      for i in app.win.conspanel.conflictsets:
    1.16 @@ -1175,12 +1177,14 @@ def printPolicy(fd, types, cons):
    1.17                  continue
    1.18              #name is optional but must be set
    1.19              if i[0]:
    1.20 -                rer_name = str(i[0])
    1.21 +                rer_name = i[0]
    1.22              else:
    1.23 -                rer_name = str("RER")
    1.24 -            fd.write("""            <Conflict name=\"%s\">\n""" % rer_name)
    1.25 +                rer_name = "RER"
    1.26 +            fd.write("""            <Conflict name=\"""" +
    1.27 +                     rer_name.encode("utf-8") + """\">\n""")
    1.28              for j in i[1]:
    1.29 -                fd.write("""                <Type>%s</Type>\n""" % str(j))
    1.30 +                typ = j.encode("utf-8")
    1.31 +                fd.write("""                <Type>%s</Type>\n""" % typ)
    1.32              fd.write("""            </Conflict>\n""")
    1.33          fd.write("""       </ConflictSets>\n""")
    1.34