Go to the documentation of this file.00001 from roslib.packages import get_pkg_dir
00002 from python_qt_binding.QtGui import *
00003 from python_qt_binding.QtCore import *
00004 from airbus_cobot_gui.context import Context
00005 from plugin_provider import PluginProvider
00006 from plugin import Plugin
00007 from xml.etree import ElementTree as ET
00008
00009 def getStandAloneInstance(pkg_name, plugin_class, lng="en"):
00010
00011 plugin_instance = plugin_class(Context(QMainWindow()))
00012
00013 plugin_descriptor = ET.parse("%s/plugin_descriptor.xml"%get_pkg_dir(pkg_name))
00014
00015 plugin_params = PluginProvider.getParameters(plugin_descriptor.getroot(), None)
00016
00017 plugin_instance.tryToCreate(plugin_params)
00018
00019 plugin_instance.tryToResume()
00020
00021 plugin_instance.onTranslate(lng)
00022
00023 return plugin_instance