本文整理汇总了Python中gi.repository.Gio.Settings.list_schemas方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.list_schemas方法的具体用法?Python Settings.list_schemas怎么用?Python Settings.list_schemas使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gio.Settings
的用法示例。
在下文中一共展示了Settings.list_schemas方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ImitationPluginConfigError
# 需要导入模块: from gi.repository.Gio import Settings [as 别名]
# 或者: from gi.repository.Gio.Settings import list_schemas [as 别名]
from gi.repository.Gtk import accelerator_parse
from gi.repository.Gio import Settings
# Check if gschema installed
if 'org.gnome.gedit.plugins.imitation' not in Settings.list_schemas():
class ImitationPluginConfigError(Exception):
pass
raise ImitationPluginConfigError('Imitation gschema not installed')
# Functions for getting config values
s = Settings.new('org.gnome.gedit.plugins.imitation').get_string
def p(accel_str):
""" Parse accelerator string and warn of invalid formats """
# Always results in lowercase keyvals (accounted for when matching)
accel = accelerator_parse(accel_str)
if accel[0] == 0:
print('Imitation plugin: invalid accelerator string "' + accel_str + '"')
return accel
# configurable (restart gedit to apply changes)
MARK_TOGGLE = p(s('mark-toggle'))
MARK_UP = p(s('mark-up'))
MARK_DOWN = p(s('mark-down'))
MARK_ALT_UP = p(s('mark-alt-up'))
MARK_ALT_DOWN = p(s('mark-alt-down'))