File: test.py

package info (click to toggle)
libchewing 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,220 kB
  • ctags: 10,179
  • sloc: ansic: 103,539; sh: 11,563; makefile: 316; python: 98
file content (21 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import chewing

chewing.Init('/usr/share/chewing', '/tmp')
ctx = chewing.ChewingContext()
ctx.Configure (18, 16, 0, 1, 0);
ctx.set_ChiEngMode(1)
ctx.handle_Default("g")
ctx.handle_Default("j")
ctx.handle_Space()
print ctx.buffer_String()
ctx.handle_Default("b")
ctx.handle_Default("j")
ctx.handle_Default("4")
ctx.handle_Default("z")
ctx.handle_Default("8")
ctx.handle_Default("3")
ctx.handle_Enter()
print ctx.commit_String()
ctx = None