PluginProjectKivy.py

branch
eric7
changeset 53
92a00696c442
parent 51
344ab3a70c58
child 55
51942cec15c0
equal deleted inserted replaced
52:8674ec401ce8 53:92a00696c442
21 # Start-of-Header 21 # Start-of-Header
22 name = "Kivy Project Plugin" 22 name = "Kivy 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.1.0" 26 version = "10.2.0"
27 className = "ProjectKivyPlugin" 27 className = "ProjectKivyPlugin"
28 packageName = "ProjectKivy" 28 packageName = "ProjectKivy"
29 shortDescription = "Project support for Kivy projects." 29 shortDescription = "Project support for Kivy projects."
30 longDescription = """This plugin implements project support for Kivy projects.""" 30 longDescription = """This plugin implements project support for Kivy projects."""
31 needsRestart = False 31 needsRestart = False
95 Public method to activate this plugin. 95 Public method to activate this plugin.
96 96
97 @return tuple of None and activation status 97 @return tuple of None and activation status
98 @rtype bool 98 @rtype bool
99 """ 99 """
100 from eric7.Project.ProjectBrowser import (
101 SourcesBrowserFlag,
102 FormsBrowserFlag,
103 TranslationsBrowserFlag,
104 OthersBrowserFlag,
105 )
106 from eric7.QScintilla import Lexers 100 from eric7.QScintilla import Lexers
107 101
108 self.__ericProject.registerProjectType( 102 self.__ericProject.registerProjectType(
109 "Kivy", 103 "Kivy",
110 self.tr("Kivy"), 104 self.tr("Kivy"),
111 self.fileTypesCallback, 105 self.fileTypesCallback,
112 lexerAssociationCallback=self.lexerAssociationCallback, 106 lexerAssociationCallback=self.lexerAssociationCallback,
113 progLanguages=["Python3"], 107 progLanguages=["Python3"],
114 ) 108 )
115 109
116 Preferences.setProjectBrowserFlagsDefault( 110 try:
117 "Kivy", 111 # backward compatibility for eric7 < 22.12
118 SourcesBrowserFlag 112 from eric7.Project.ProjectBrowser import (
119 | FormsBrowserFlag 113 SourcesBrowserFlag,
120 | TranslationsBrowserFlag 114 FormsBrowserFlag,
121 | OthersBrowserFlag, 115 TranslationsBrowserFlag,
122 ) 116 OthersBrowserFlag,
117 )
118
119 Preferences.setProjectBrowserFlagsDefault(
120 "Kivy",
121 SourcesBrowserFlag
122 | FormsBrowserFlag
123 | TranslationsBrowserFlag
124 | OthersBrowserFlag,
125 )
126 except ImportError:
127 Preferences.setProjectBrowsersDefault(
128 "Kivy",
129 ("sources", "forms", "translations", "others"),
130 )
123 131
124 LEXERS[self.KivyLexerKey] = self.KivyLexerEntry 132 LEXERS[self.KivyLexerKey] = self.KivyLexerEntry
125 Lexers.registerLexer( 133 Lexers.registerLexer(
126 "Pygments|Kivy", 134 "Pygments|Kivy",
127 self.tr("Kivy"), 135 self.tr("Kivy"),

eric ide

mercurial