eric6/Plugins/PluginVcsMercurial.py

changeset 8240
93b8a353c4bf
parent 8218
7c09585bd960
child 8288
809d5d5ac2ba
equal deleted inserted replaced
8239:59a9a658618c 8240:93b8a353c4bf
6 """ 6 """
7 Module implementing the Mercurial version control plugin. 7 Module implementing the Mercurial version control plugin.
8 """ 8 """
9 9
10 import os 10 import os
11 import contextlib
11 12
12 from PyQt5.QtCore import QObject, QCoreApplication, QByteArray 13 from PyQt5.QtCore import QObject, QCoreApplication, QByteArray
13 14
14 from E5Gui.E5Application import e5App 15 from E5Gui.E5Application import e5App
15 16
195 super().__init__(ui) 196 super().__init__(ui)
196 self.__ui = ui 197 self.__ui = ui
197 198
198 from VcsPlugins.vcsMercurial.ProjectHelper import HgProjectHelper 199 from VcsPlugins.vcsMercurial.ProjectHelper import HgProjectHelper
199 self.__projectHelperObject = HgProjectHelper(None, None) 200 self.__projectHelperObject = HgProjectHelper(None, None)
200 try: 201 with contextlib.suppress(KeyError):
201 e5App().registerPluginObject( 202 e5App().registerPluginObject(
202 pluginTypename, self.__projectHelperObject, pluginType) 203 pluginTypename, self.__projectHelperObject, pluginType)
203 except KeyError:
204 pass # ignore duplicate registration
205 readShortcuts(pluginName=pluginTypename) 204 readShortcuts(pluginName=pluginTypename)
206 205
207 def getProjectHelper(self): 206 def getProjectHelper(self):
208 """ 207 """
209 Public method to get a reference to the project helper object. 208 Public method to get a reference to the project helper object.

eric ide

mercurial