src/eric7/Plugins/PluginVcsGit.py

branch
eric7
changeset 10437
2f70ca07f0af
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10436:f6881d10e995 10437:2f70ca07f0af
43 """ 43 """
44 Public method to support the display of some executable info. 44 Public method to support the display of some executable info.
45 45
46 @return dictionary containing the data to query the presence of 46 @return dictionary containing the data to query the presence of
47 the executable 47 the executable
48 @rtype dict
48 """ 49 """
49 exe = "git" 50 exe = "git"
50 if OSUtilities.isWindowsPlatform(): 51 if OSUtilities.isWindowsPlatform():
51 exe += ".exe" 52 exe += ".exe"
52 53
67 def getVcsSystemIndicator(): 68 def getVcsSystemIndicator():
68 """ 69 """
69 Public function to get the indicators for this version control system. 70 Public function to get the indicators for this version control system.
70 71
71 @return dictionary with indicator as key and a tuple with the vcs name 72 @return dictionary with indicator as key and a tuple with the vcs name
72 (string) and vcs display string (string) 73 and vcs display string
74 @rtype dict
73 """ 75 """
74 ##global __header__ 76 ##global __header__
75 data = {} 77 data = {}
76 exe = "git" 78 exe = "git"
77 if OSUtilities.isWindowsPlatform(): 79 if OSUtilities.isWindowsPlatform():
84 86
85 def displayString(): 87 def displayString():
86 """ 88 """
87 Public function to get the display string. 89 Public function to get the display string.
88 90
89 @return display string (string) 91 @return display string
92 @rtype str
90 """ 93 """
91 exe = "git" 94 exe = "git"
92 if OSUtilities.isWindowsPlatform(): 95 if OSUtilities.isWindowsPlatform():
93 exe += ".exe" 96 exe += ".exe"
94 if FileSystemUtilities.isinpath(exe): 97 if FileSystemUtilities.isinpath(exe):
102 105
103 def createConfigurationPage(configDlg): # noqa: U100 106 def createConfigurationPage(configDlg): # noqa: U100
104 """ 107 """
105 Module function to create the configuration page. 108 Module function to create the configuration page.
106 109
107 @param configDlg reference to the configuration dialog (QDialog) 110 @param configDlg reference to the configuration dialog
111 @type QDialog
108 @return reference to the configuration page 112 @return reference to the configuration page
113 @rtype GitPage
109 """ 114 """
110 from eric7.Plugins.VcsPlugins.vcsGit.ConfigurationPage.GitPage import GitPage 115 from eric7.Plugins.VcsPlugins.vcsGit.ConfigurationPage.GitPage import GitPage
111 116
112 global gitCfgPluginObject 117 global gitCfgPluginObject
113 118
119 124
120 def getConfigData(): 125 def getConfigData():
121 """ 126 """
122 Module function returning data as required by the configuration dialog. 127 Module function returning data as required by the configuration dialog.
123 128
124 @return dictionary with key "zzz_gitPage" containing the relevant 129 @return dictionary with key "zzz_gitPage" containing the relevant data
125 data 130 @rtype dict
126 """ 131 """
127 return { 132 return {
128 "zzz_gitPage": [ 133 "zzz_gitPage": [
129 QCoreApplication.translate("VcsGitPlugin", "Git"), 134 QCoreApplication.translate("VcsGitPlugin", "Git"),
130 os.path.join("VcsPlugins", "vcsGit", "icons", "preferences-git.svg"), 135 os.path.join("VcsPlugins", "vcsGit", "icons", "preferences-git.svg"),
182 187
183 def __init__(self, ui): 188 def __init__(self, ui):
184 """ 189 """
185 Constructor 190 Constructor
186 191
187 @param ui reference to the user interface object (UI.UserInterface) 192 @param ui reference to the user interface object
193 @type UserInterface
188 """ 194 """
189 from eric7.Plugins.VcsPlugins.vcsGit.ProjectHelper import GitProjectHelper 195 from eric7.Plugins.VcsPlugins.vcsGit.ProjectHelper import GitProjectHelper
190 196
191 super().__init__(ui) 197 super().__init__(ui)
192 self.__ui = ui 198 self.__ui = ui
204 def getProjectHelper(self): 210 def getProjectHelper(self):
205 """ 211 """
206 Public method to get a reference to the project helper object. 212 Public method to get a reference to the project helper object.
207 213
208 @return reference to the project helper object 214 @return reference to the project helper object
215 @rtype GitProjectHelper
209 """ 216 """
210 return self.__projectHelperObject 217 return self.__projectHelperObject
211 218
212 def initToolbar(self, ui, toolbarManager): 219 def initToolbar(self, ui, toolbarManager):
213 """ 220 """
214 Public slot to initialize the VCS toolbar. 221 Public slot to initialize the VCS toolbar.
215 222
216 @param ui reference to the main window (UserInterface) 223 @param ui reference to the main window
224 @type UserInterface
217 @param toolbarManager reference to a toolbar manager object 225 @param toolbarManager reference to a toolbar manager object
218 (EricToolBarManager) 226 @type EricToolBarManager
219 """ 227 """
220 if self.__projectHelperObject: 228 if self.__projectHelperObject:
221 self.__projectHelperObject.initToolbar(ui, toolbarManager) 229 self.__projectHelperObject.initToolbar(ui, toolbarManager)
222 230
223 def activate(self): 231 def activate(self):
224 """ 232 """
225 Public method to activate this plugin. 233 Public method to activate this plugin.
226 234
227 @return tuple of reference to instantiated viewmanager and 235 @return tuple of reference to instantiated version control and
228 activation status (boolean) 236 activation status
237 @rtype tuple of (Git, bool)
229 """ 238 """
230 from eric7.Plugins.VcsPlugins.vcsGit.git import Git 239 from eric7.Plugins.VcsPlugins.vcsGit.git import Git
231 240
232 self.__object = Git(self, self.__ui) 241 self.__object = Git(self, self.__ui)
233 242
259 def getPreferences(cls, key): 268 def getPreferences(cls, key):
260 """ 269 """
261 Class method to retrieve the various settings. 270 Class method to retrieve the various settings.
262 271
263 @param key the key of the value to get 272 @param key the key of the value to get
273 @type str
264 @return the requested setting 274 @return the requested setting
275 @rtype Any
265 """ 276 """
266 if key in [ 277 if key in [
267 "StopLogOnCopy", 278 "StopLogOnCopy",
268 "ShowReflogInfo", 279 "ShowReflogInfo",
269 "ShowAuthorColumns", 280 "ShowAuthorColumns",
302 def setPreferences(cls, key, value): 313 def setPreferences(cls, key, value):
303 """ 314 """
304 Class method to store the various settings. 315 Class method to store the various settings.
305 316
306 @param key the key of the setting to be set 317 @param key the key of the setting to be set
318 @type str
307 @param value the value to be set 319 @param value the value to be set
320 @type Any
308 """ 321 """
309 Preferences.getSettings().setValue("Git/" + key, value) 322 Preferences.getSettings().setValue("Git/" + key, value)
310 323
311 def getConfigPath(self): 324 def getConfigPath(self):
312 """ 325 """
313 Public method to get the filename of the config file. 326 Public method to get the filename of the config file.
314 327
315 @return filename of the config file (string) 328 @return filename of the config file
329 @rtype str
316 """ 330 """
317 return getConfigPath() 331 return getConfigPath()
318 332
319 def prepareUninstall(self): 333 def prepareUninstall(self):
320 """ 334 """

eric ide

mercurial