Plugins/PluginEricdoc.py

changeset 945
8cd4d08fa9f6
parent 908
d00447340771
child 1131
7781e396c903
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
38 pyqtApi = 2 38 pyqtApi = 2
39 # End-Of-Header 39 # End-Of-Header
40 40
41 error = "" 41 error = ""
42 42
43
43 def exeDisplayDataList(): 44 def exeDisplayDataList():
44 """ 45 """
45 Public method to support the display of some executable info. 46 Public method to support the display of some executable info.
46 47
47 @return dictionary containing the data to query the presence of 48 @return dictionary containing the data to query the presence of
50 dataList = [] 51 dataList = []
51 52
52 # 1. eric5_doc 53 # 1. eric5_doc
53 exe = 'eric5_doc' 54 exe = 'eric5_doc'
54 if Utilities.isWindowsPlatform(): 55 if Utilities.isWindowsPlatform():
55 exe = os.path.join(getConfig("bindir"), exe +'.bat') 56 exe = os.path.join(getConfig("bindir"), exe + '.bat')
56 dataList.append({ 57 dataList.append({
57 "programEntry" : True, 58 "programEntry": True,
58 "header" : QApplication.translate("EricdocPlugin", 59 "header": QApplication.translate("EricdocPlugin",
59 "Eric5 Documentation Generator"), 60 "Eric5 Documentation Generator"),
60 "exe" : exe, 61 "exe": exe,
61 "versionCommand" : '--version', 62 "versionCommand": '--version',
62 "versionStartsWith" : 'eric5_', 63 "versionStartsWith": 'eric5_',
63 "versionPosition" : -3, 64 "versionPosition": -3,
64 "version" : "", 65 "version": "",
65 "versionCleanup" : None, 66 "versionCleanup": None,
66 }) 67 })
67 68
68 # 2. Qt Help Generator 69 # 2. Qt Help Generator
69 exe = 'qhelpgenerator' 70 exe = 'qhelpgenerator'
70 if Utilities.isWindowsPlatform(): 71 if Utilities.isWindowsPlatform():
71 exe += '.exe' 72 exe += '.exe'
72 dataList.append({ 73 dataList.append({
73 "programEntry" : True, 74 "programEntry": True,
74 "header" : QApplication.translate("EricdocPlugin", 75 "header": QApplication.translate("EricdocPlugin",
75 "Qt4 Help Tools"), 76 "Qt4 Help Tools"),
76 "exe" : exe, 77 "exe": exe,
77 "versionCommand" : '-v', 78 "versionCommand": '-v',
78 "versionStartsWith" : 'Qt', 79 "versionStartsWith": 'Qt',
79 "versionPosition" : -1, 80 "versionPosition": -1,
80 "version" : "", 81 "version": "",
81 "versionCleanup" : (0, -1), 82 "versionCleanup": (0, -1),
82 }) 83 })
83 84
84 # 3. Qt Collection Generator 85 # 3. Qt Collection Generator
85 exe = 'qcollectiongenerator' 86 exe = 'qcollectiongenerator'
86 if Utilities.isWindowsPlatform(): 87 if Utilities.isWindowsPlatform():
87 exe += '.exe' 88 exe += '.exe'
88 dataList.append({ 89 dataList.append({
89 "programEntry" : True, 90 "programEntry": True,
90 "header" : QApplication.translate("EricdocPlugin", 91 "header": QApplication.translate("EricdocPlugin",
91 "Qt4 Help Tools"), 92 "Qt4 Help Tools"),
92 "exe" : exe, 93 "exe": exe,
93 "versionCommand" : '-v', 94 "versionCommand": '-v',
94 "versionStartsWith" : 'Qt', 95 "versionStartsWith": 'Qt',
95 "versionPosition" : -1, 96 "versionPosition": -1,
96 "version" : "", 97 "version": "",
97 "versionCleanup" : (0, -1), 98 "versionCleanup": (0, -1),
98 }) 99 })
99 100
100 return dataList 101 return dataList
102
101 103
102 class EricdocPlugin(QObject): 104 class EricdocPlugin(QObject):
103 """ 105 """
104 Class implementing the Ericdoc plugin. 106 Class implementing the Ericdoc plugin.
105 """ 107 """
157 e5App().getObject("Project").removeE5Actions([self.__projectAct]) 159 e5App().getObject("Project").removeE5Actions([self.__projectAct])
158 self.__initialize() 160 self.__initialize()
159 161
160 def __projectShowMenu(self, menuName, menu): 162 def __projectShowMenu(self, menuName, menu):
161 """ 163 """
162 Private slot called, when the the project menu or a submenu is 164 Private slot called, when the the project menu or a submenu is
163 about to be shown. 165 about to be shown.
164 166
165 @param menuName name of the menu to be shown (string) 167 @param menuName name of the menu to be shown (string)
166 @param menu reference to the menu (QMenu) 168 @param menu reference to the menu (QMenu)
167 """ 169 """
174 def __doEricdoc(self): 176 def __doEricdoc(self):
175 """ 177 """
176 Private slot to perform the eric5_doc api documentation generation. 178 Private slot to perform the eric5_doc api documentation generation.
177 """ 179 """
178 eolTranslation = { 180 eolTranslation = {
179 '\r' : 'cr', 181 '\r': 'cr',
180 '\n' : 'lf', 182 '\n': 'lf',
181 '\r\n' : 'crlf', 183 '\r\n': 'crlf',
182 } 184 }
183 project = e5App().getObject("Project") 185 project = e5App().getObject("Project")
184 parms = project.getData('DOCUMENTATIONPARMS', "ERIC4DOC") 186 parms = project.getData('DOCUMENTATIONPARMS', "ERIC4DOC")
185 dlg = EricdocConfigDialog(project, parms) 187 dlg = EricdocConfigDialog(project, parms)
186 if dlg.exec_() == QDialog.Accepted: 188 if dlg.exec_() == QDialog.Accepted:

eric ide

mercurial