src/eric7/Plugins/PluginVcsPySvn.py

branch
eric7
changeset 10437
2f70ca07f0af
parent 10331
c1a2ff7e3575
child 10439
21c28b0f9e41
equal deleted inserted replaced
10436:f6881d10e995 10437:2f70ca07f0af
42 def exeDisplayData(): 42 def exeDisplayData():
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 be shown 46 @return dictionary containing the data to be shown
47 @rtype dict
47 """ 48 """
48 try: 49 try:
49 import pysvn # __IGNORE_WARNING_I10__ 50 import pysvn # __IGNORE_WARNING_I10__
50 51
51 try: 52 try:
72 def getVcsSystemIndicator(): 73 def getVcsSystemIndicator():
73 """ 74 """
74 Public function to get the indicators for this version control system. 75 Public function to get the indicators for this version control system.
75 76
76 @return dictionary with indicator as key and a tuple with the vcs name 77 @return dictionary with indicator as key and a tuple with the vcs name
77 (string) and vcs display string (string) 78 and vcs display string
79 @rtype dict
78 """ 80 """
79 return { 81 return {
80 ".svn": (__header__["pluginTypename"], displayString()), 82 ".svn": (__header__["pluginTypename"], displayString()),
81 "_svn": (__header__["pluginTypename"], displayString()), 83 "_svn": (__header__["pluginTypename"], displayString()),
82 } 84 }
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 if importlib.util.find_spec("pysvn") is None: 94 if importlib.util.find_spec("pysvn") is None:
92 return "" 95 return ""
93 else: 96 else:
94 return QCoreApplication.translate("VcsPySvnPlugin", "Subversion (pysvn)") 97 return QCoreApplication.translate("VcsPySvnPlugin", "Subversion (pysvn)")
99 102
100 def createConfigurationPage(configDlg): # noqa: U100 103 def createConfigurationPage(configDlg): # noqa: U100
101 """ 104 """
102 Module function to create the configuration page. 105 Module function to create the configuration page.
103 106
104 @param configDlg reference to the configuration dialog (QDialog) 107 @param configDlg reference to the configuration dialog
108 @type QDialog
105 @return reference to the configuration page 109 @return reference to the configuration page
110 @rtype SubversionPage
106 """ 111 """
107 from eric7.Plugins.VcsPlugins.vcsPySvn.ConfigurationPage.SubversionPage import ( 112 from eric7.Plugins.VcsPlugins.vcsPySvn.ConfigurationPage.SubversionPage import (
108 SubversionPage, 113 SubversionPage,
109 ) 114 )
110 115
120 """ 125 """
121 Module function returning data as required by the configuration dialog. 126 Module function returning data as required by the configuration dialog.
122 127
123 @return dictionary with key "zzz_subversionPage" containing the relevant 128 @return dictionary with key "zzz_subversionPage" containing the relevant
124 data 129 data
130 @rtype dict
125 """ 131 """
126 return { 132 return {
127 "zzz_subversionPage": [ 133 "zzz_subversionPage": [
128 QCoreApplication.translate("VcsPySvnPlugin", "Subversion"), 134 QCoreApplication.translate("VcsPySvnPlugin", "Subversion"),
129 os.path.join( 135 os.path.join(
151 157
152 def __init__(self, ui): 158 def __init__(self, ui):
153 """ 159 """
154 Constructor 160 Constructor
155 161
156 @param ui reference to the user interface object (UI.UserInterface) 162 @param ui reference to the user interface object
163 @type UserInterface
157 """ 164 """
158 from eric7.Plugins.VcsPlugins.vcsPySvn.ProjectHelper import PySvnProjectHelper 165 from eric7.Plugins.VcsPlugins.vcsPySvn.ProjectHelper import PySvnProjectHelper
159 166
160 super().__init__(ui) 167 super().__init__(ui)
161 self.__ui = ui 168 self.__ui = ui
177 def getProjectHelper(self): 184 def getProjectHelper(self):
178 """ 185 """
179 Public method to get a reference to the project helper object. 186 Public method to get a reference to the project helper object.
180 187
181 @return reference to the project helper object 188 @return reference to the project helper object
189 @rtype PySvnProjectHelper
182 """ 190 """
183 return self.__projectHelperObject 191 return self.__projectHelperObject
184 192
185 def initToolbar(self, ui, toolbarManager): 193 def initToolbar(self, ui, toolbarManager):
186 """ 194 """
187 Public slot to initialize the VCS toolbar. 195 Public slot to initialize the VCS toolbar.
188 196
189 @param ui reference to the main window (UserInterface) 197 @param ui reference to the main window
198 @type UserInterface
190 @param toolbarManager reference to a toolbar manager object 199 @param toolbarManager reference to a toolbar manager object
191 (EricToolBarManager) 200 @type EricToolBarManager
192 """ 201 """
193 if self.__projectHelperObject: 202 if self.__projectHelperObject:
194 self.__projectHelperObject.initToolbar(ui, toolbarManager) 203 self.__projectHelperObject.initToolbar(ui, toolbarManager)
195 204
196 def activate(self): 205 def activate(self):
197 """ 206 """
198 Public method to activate this plugin. 207 Public method to activate this plugin.
199 208
200 @return tuple of reference to instantiated viewmanager and 209 @return tuple of reference to instantiated viewmanager and
201 activation status (boolean) 210 activation status
211 @rtype tuple of (Subversion, bool)
202 """ 212 """
203 from eric7.Plugins.VcsPlugins.vcsPySvn.subversion import Subversion 213 from eric7.Plugins.VcsPlugins.vcsPySvn.subversion import Subversion
204 214
205 self.__object = Subversion(self, self.__ui) 215 self.__object = Subversion(self, self.__ui)
206 216
231 def getPreferences(self, key): 241 def getPreferences(self, key):
232 """ 242 """
233 Public method to retrieve the various settings. 243 Public method to retrieve the various settings.
234 244
235 @param key the key of the value to get 245 @param key the key of the value to get
246 @type str
236 @return the requested refactoring setting 247 @return the requested refactoring setting
248 @rtype Any
237 """ 249 """
238 if key in ["StopLogOnCopy"]: 250 if key in ["StopLogOnCopy"]:
239 return Preferences.toBool( 251 return Preferences.toBool(
240 Preferences.getSettings().value( 252 Preferences.getSettings().value(
241 "Subversion/" + key, self.__subversionDefaults[key] 253 "Subversion/" + key, self.__subversionDefaults[key]
257 def setPreferences(self, key, value): 269 def setPreferences(self, key, value):
258 """ 270 """
259 Public method to store the various settings. 271 Public method to store the various settings.
260 272
261 @param key the key of the setting to be set 273 @param key the key of the setting to be set
274 @type str
262 @param value the value to be set 275 @param value the value to be set
276 @type Any
263 """ 277 """
264 Preferences.getSettings().setValue("Subversion/" + key, value) 278 Preferences.getSettings().setValue("Subversion/" + key, value)
265 279
266 def getServersPath(self): 280 def getServersPath(self):
267 """ 281 """
268 Public method to get the filename of the servers file. 282 Public method to get the filename of the servers file.
269 283
270 @return filename of the servers file (string) 284 @return filename of the servers file
285 @rtype str
271 """ 286 """
272 return getServersPath() 287 return getServersPath()
273 288
274 def getConfigPath(self): 289 def getConfigPath(self):
275 """ 290 """
276 Public method to get the filename of the config file. 291 Public method to get the filename of the config file.
277 292
278 @return filename of the config file (string) 293 @return filename of the config file
294 @rtype str
279 """ 295 """
280 return getConfigPath() 296 return getConfigPath()
281 297
282 def prepareUninstall(self): 298 def prepareUninstall(self):
283 """ 299 """

eric ide

mercurial