src/eric7/Plugins/PluginVcsSubversion.py

branch
eric7
changeset 10061
8bdad5699288
parent 9653
e67609152c5e
child 10069
435cc5875135
equal deleted inserted replaced
10060:b946699e9e79 10061:8bdad5699288
21 from eric7.Preferences.Shortcuts import readShortcuts 21 from eric7.Preferences.Shortcuts import readShortcuts
22 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities 22 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities
23 from eric7.UI import Info 23 from eric7.UI import Info
24 24
25 # Start-Of-Header 25 # Start-Of-Header
26 name = "Subversion Plugin" 26 __header__ = {
27 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 27 "name": "Subversion Plugin",
28 autoactivate = False 28 "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
29 deactivateable = True 29 "autoactivate": False,
30 version = Info.VersionOnly 30 "deactivateable": True,
31 pluginType = "version_control" 31 "version": Info.VersionOnly,
32 pluginTypename = "Subversion" 32 "pluginType": "version_control",
33 className = "VcsSubversionPlugin" 33 "pluginTypename": "Subversion",
34 packageName = "__core__" 34 "className": "VcsSubversionPlugin",
35 shortDescription = "Implements the Subversion version control interface." 35 "packageName": "__core__",
36 longDescription = """This plugin provides the Subversion version control interface.""" 36 "shortDescription": "Implements the Subversion version control interface.",
37 pyqtApi = 2 37 "longDescription": (
38 """This plugin provides the Subversion version control interface."""
39 ),
40 "pyqtApi": 2,
41 }
38 # End-Of-Header 42 # End-Of-Header
39 43
40 error = "" 44 error = "" # noqa: U200
41 45
42 46
43 def exeDisplayData(): 47 def exeDisplayData():
44 """ 48 """
45 Public method to support the display of some executable info. 49 Public method to support the display of some executable info.
72 Public function to get the indicators for this version control system. 76 Public function to get the indicators for this version control system.
73 77
74 @return dictionary with indicator as key and a tuple with the vcs name 78 @return dictionary with indicator as key and a tuple with the vcs name
75 (string) and vcs display string (string) 79 (string) and vcs display string (string)
76 """ 80 """
77 global pluginTypename 81 ##global pluginTypename
78 data = {} 82 data = {}
79 exe = "svn" 83 exe = "svn"
80 if OSUtilities.isWindowsPlatform(): 84 if OSUtilities.isWindowsPlatform():
81 exe += ".exe" 85 exe += ".exe"
82 if FileSystemUtilities.isinpath(exe): 86 if FileSystemUtilities.isinpath(exe):
83 data[".svn"] = (pluginTypename, displayString()) 87 data[".svn"] = (__header__["pluginTypename"], displayString())
84 data["_svn"] = (pluginTypename, displayString()) 88 data["_svn"] = (__header__["pluginTypename"], displayString())
85 return data 89 return data
86 90
87 91
88 def displayString(): 92 def displayString():
89 """ 93 """
173 } 177 }
174 178
175 self.__projectHelperObject = SvnProjectHelper(None, None) 179 self.__projectHelperObject = SvnProjectHelper(None, None)
176 with contextlib.suppress(KeyError): 180 with contextlib.suppress(KeyError):
177 ericApp().registerPluginObject( 181 ericApp().registerPluginObject(
178 pluginTypename, self.__projectHelperObject, pluginType 182 __header__["pluginTypename"],
179 ) 183 self.__projectHelperObject,
180 readShortcuts(pluginName=pluginTypename) 184 __header__["pluginType"],
185 )
186 readShortcuts(pluginName=__header__["pluginTypename"])
181 187
182 def getProjectHelper(self): 188 def getProjectHelper(self):
183 """ 189 """
184 Public method to get a reference to the project helper object. 190 Public method to get a reference to the project helper object.
185 191
286 292
287 def prepareUninstall(self): 293 def prepareUninstall(self):
288 """ 294 """
289 Public method to prepare for an uninstallation. 295 Public method to prepare for an uninstallation.
290 """ 296 """
291 ericApp().unregisterPluginObject(pluginTypename) 297 ericApp().unregisterPluginObject(__header__["pluginTypename"])
292 298
293 def prepareUnload(self): 299 def prepareUnload(self):
294 """ 300 """
295 Public method to prepare for an unload. 301 Public method to prepare for an unload.
296 """ 302 """
297 if self.__projectHelperObject: 303 if self.__projectHelperObject:
298 self.__projectHelperObject.removeToolbar( 304 self.__projectHelperObject.removeToolbar(
299 self.__ui, ericApp().getObject("ToolbarManager") 305 self.__ui, ericApp().getObject("ToolbarManager")
300 ) 306 )
301 ericApp().unregisterPluginObject(pluginTypename) 307 ericApp().unregisterPluginObject(__header__["pluginTypename"])

eric ide

mercurial