[gtk+] Update compose-parse.py
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Update compose-parse.py
- Date: Fri, 10 Jun 2011 22:34:19 +0000 (UTC)
commit 0bbc2ed5200ed4a37ef476ec6617d82e370603c2
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 10 18:33:05 2011 -0400
Update compose-parse.py
This update makes compose-parse.py work with Unicode 6.0 and make
it generate the new GDK_KEY_ defines. Patch by Ryo Hashimoto,
bug 651979.
gtk/compose-parse.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/compose-parse.py b/gtk/compose-parse.py
index 18d9f3f..19db9a2 100755
--- a/gtk/compose-parse.py
+++ b/gtk/compose-parse.py
@@ -24,7 +24,7 @@ import getopt
URL_COMPOSE = 'http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=blob_plain;f=nls/en_US.UTF-8/Compose.pre'
URL_KEYSYMSTXT = "http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt"
URL_GDKKEYSYMSH = "http://git.gnome.org/browse/gtk%2B/plain/gdk/gdkkeysyms.h"
-URL_UNICODEDATATXT = 'http://www.unicode.org/Public/5.2.0/ucd/UnicodeData.txt'
+URL_UNICODEDATATXT = 'http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt'
FILENAME_COMPOSE_SUPPLEMENTARY = 'gtk-compose-lookaside.txt'
# We currently support keysyms of size 2; once upstream xorg gets sorted,
@@ -270,7 +270,7 @@ def process_gdkkeysymsh():
unival = long(components[2][2:], 16)
if unival == 0:
continue
- keysymdb[components[1][4:]] = unival
+ keysymdb[components[1][8:]] = unival
else:
print "Invalid line %(linenum)d in %(filename)s: %(line)s"\
% {'linenum': linenum_gdkkeysymsh, 'filename': filename_gdkkeysymsh, 'line': line}
@@ -354,6 +354,8 @@ def process_keysymstxt():
keysymdb['dead_stroke'] = 0x338
""" This is for a missing keysym from Markus Kuhn's db """
keysymdb['Oslash'] = 0x0d8
+ """ This is for a missing keysym from Markus Kuhn's db """
+ keysymdb['Ssharp'] = 0x1e9e
""" This is for a missing (recently added) keysym """
keysymdb['dead_psili'] = 0x313
@@ -755,11 +757,11 @@ for sequence in xorg_compose_sequences_algorithmic_uniqued:
if opt_algorithmic:
for sequence in xorg_compose_sequences_algorithmic_uniqued:
letter = "".join(sequence[-1:])
- print '0x%(cp)04X, %(uni)c, seq: [ <0x%(base)04X>,' % { 'cp': ord(unicode(letter)), 'uni': letter, 'base': sequence[-2] },
+ print '0x%(cp)04X, %(uni)s, seq: [ <0x%(base)04X>,' % { 'cp': ord(unicode(letter)), 'uni': letter.encode('utf-8'), 'base': sequence[-2] },
for elem in sequence[:-2]:
print "<0x%(keysym)04X>," % { 'keysym': elem },
""" Yeah, verified... We just want to keep the output similar to -u, so we can compare/sort easily """
- print "], recomposed as", letter, "verified"
+ print "], recomposed as", letter.encode('utf-8'), "verified"
def num_of_keysyms(seq):
return len(seq) - 1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]