Skip to content

Commit

Permalink
Strip _ from resource strings
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier gillet committed Apr 21, 2011
1 parent 9cb731c commit 2801fc4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/resources_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def Canonicalize(x):
out_chr[i] = ord('x')
elif chr(i) == '"':
out_chr[i] = ord('p')
elif chr(i) == '|':
out_chr[i] = ord('v')
else:
out_chr[i] = ord('_')
table = string.maketrans(in_chr, ''.join(map(chr, out_chr)))
Expand Down Expand Up @@ -141,7 +143,7 @@ def GenerateCc(base_name, res):
if python_type == str:
for string in resource:
args = (c_type, '%s_%s' % (prefix.lower(), Canonicalize(string)),
res.modifier, string.strip())
res.modifier, string.strip().replace('_', ' '))
f.write('static const %s %s[] %s = "%s";\n' % args)
if ram:
args = (c_type, table_name)
Expand Down

0 comments on commit 2801fc4

Please sign in to comment.