当前位置: 首页>>代码示例>>Python>>正文


Python DesktopEntry.getKeywords方法代码示例

本文整理汇总了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
开发者ID:vera-desktop,项目名称:vera-control-center,代码行数:44,代码来源:module.py


注:本文中的xdg.DesktopEntry.DesktopEntry.getKeywords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。