src/eric7/Plugins/PluginVcsGit.py

branch
eric7
changeset 10061
8bdad5699288
parent 9653
e67609152c5e
child 10069
435cc5875135
equal deleted inserted replaced
10060:b946699e9e79 10061:8bdad5699288
18 from eric7.Preferences.Shortcuts import readShortcuts 18 from eric7.Preferences.Shortcuts import readShortcuts
19 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities 19 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities
20 from eric7.UI import Info 20 from eric7.UI import Info
21 21
22 # Start-Of-Header 22 # Start-Of-Header
23 name = "Git Plugin" 23 __header__ = {
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 24 "name": "Git Plugin",
25 autoactivate = False 25 "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
26 deactivateable = True 26 "autoactivate": False,
27 version = Info.VersionOnly 27 "deactivateable": True,
28 pluginType = "version_control" 28 "version": Info.VersionOnly,
29 pluginTypename = "Git" 29 "pluginType": "version_control",
30 className = "VcsGitPlugin" 30 "pluginTypename": "Git",
31 packageName = "__core__" 31 "className": "VcsGitPlugin",
32 shortDescription = "Implements the Git version control interface." 32 "packageName": "__core__",
33 longDescription = """This plugin provides the Git version control interface.""" 33 "shortDescription": "Implements the Git version control interface.",
34 pyqtApi = 2 34 "longDescription": """This plugin provides the Git version control interface.""",
35 "pyqtApi": 2,
36 }
35 # End-Of-Header 37 # End-Of-Header
36 38
37 error = "" 39 error = "" # noqa: U200
38 40
39 41
40 def exeDisplayData(): 42 def exeDisplayData():
41 """ 43 """
42 Public method to support the display of some executable info. 44 Public method to support the display of some executable info.
67 Public function to get the indicators for this version control system. 69 Public function to get the indicators for this version control system.
68 70
69 @return dictionary with indicator as key and a tuple with the vcs name 71 @return dictionary with indicator as key and a tuple with the vcs name
70 (string) and vcs display string (string) 72 (string) and vcs display string (string)
71 """ 73 """
72 global pluginTypename 74 ##global __header__
73 data = {} 75 data = {}
74 exe = "git" 76 exe = "git"
75 if OSUtilities.isWindowsPlatform(): 77 if OSUtilities.isWindowsPlatform():
76 exe += ".exe" 78 exe += ".exe"
77 if FileSystemUtilities.isinpath(exe): 79 if FileSystemUtilities.isinpath(exe):
78 data[".git"] = (pluginTypename, displayString()) 80 data[".git"] = (__header__["pluginTypename"], displayString())
79 data["_git"] = (pluginTypename, displayString()) 81 data["_git"] = (__header__["pluginTypename"], displayString())
80 return data 82 return data
81 83
82 84
83 def displayString(): 85 def displayString():
84 """ 86 """
190 self.__ui = ui 192 self.__ui = ui
191 193
192 self.__projectHelperObject = GitProjectHelper(None, None) 194 self.__projectHelperObject = GitProjectHelper(None, None)
193 with contextlib.suppress(KeyError): 195 with contextlib.suppress(KeyError):
194 ericApp().registerPluginObject( 196 ericApp().registerPluginObject(
195 pluginTypename, self.__projectHelperObject, pluginType 197 __header__["pluginTypename"],
198 self.__projectHelperObject,
199 __header__["pluginType"],
196 ) 200 )
197 201
198 readShortcuts(pluginName=pluginTypename) 202 readShortcuts(pluginName=__header__["pluginTypename"])
199 203
200 def getProjectHelper(self): 204 def getProjectHelper(self):
201 """ 205 """
202 Public method to get a reference to the project helper object. 206 Public method to get a reference to the project helper object.
203 207
314 318
315 def prepareUninstall(self): 319 def prepareUninstall(self):
316 """ 320 """
317 Public method to prepare for an uninstallation. 321 Public method to prepare for an uninstallation.
318 """ 322 """
319 ericApp().unregisterPluginObject(pluginTypename) 323 ericApp().unregisterPluginObject(__header__["pluginTypename"])
320 324
321 def prepareUnload(self): 325 def prepareUnload(self):
322 """ 326 """
323 Public method to prepare for an unload. 327 Public method to prepare for an unload.
324 """ 328 """
325 if self.__projectHelperObject: 329 if self.__projectHelperObject:
326 self.__projectHelperObject.removeToolbar( 330 self.__projectHelperObject.removeToolbar(
327 self.__ui, ericApp().getObject("ToolbarManager") 331 self.__ui, ericApp().getObject("ToolbarManager")
328 ) 332 )
329 ericApp().unregisterPluginObject(pluginTypename) 333 ericApp().unregisterPluginObject(__header__["pluginTypename"])
330 334
331 335
332 # 336 #
333 # eflag: noqa = M801 337 # eflag: noqa = M801

eric ide

mercurial