Ejemplo n.º 1
0
import os
import re
import sys
import optparse
from signal import signal, SIGTERM, SIGINT

from gi import require_version
require_version('IBus', '1.0')
from gi.repository import IBus
from gi.repository import GLib

import factory
import tabsqlitedb
import ibus_table_location

DB_DIR = os.path.join(ibus_table_location.data(), 'tables')
BYO_DB_DIR = os.path.join(ibus_table_location.data_home(), "byo-tables")
ICON_DIR = os.path.join(ibus_table_location.data(), 'icons')
SETUP_CMD = os.path.join(ibus_table_location.lib(), "ibus-setup-table")
LOGFILE = os.path.join(ibus_table_location.cache_home(), 'debug.log')

_OPTION_PARSER = optparse.OptionParser()

_OPTION_PARSER.set_usage('%prog --table a_table.db')
_OPTION_PARSER.add_option(
    '--table', '-t',
    action='store',
    type='string',
    dest='db',
    default='',
    help='Set the IME table file, default: %default')
Ejemplo n.º 2
0
#

import os
import sys
import optparse
from gi.repository import IBus
from gi.repository import GLib
import re
from signal import signal, SIGTERM, SIGINT

import factory
import tabsqlitedb

import ibus_table_location

db_dir = os.path.join (ibus_table_location.data(), 'tables')
byo_db_dir = os.path.join(ibus_table_location.data_home(), "byo-tables")
icon_dir = os.path.join (ibus_table_location.data(), 'icons')
setup_cmd = os.path.join(ibus_table_location.lib(), "ibus-setup-table")
logfile = os.path.join(ibus_table_location.cache_home(), 'debug.log')

opt = optparse.OptionParser()

opt.set_usage ('%prog --table a_table.db')
opt.add_option(
    '--table', '-t',
    action = 'store',
    type = 'string',
    dest = 'db',
    default = '',
    help = 'Set the IME table file, default: %default')