21 # Start-of-Header |
21 # Start-of-Header |
22 name = "Flask Project Plugin" |
22 name = "Flask Project Plugin" |
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
24 autoactivate = True |
24 autoactivate = True |
25 deactivateable = True |
25 deactivateable = True |
26 version = "10.2.0" |
26 version = "10.3.0" |
27 className = "ProjectFlaskPlugin" |
27 className = "ProjectFlaskPlugin" |
28 packageName = "ProjectFlask" |
28 packageName = "ProjectFlask" |
29 shortDescription = "Project support for Flask projects." |
29 shortDescription = "Project support for Flask projects." |
30 longDescription = """This plugin implements project support for Flask projects.""" |
30 longDescription = """This plugin implements project support for Flask projects.""" |
31 needsRestart = False |
31 needsRestart = False |
93 |
93 |
94 def prepareUninstall(): |
94 def prepareUninstall(): |
95 """ |
95 """ |
96 Module function to prepare for an uninstallation. |
96 Module function to prepare for an uninstallation. |
97 """ |
97 """ |
98 Preferences.removeProjectBrowserFlags(ProjectFlaskPlugin.PreferencesKey) |
98 try: |
|
99 Preferences.removeProjectBrowsers(ProjectFlaskPlugin.PreferencesKey) |
|
100 except AttributeError: |
|
101 # backward compatibility for eric7 < 22.12 |
|
102 Preferences.removeProjectBrowserFlags(ProjectFlaskPlugin.PreferencesKey) |
99 Preferences.Prefs.settings.remove(ProjectFlaskPlugin.PreferencesKey) |
103 Preferences.Prefs.settings.remove(ProjectFlaskPlugin.PreferencesKey) |
100 Preferences.Prefs.rsettings.remove(ProjectFlaskPlugin.PreferencesKey) |
104 Preferences.Prefs.rsettings.remove(ProjectFlaskPlugin.PreferencesKey) |
101 |
105 |
102 |
106 |
103 class ProjectFlaskPlugin(QObject): |
107 class ProjectFlaskPlugin(QObject): |
185 lexerAssociationCallback=self.lexerAssociationCallback, |
189 lexerAssociationCallback=self.lexerAssociationCallback, |
186 binaryTranslationsCallback=self.binaryTranslationsCallback, |
190 binaryTranslationsCallback=self.binaryTranslationsCallback, |
187 progLanguages=self.__supportedVariants[:], |
191 progLanguages=self.__supportedVariants[:], |
188 ) |
192 ) |
189 |
193 |
190 from eric7.Project.ProjectBrowser import ( |
194 try: |
191 FormsBrowserFlag, |
195 # backward compatibility for eric7 < 22.12 |
192 OthersBrowserFlag, |
196 from eric7.Project.ProjectBrowser import ( |
193 SourcesBrowserFlag, |
197 FormsBrowserFlag, |
194 TranslationsBrowserFlag, |
198 OthersBrowserFlag, |
195 ) |
199 SourcesBrowserFlag, |
196 |
200 TranslationsBrowserFlag, |
197 Preferences.setProjectBrowserFlagsDefault( |
201 ) |
198 "Flask", |
202 |
199 SourcesBrowserFlag |
203 Preferences.setProjectBrowserFlagsDefault( |
200 | FormsBrowserFlag |
204 "Flask", |
201 | TranslationsBrowserFlag |
205 SourcesBrowserFlag |
202 | OthersBrowserFlag, |
206 | FormsBrowserFlag |
203 ) |
207 | TranslationsBrowserFlag |
|
208 | OthersBrowserFlag, |
|
209 ) |
|
210 except ImportError: |
|
211 Preferences.setProjectBrowsersDefault( |
|
212 "Flask", |
|
213 ("sources", "forms", "translations", "others"), |
|
214 ) |
204 |
215 |
205 if self.__ericProject.isOpen(): |
216 if self.__ericProject.isOpen(): |
206 self.__projectOpened() |
217 self.__projectOpened() |
207 self.__object.projectOpenedHooks() |
218 self.__object.projectOpenedHooks() |
208 |
219 |