PluginProjectDjango.py

branch
eric7
changeset 186
bd5621e752ca
parent 181
2f5c3487139c
child 188
b08c2cb2e0a0
equal deleted inserted replaced
185:82761067ef37 186:bd5621e752ca
22 # Start-of-Header 22 # Start-of-Header
23 name = "Django Project Plugin" 23 name = "Django Project Plugin"
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 24 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
25 autoactivate = True 25 autoactivate = True
26 deactivateable = True 26 deactivateable = True
27 version = "10.1.0" 27 version = "10.2.0"
28 className = "ProjectDjangoPlugin" 28 className = "ProjectDjangoPlugin"
29 packageName = "ProjectDjango" 29 packageName = "ProjectDjango"
30 shortDescription = "Project support for Django projects." 30 shortDescription = "Project support for Django projects."
31 longDescription = """This plugin implements project support for Django projects.""" 31 longDescription = """This plugin implements project support for Django projects."""
32 needsRestart = False 32 needsRestart = False
94 94
95 def prepareUninstall(): 95 def prepareUninstall():
96 """ 96 """
97 Module function to prepare for an uninstallation. 97 Module function to prepare for an uninstallation.
98 """ 98 """
99 Preferences.removeProjectBrowserFlags(ProjectDjangoPlugin.PreferencesKey) 99 try:
100 Preferences.removeProjectBrowsers(ProjectDjangoPlugin.PreferencesKey)
101 except AttributeError:
102 # backward compatibility for eric7 < 22.12
103 Preferences.removeProjectBrowserFlags(ProjectDjangoPlugin.PreferencesKey)
100 Preferences.Prefs.settings.remove(ProjectDjangoPlugin.PreferencesKey) 104 Preferences.Prefs.settings.remove(ProjectDjangoPlugin.PreferencesKey)
101 Preferences.Prefs.rsettings.remove(ProjectDjangoPlugin.PreferencesKey) 105 Preferences.Prefs.rsettings.remove(ProjectDjangoPlugin.PreferencesKey)
102 106
103 107
104 class ProjectDjangoPlugin(QObject): 108 class ProjectDjangoPlugin(QObject):
195 lexerAssociationCallback=self.lexerAssociationCallback, 199 lexerAssociationCallback=self.lexerAssociationCallback,
196 binaryTranslationsCallback=self.binaryTranslationsCallback, 200 binaryTranslationsCallback=self.binaryTranslationsCallback,
197 progLanguages=self.__supportedVariants[:], 201 progLanguages=self.__supportedVariants[:],
198 ) 202 )
199 203
200 from eric7.Project.ProjectBrowser import ( 204 try:
201 SourcesBrowserFlag, 205 # backward compatibility for eric7 < 22.12
202 FormsBrowserFlag, 206 from eric7.Project.ProjectBrowser import (
203 TranslationsBrowserFlag, 207 SourcesBrowserFlag,
204 OthersBrowserFlag, 208 FormsBrowserFlag,
205 ) 209 TranslationsBrowserFlag,
206 210 OthersBrowserFlag,
207 Preferences.setProjectBrowserFlagsDefault( 211 )
208 "Django", 212
209 SourcesBrowserFlag 213 Preferences.setProjectBrowserFlagsDefault(
210 | FormsBrowserFlag 214 "Django",
211 | TranslationsBrowserFlag 215 SourcesBrowserFlag
212 | OthersBrowserFlag, 216 | FormsBrowserFlag
213 ) 217 | TranslationsBrowserFlag
218 | OthersBrowserFlag,
219 )
220 except ImportError:
221 Preferences.setProjectBrowsersDefault(
222 "Django",
223 ("sources", "forms", "translations", "others"),
224 )
214 225
215 if self.__ericProject.isOpen(): 226 if self.__ericProject.isOpen():
216 self.__projectOpened() 227 self.__projectOpened()
217 self.__object.projectOpenedHooks() 228 self.__object.projectOpenedHooks()
218 229

eric ide

mercurial