def __init__(self, keywords): loc = get_locale_code("deepin-system-settings", get_parent_dir(__file__, 2) + "/locale") print loc if loc == "zh_HK": # No translation and search for HongKong loc = "zh_TW" self.search_db_dir = os.path.join(get_parent_dir(__file__, 2), "search_db/%s" % loc) self.__xappy = None self.__keywords = keywords
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. try: import deepin_gsettings except ImportError: print "----------Please Install Deepin GSettings Python Binding----------" print "git clone [email protected]:linuxdeepin/deepin-gsettings.git" print "------------------------------------------------------------------" import dbus from deepin_utils.ipc import is_dbus_name_exists from deepin_utils.file import get_parent_dir from dtk.ui.locales import get_locale_code from dss_nls import _ MAIN_LANG = get_locale_code("deepin-system-settings", get_parent_dir(__file__, 2) + "/locale") APP_DBUS_NAME = "com.deepin.system_settings" APP_OBJECT_NAME = "/com/deepin/system_settings" PAGE_WIDTH = 834 PAGE_HEIGHT = 474 HSEPARATOR_HEIGHT = 10 ''' 基准线 ''' STANDARD_LINE = 260 ''' module background color ''' MODULE_BG_COLOR = "#FFFFFF"
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import gettext import os from dtk.ui.locales import get_locale_code def get_parent_dir(filepath, level=1): '''Get parent dir.''' parent_dir = os.path.realpath(filepath) while (level > 0): parent_dir = os.path.dirname(parent_dir) level -= 1 return parent_dir LOCALE_DIR = os.path.join(get_parent_dir(__file__, 2), "locale") if not os.path.exists(LOCALE_DIR): LOCALE_DIR = "/usr/share/locale" _ = None try: _ = gettext.translation("deepin-system-settings", LOCALE_DIR).gettext except Exception, e: _ = lambda i: i LANGUAGE = get_locale_code("deepin-system-settings", LOCALE_DIR)
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. try: import deepin_gsettings except ImportError: print "----------Please Install Deepin GSettings Python Binding----------" print "git clone [email protected]:linuxdeepin/deepin-gsettings.git" print "------------------------------------------------------------------" import dbus from deepin_utils.ipc import is_dbus_name_exists from deepin_utils.file import get_parent_dir from dtk.ui.locales import get_locale_code from dss_nls import _ MAIN_LANG = get_locale_code("deepin-system-settings", get_parent_dir(__file__, 2) + "/locale") APP_DBUS_NAME = "com.deepin.system_settings" APP_OBJECT_NAME = "/com/deepin/system_settings" PAGE_WIDTH = 834 PAGE_HEIGHT = 474 HSEPARATOR_HEIGHT = 10 ''' 基准线 ''' STANDARD_LINE = 260 ''' module background color
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import gettext import os from dtk.ui.locales import get_locale_code def get_parent_dir(filepath, level=1): '''Get parent dir.''' parent_dir = os.path.realpath(filepath) while(level > 0): parent_dir = os.path.dirname(parent_dir) level -= 1 return parent_dir LOCALE_DIR=os.path.join(get_parent_dir(__file__, 2), "locale") if not os.path.exists(LOCALE_DIR): LOCALE_DIR="/usr/share/locale" _ = None try: _ = gettext.translation("deepin-system-settings", LOCALE_DIR).gettext except Exception, e: _ = lambda i : i LANGUAGE=get_locale_code("deepin-system-settings", LOCALE_DIR)