Adapted to the project browser changes as of eric 22.12. eric7 release-10.2.0

Sat, 26 Nov 2022 18:02:26 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 26 Nov 2022 18:02:26 +0100
branch
eric7
changeset 162
c044d1dd8116
parent 161
fc547354ca23
child 163
e3ed5e2856d7

Adapted to the project browser changes as of eric 22.12.

ChangeLog file | annotate | diff | comparison | revisions
PluginProjectPyramid.py file | annotate | diff | comparison | revisions
PluginProjectPyramid.zip file | annotate | diff | comparison | revisions
--- a/ChangeLog	Tue Oct 25 09:40:40 2022 +0200
+++ b/ChangeLog	Sat Nov 26 18:02:26 2022 +0100
@@ -1,6 +1,9 @@
 ChangeLog
 ---------
-Version 10.1.0
+Version 10.2.0:
+- adapted to the project browser changes as of eric 22.12
+
+Version 10.1.0:
 - adapted the import statements to the new structure
 
 Version 10.0.1:
--- a/PluginProjectPyramid.py	Tue Oct 25 09:40:40 2022 +0200
+++ b/PluginProjectPyramid.py	Sat Nov 26 18:02:26 2022 +0100
@@ -24,7 +24,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.1.0"
+version = "10.2.0"
 className = "ProjectPyramidPlugin"
 packageName = "ProjectPyramid"
 shortDescription = "Project support for Pyramid projects."
@@ -94,7 +94,11 @@
     """
     Module function to prepare for an uninstallation.
     """
-    Preferences.removeProjectBrowserFlags(ProjectPyramidPlugin.PreferencesKey)
+    try:
+        Preferences.removeProjectBrowsers(ProjectPyramidPlugin.PreferencesKey)
+    except AttributeError:
+        # backward compatibility for eric7 < 22.12
+        Preferences.removeProjectBrowserFlags(ProjectPyramidPlugin.PreferencesKey)
     Preferences.Prefs.settings.remove(ProjectPyramidPlugin.PreferencesKey)
 
 
@@ -187,20 +191,27 @@
                 progLanguages=self.__supportedVariants[:],
             )
 
-        from eric7.Project.ProjectBrowser import (
-            SourcesBrowserFlag,
-            FormsBrowserFlag,
-            TranslationsBrowserFlag,
-            OthersBrowserFlag,
-        )
+        try:
+            # backward compatibility for eric7 < 22.12
+            from eric7.Project.ProjectBrowser import (
+                SourcesBrowserFlag,
+                FormsBrowserFlag,
+                TranslationsBrowserFlag,
+                OthersBrowserFlag,
+            )
 
-        Preferences.setProjectBrowserFlagsDefault(
-            "Pyramid",
-            SourcesBrowserFlag
-            | FormsBrowserFlag
-            | TranslationsBrowserFlag
-            | OthersBrowserFlag,
-        )
+            Preferences.setProjectBrowserFlagsDefault(
+                "Pyramid",
+                SourcesBrowserFlag
+                | FormsBrowserFlag
+                | TranslationsBrowserFlag
+                | OthersBrowserFlag,
+            )
+        except ImportError:
+            Preferences.setProjectBrowsersDefault(
+                "Pyramid",
+                ("sources", "forms", "translations", "others"),
+            )
 
         if self.__ericProject.isOpen():
             self.__projectOpened()
Binary file PluginProjectPyramid.zip has changed

eric ide

mercurial