本文整理汇总了Python中gi.repository.Keybinder.supported方法的典型用法代码示例。如果您正苦于以下问题:Python Keybinder.supported方法的具体用法?Python Keybinder.supported怎么用?Python Keybinder.supported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Keybinder
的用法示例。
在下文中一共展示了Keybinder.supported方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_available
# 需要导入模块: from gi.repository import Keybinder [as 别名]
# 或者: from gi.repository.Keybinder import supported [as 别名]
def is_available():
"""
Return True if keybindings are available.
"""
if Keybinder is None:
return False
else:
try:
return Keybinder.supported()
except AttributeError:
return True
示例2: enable
# 需要导入模块: from gi.repository import Keybinder [as 别名]
# 或者: from gi.repository.Keybinder import supported [as 别名]
def enable(self, exaile):
broken = False
if hasattr(Keybinder, 'supported'):
# introduced in Keybinder-3.0 0.3.2, see
# https://github.com/kupferlauncher/keybinder/blob/master/NEWS
if not Keybinder.supported():
broken = True
elif not guiutil.platform_is_x11():
broken = True
if broken:
raise Exception(
_(
'Keybinder is not supported on this platform! '
'It is only supported on X servers.'
)
)
self.__exaile = exaile