本文整理汇总了Python中xdg.DesktopEntry.DesktopEntry.getKeywords方法的典型用法代码示例。如果您正苦于以下问题:Python DesktopEntry.getKeywords方法的具体用法?Python DesktopEntry.getKeywords怎么用?Python DesktopEntry.getKeywords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xdg.DesktopEntry.DesktopEntry
的用法示例。
在下文中一共展示了DesktopEntry.getKeywords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from xdg.DesktopEntry import DesktopEntry [as 别名]
# 或者: from xdg.DesktopEntry.DesktopEntry import getKeywords [as 别名]
class VeraCCModule:
""" An object representing a Vera Control Center module. """
def __init__(self, module_name, module_path):
""" Initialize the object """
self.module_is_external = False
self.module_name = module_name
self.module_path = module_path
self.launcher_icon = None
self.launcher_name = None
self.launcher_comment = None
self.launcher_section = None
self.module_launcher = DesktopEntry(os.path.join(self.module_path, "%s.desktop" % self.module_name))
# Icon
self.launcher_icon = self.module_launcher.getIcon()
if not self.launcher_icon:
self.launcher_icon = "preferences-system"
#ICON_THEME.connect("changed", lambda x: self.replace_icon(icon))
# Name
self.launcher_name = self.module_launcher.getName()
# Comment
self.launcher_comment = self.module_launcher.getComment()
# Section
self.launcher_section = self.module_launcher.get("X-VeraCC-Section")
# Keywords
self.launcher_keywords = [x.lower() for x in self.module_launcher.getKeywords()]
# External?
_exec = self.module_launcher.getExec()
if _exec:
# Yeah!
self.module_is_external = True
self.module_path = _exec