PluginProjectWeb.py

changeset 30
38092622e612
parent 29
38577502d613
child 32
1fa09d596edb
equal deleted inserted replaced
29:38577502d613 30:38092622e612
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Web project plugin. 7 Module implementing the Web project plugin.
8 """ 8 """
9
10 from __future__ import unicode_literals
11 9
12 import os 10 import os
13 11
14 from PyQt5.QtCore import QObject, QTranslator 12 from PyQt5.QtCore import QObject, QTranslator
15 from PyQt5.QtWidgets import QMenu 13 from PyQt5.QtWidgets import QMenu
28 # Start-Of-Header 26 # Start-Of-Header
29 name = "Generic Web Project Plug-in" 27 name = "Generic Web Project Plug-in"
30 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 28 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
31 autoactivate = True 29 autoactivate = True
32 deactivateable = True 30 deactivateable = True
33 version = "1.1.4" 31 version = "2.0.0"
34 className = "ProjectWebPlugin" 32 className = "ProjectWebPlugin"
35 packageName = "ProjectWeb" 33 packageName = "ProjectWeb"
36 shortDescription = "Support for Web projects and web related tools." 34 shortDescription = "Support for Web projects and web related tools."
37 longDescription = ( 35 longDescription = (
38 """This plug-in provides support for ordinary web projects and some web""" 36 """This plug-in provides support for ordinary web projects and some web"""
39 """ related tools.\n\nIt requires BeautifulSoup4 for some of its""" 37 """ related tools.\n\nIt requires BeautifulSoup4 for some of its"""
40 """ functionality.""" 38 """ functionality."""
41 ) 39 )
42 needsRestart = False 40 needsRestart = False
43 pyqtApi = 2 41 pyqtApi = 2
44 python2Compatible = True
45 # End-Of-Header 42 # End-Of-Header
46 43
47 error = "" 44 error = ""
48 45
49 46
87 # it is not registered for a specific programming language 84 # it is not registered for a specific programming language
88 self.__e5project.registerProjectType( 85 self.__e5project.registerProjectType(
89 "Web", self.tr("Web"), 86 "Web", self.tr("Web"),
90 self.fileTypesCallback) 87 self.fileTypesCallback)
91 88
92 from Project.ProjectBrowser import SourcesBrowserFlag, \ 89 from Project.ProjectBrowser import (
93 FormsBrowserFlag, OthersBrowserFlag 90 SourcesBrowserFlag, FormsBrowserFlag, OthersBrowserFlag
91 )
94 Preferences.setProjectBrowserFlagsDefault( 92 Preferences.setProjectBrowserFlagsDefault(
95 "Web", 93 "Web",
96 SourcesBrowserFlag | FormsBrowserFlag | OthersBrowserFlag, 94 SourcesBrowserFlag | FormsBrowserFlag | OthersBrowserFlag,
97 ) 95 )
98 96
169 Public method to get the filetype associations of the Web project type. 167 Public method to get the filetype associations of the Web project type.
170 168
171 @return dictionary with file type associations 169 @return dictionary with file type associations
172 """ 170 """
173 if self.__e5project.getProjectType() == "Web": 171 if self.__e5project.getProjectType() == "Web":
174 fileTypes = { 172 return {
175 "*.html": "FORMS", 173 "*.html": "FORMS",
176 "*.htm": "FORMS", 174 "*.htm": "FORMS",
177 "*.js": "SOURCES", 175 "*.js": "SOURCES",
178 } 176 }
179 else: 177 else:
180 fileTypes = {} 178 return {}
181 return fileTypes
182 179
183 def __initMenu(self): 180 def __initMenu(self):
184 """ 181 """
185 Private method to initialize the web tools menu. 182 Private method to initialize the web tools menu.
186 """ 183 """

eric ide

mercurial