E5Gui/E5Application.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2990
583beaf0b4b8
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
62 @param object reference to the plugin object 62 @param object reference to the plugin object
63 @keyparam pluginType type of the plugin object (string) 63 @keyparam pluginType type of the plugin object (string)
64 @exception KeyError raised when the given name is already in use 64 @exception KeyError raised when the given name is already in use
65 """ 65 """
66 if name in self.__pluginObjectRegistry: 66 if name in self.__pluginObjectRegistry:
67 raise KeyError('Pluginobject "{0}" already registered.'.format(name)) 67 raise KeyError(
68 'Pluginobject "{0}" already registered.'.format(name))
68 else: 69 else:
69 self.__pluginObjectRegistry[name] = (object, pluginType) 70 self.__pluginObjectRegistry[name] = (object, pluginType)
70 71
71 def unregisterPluginObject(self, name): 72 def unregisterPluginObject(self, name):
72 """ 73 """
86 @exception KeyError raised when the given name is not known 87 @exception KeyError raised when the given name is not known
87 """ 88 """
88 if name in self.__pluginObjectRegistry: 89 if name in self.__pluginObjectRegistry:
89 return self.__pluginObjectRegistry[name][0] 90 return self.__pluginObjectRegistry[name][0]
90 else: 91 else:
91 raise KeyError('Pluginobject "{0}" is not registered.'.format(name)) 92 raise KeyError(
93 'Pluginobject "{0}" is not registered.'.format(name))
92 94
93 def getPluginObjects(self): 95 def getPluginObjects(self):
94 """ 96 """
95 Public method to get a list of (name, reference) pairs of all 97 Public method to get a list of (name, reference) pairs of all
96 registered plugin objects. 98 registered plugin objects.
111 @exception KeyError raised when the given name is not known 113 @exception KeyError raised when the given name is not known
112 """ 114 """
113 if name in self.__pluginObjectRegistry: 115 if name in self.__pluginObjectRegistry:
114 return self.__pluginObjectRegistry[name][1] 116 return self.__pluginObjectRegistry[name][1]
115 else: 117 else:
116 raise KeyError('Pluginobject "{0}" is not registered.'.format(name)) 118 raise KeyError(
119 'Pluginobject "{0}" is not registered.'.format(name))
117 120
118 e5App = QCoreApplication.instance 121 e5App = QCoreApplication.instance

eric ide

mercurial