PluginProjectKivy.py

branch
eric7
changeset 51
344ab3a70c58
parent 50
265ebe67da39
child 53
92a00696c442
--- a/PluginProjectKivy.py	Wed Sep 21 16:27:00 2022 +0200
+++ b/PluginProjectKivy.py	Tue Oct 25 09:25:44 2022 +0200
@@ -13,9 +13,8 @@
 
 from PyQt6.QtCore import QObject, QTranslator
 
-from EricWidgets.EricApplication import ericApp
-
-import Preferences
+from eric7 import Preferences
+from eric7.EricWidgets.EricApplication import ericApp
 
 from pygments.lexers._mapping import LEXERS
 
@@ -24,7 +23,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.0.0"
+version = "10.1.0"
 className = "ProjectKivyPlugin"
 packageName = "ProjectKivy"
 shortDescription = "Project support for Kivy projects."
@@ -98,6 +97,14 @@
         @return tuple of None and activation status
         @rtype bool
         """
+        from eric7.Project.ProjectBrowser import (
+            SourcesBrowserFlag,
+            FormsBrowserFlag,
+            TranslationsBrowserFlag,
+            OthersBrowserFlag,
+        )
+        from eric7.QScintilla import Lexers
+
         self.__ericProject.registerProjectType(
             "Kivy",
             self.tr("Kivy"),
@@ -106,13 +113,6 @@
             progLanguages=["Python3"],
         )
 
-        from Project.ProjectBrowser import (
-            SourcesBrowserFlag,
-            FormsBrowserFlag,
-            TranslationsBrowserFlag,
-            OthersBrowserFlag,
-        )
-
         Preferences.setProjectBrowserFlagsDefault(
             "Kivy",
             SourcesBrowserFlag
@@ -122,9 +122,7 @@
         )
 
         LEXERS[self.KivyLexerKey] = self.KivyLexerEntry
-        import QScintilla.Lexers
-
-        QScintilla.Lexers.registerLexer(
+        Lexers.registerLexer(
             "Pygments|Kivy",
             self.tr("Kivy"),
             "dummy.kv",
@@ -140,11 +138,11 @@
         """
         Public method to deactivate this plugin.
         """
+        from eric7.QScintilla import Lexers
+
         self.__ericProject.unregisterProjectType("Kivy")
 
-        import QScintilla.Lexers
-
-        QScintilla.Lexers.unregisterLexer("Kivy")
+        Lexers.unregisterLexer("Kivy")
         if self.KivyLexerKey in LEXERS:
             del LEXERS[self.KivyLexerKey]
 
@@ -215,7 +213,7 @@
         @return reference to the instanciated lexer object
         @rtype QsciLexer
         """
-        from QScintilla.Lexers.LexerPygments import LexerPygments
+        from eric7.QScintilla.Lexers.LexerPygments import LexerPygments
 
         lexer = LexerPygments(parent, name="Kivy")
         if lexer.canStyle():

eric ide

mercurial