Plugins/PluginVcsPySvn.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 3004
c4bf32c791d0
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
30 pluginType = "version_control" 30 pluginType = "version_control"
31 pluginTypename = "PySvn" 31 pluginTypename = "PySvn"
32 className = "VcsPySvnPlugin" 32 className = "VcsPySvnPlugin"
33 packageName = "__core__" 33 packageName = "__core__"
34 shortDescription = "Implements the PySvn version control interface." 34 shortDescription = "Implements the PySvn version control interface."
35 longDescription = """This plugin provides the PySvn version control interface.""" 35 longDescription = \
36 """This plugin provides the PySvn version control interface."""
36 pyqtApi = 2 37 pyqtApi = 2
37 # End-Of-Header 38 # End-Of-Header
38 39
39 error = "" 40 error = ""
40 41
69 70
70 def getVcsSystemIndicator(): 71 def getVcsSystemIndicator():
71 """ 72 """
72 Public function to get the indicators for this version control system. 73 Public function to get the indicators for this version control system.
73 74
74 @return dictionary with indicator as key and a tuple with the vcs name (string) 75 @return dictionary with indicator as key and a tuple with the vcs name
75 and vcs display string (string) 76 (string) and vcs display string (string)
76 """ 77 """
77 global pluginTypename 78 global pluginTypename
78 data = {} 79 data = {}
79 data[".svn"] = (pluginTypename, displayString()) 80 data[".svn"] = (pluginTypename, displayString())
80 data["_svn"] = (pluginTypename, displayString()) 81 data["_svn"] = (pluginTypename, displayString())
98 99
99 def createConfigurationPage(configDlg): 100 def createConfigurationPage(configDlg):
100 """ 101 """
101 Module function to create the configuration page. 102 Module function to create the configuration page.
102 103
104 @param configDlg reference to the configuration dialog (QDialog)
103 @return reference to the configuration page 105 @return reference to the configuration page
104 """ 106 """
105 global subversionCfgPluginObject 107 global subversionCfgPluginObject
106 from VcsPlugins.vcsPySvn.ConfigurationPage.SubversionPage import SubversionPage 108 from VcsPlugins.vcsPySvn.ConfigurationPage.SubversionPage import \
109 SubversionPage
107 if subversionCfgPluginObject is None: 110 if subversionCfgPluginObject is None:
108 subversionCfgPluginObject = VcsPySvnPlugin(None) 111 subversionCfgPluginObject = VcsPySvnPlugin(None)
109 page = SubversionPage(subversionCfgPluginObject) 112 page = SubversionPage(subversionCfgPluginObject)
110 return page 113 return page
111 114
112 115
113 def getConfigData(): 116 def getConfigData():
114 """ 117 """
115 Module function returning data as required by the configuration dialog. 118 Module function returning data as required by the configuration dialog.
116 119
117 @return dictionary with key "zzz_subversionPage" containing the relevant data 120 @return dictionary with key "zzz_subversionPage" containing the relevant
121 data
118 """ 122 """
119 return { 123 return {
120 "zzz_subversionPage": \ 124 "zzz_subversionPage": \
121 [QApplication.translate("VcsPySvnPlugin", "Subversion"), 125 [QApplication.translate("VcsPySvnPlugin", "Subversion"),
122 os.path.join("VcsPlugins", "vcsPySvn", "icons", 126 os.path.join("VcsPlugins", "vcsPySvn", "icons",
127 131
128 def prepareUninstall(): 132 def prepareUninstall():
129 """ 133 """
130 Module function to prepare for an uninstallation. 134 Module function to prepare for an uninstallation.
131 """ 135 """
132 if not e5App().getObject("PluginManager").isPluginLoaded("PluginVcsSubversion"): 136 if not e5App().getObject("PluginManager").isPluginLoaded(
137 "PluginVcsSubversion"):
133 Preferences.Prefs.settings.remove("Subversion") 138 Preferences.Prefs.settings.remove("Subversion")
134 139
135 140
136 class VcsPySvnPlugin(QObject): 141 class VcsPySvnPlugin(QObject):
137 """ 142 """
153 } 158 }
154 159
155 from VcsPlugins.vcsPySvn.ProjectHelper import SvnProjectHelper 160 from VcsPlugins.vcsPySvn.ProjectHelper import SvnProjectHelper
156 self.__projectHelperObject = SvnProjectHelper(None, None) 161 self.__projectHelperObject = SvnProjectHelper(None, None)
157 try: 162 try:
158 e5App().registerPluginObject(pluginTypename, self.__projectHelperObject, 163 e5App().registerPluginObject(
159 pluginType) 164 pluginTypename, self.__projectHelperObject, pluginType)
160 except KeyError: 165 except KeyError:
161 pass # ignore duplicate registration 166 pass # ignore duplicate registration
162 readShortcuts(pluginName=pluginTypename) 167 readShortcuts(pluginName=pluginTypename)
163 168
164 def getProjectHelper(self): 169 def getProjectHelper(self):
189 def getPreferences(self, key): 194 def getPreferences(self, key):
190 """ 195 """
191 Public method to retrieve the various settings. 196 Public method to retrieve the various settings.
192 197
193 @param key the key of the value to get 198 @param key the key of the value to get
194 @param prefClass preferences class used as the storage area
195 @return the requested refactoring setting 199 @return the requested refactoring setting
196 """ 200 """
197 if key in ["StopLogOnCopy"]: 201 if key in ["StopLogOnCopy"]:
198 return Preferences.toBool(Preferences.Prefs.settings.value( 202 return Preferences.toBool(Preferences.Prefs.settings.value(
199 "Subversion/" + key, self.__subversionDefaults[key])) 203 "Subversion/" + key, self.__subversionDefaults[key]))
210 """ 214 """
211 Public method to store the various settings. 215 Public method to store the various settings.
212 216
213 @param key the key of the setting to be set 217 @param key the key of the setting to be set
214 @param value the value to be set 218 @param value the value to be set
215 @param prefClass preferences class used as the storage area
216 """ 219 """
217 Preferences.Prefs.settings.setValue("Subversion/" + key, value) 220 Preferences.Prefs.settings.setValue("Subversion/" + key, value)
218 221
219 def getServersPath(self): 222 def getServersPath(self):
220 """ 223 """

eric ide

mercurial