本文整理汇总了Python中plugin.Plugin.get_plugin_file方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.get_plugin_file方法的具体用法?Python Plugin.get_plugin_file怎么用?Python Plugin.get_plugin_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.get_plugin_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UniqueService
# 需要导入模块: from plugin import Plugin [as 别名]
# 或者: from plugin.Plugin import get_plugin_file [as 别名]
if __name__ == "__main__":
uniqueService = UniqueService(APP_DBUS_NAME, APP_OBJECT_NAME)
app = QApplication(sys.argv)
tray_icon = SystemTrayIcon(QIcon(os.path.join(get_parent_dir(__file__), "image", "trayicon.png")), app)
tray_icon.show()
(constant.TRAYAREA_TOP, constant.TRAYAREA_BOTTOM) = tray_icon.get_trayarea()
plugin = Plugin()
source_lang_model = LanguageModel()
dest_lang_model = LanguageModel()
word_engine_name = setting_config.get_translate_config("word_engine")
words_engine_name = setting_config.get_translate_config("words_engine")
translate_simple = imp.load_source("translate_simple", plugin.get_plugin_file(word_engine_name)).Translate()
translate_long = imp.load_source("translate_long", plugin.get_plugin_file(words_engine_name)).Translate()
word_translate_model = plugin.get_word_model(setting_config.get_translate_config("src_lang"), setting_config.get_translate_config("dst_lang"))
words_translate_model = plugin.get_words_model(setting_config.get_translate_config("src_lang"), setting_config.get_translate_config("dst_lang"))
translate_info = TranslateInfo()
setting_view = Window()
setting_view.qml_context.setContextProperty("sourceLangModel", source_lang_model)
setting_view.qml_context.setContextProperty("destLangModel", dest_lang_model)
setting_view.qml_context.setContextProperty("plugin", plugin)
setting_view.qml_context.setContextProperty("wordTranslateModel", word_translate_model)
setting_view.qml_context.setContextProperty("wordsTranslateModel", words_translate_model)
setting_view.qml_context.setContextProperty("screenWidth", screen_width)
setting_view.qml_context.setContextProperty("screenHeight", screen_height)
setting_view.qml_context.setContextProperty("windowView", setting_view)