I'm looking for space to save on the live cd, and I notice that the three biggest files in ibus are simply copies of files shipped in pygtk2: /usr/lib/python2.6/site-packages/ibus/keysyms.py and its compiled versions. Considering that you are depending on pygtk2 anyway, it would seem much better to simply use the file from pygtk2 instead of shipping a copy.
If use keysym from pygtk2, it has a problem. It will cause ibus python library must depend on X. If $DISPLAY does not exist, ibus can not import keysyms from pygtk successfully. BTW, I think I could remove two dicts to reduce the size of it.
What is the problem with depending on X, considering we are talking about an X input method there ?!
Also, doesn't this do what you need anyway ? mclasen@planemask system-config-selinux]$ python Python 2.6.2 (r262:71600, Jul 30 2009, 17:08:54) [GCC 4.4.1 20090725 (Red Hat 4.4.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from gtk import keysyms >>> print keysyms.KP_Home 65429 >>>
The ibus python library is also used by input method engine. And I think engines should not depend on X. For future, maybe we will use ibus without X. (For example in console, or frame buffer). Please try below commands: [phuang@phuang-notebook ~]$ unset DISPLAY [phuang@phuang-notebook ~]$ python Python 2.6 (r26:66714, Jun 8 2009, 16:07:26) [GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from gtk import keysyms Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 79, in <module> _init() File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 67, in _init _gtk.init_check() RuntimeError: could not open display >>>
> The ibus python library is also used by input method engine. And I think > engines should not depend on X. For future, maybe we will use ibus without X. > (For example in console, or frame buffer). If there's no X, then those X keysyms won't do you any good either.. but anyway, I'll make room somewhere else on the live cd.
Removed two dicts to reduce the size from 143K + 97K + 97K to 30K + 42K + 42K. Fixed in ibus-1.2.0.20090806-1.fc12 Before: -rw-r--r-- 1 root root 143K 08-03 14:54 /usr/lib/python2.6/site-packages/ibus/keysyms.py -rw-r--r-- 2 root root 97K 08-03 14:55 /usr/lib/python2.6/site-packages/ibus/keysyms.pyc -rw-r--r-- 2 root root 97K 08-03 14:55 /usr/lib/python2.6/site-packages/ibus/keysyms.pyo After: -rw-r--r-- 1 root root 30K 08-06 07:28 /usr/lib/python2.6/site-packages/ibus/keysyms.py -rw-r--r-- 2 root root 42K 08-06 07:28 /usr/lib/python2.6/site-packages/ibus/keysyms.pyc -rw-r--r-- 2 root root 42K 08-06 07:28 /usr/lib/python2.6/site-packages/ibus/keysyms.pyo