eric7/WebBrowser/Network/QtHelpSchemeHandler.py

branch
eric7
changeset 8354
12ebd3934fef
parent 8318
962bce857696
child 8881
54e42bc2437a
equal deleted inserted replaced
8353:799196d0b05d 8354:12ebd3934fef
15 ) 15 )
16 from PyQt6.QtWebEngineCore import ( 16 from PyQt6.QtWebEngineCore import (
17 QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob 17 QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob
18 ) 18 )
19 19
20 from E5Utilities.E5MutexLocker import E5MutexLocker 20 from EricUtilities.EricMutexLocker import EricMutexLocker
21 21
22 QtDocPath = "qthelp://org.qt-project." 22 QtDocPath = "qthelp://org.qt-project."
23 23
24 ExtensionMap = { 24 ExtensionMap = {
25 ".bmp": "image/bmp", 25 ".bmp": "image/bmp",
171 """<h3>'{0}'</h3></div></body>""" 171 """<h3>'{0}'</h3></div></body>"""
172 """</html>""").format(url.toString()) 172 """</html>""").format(url.toString())
173 .encode("utf-8")) 173 .encode("utf-8"))
174 ) 174 )
175 175
176 with E5MutexLocker(self.__mutex): 176 with EricMutexLocker(self.__mutex):
177 self.__buffer.setData(data) 177 self.__buffer.setData(data)
178 self.__buffer.open(QIODevice.OpenModeFlag.ReadOnly) 178 self.__buffer.open(QIODevice.OpenModeFlag.ReadOnly)
179 self.open(QIODevice.OpenModeFlag.ReadOnly) 179 self.open(QIODevice.OpenModeFlag.ReadOnly)
180 180
181 self.readyRead.emit() 181 self.readyRead.emit()
185 Public method to get the number of available bytes. 185 Public method to get the number of available bytes.
186 186
187 @return number of available bytes 187 @return number of available bytes
188 @rtype int 188 @rtype int
189 """ 189 """
190 with E5MutexLocker(self.__mutex): 190 with EricMutexLocker(self.__mutex):
191 return self.__buffer.bytesAvailable() 191 return self.__buffer.bytesAvailable()
192 192
193 def readData(self, maxlen): 193 def readData(self, maxlen):
194 """ 194 """
195 Public method to retrieve data from the reply object. 195 Public method to retrieve data from the reply object.
196 196
197 @param maxlen maximum number of bytes to read (integer) 197 @param maxlen maximum number of bytes to read (integer)
198 @return string containing the data (bytes) 198 @return string containing the data (bytes)
199 """ 199 """
200 with E5MutexLocker(self.__mutex): 200 with EricMutexLocker(self.__mutex):
201 return self.__buffer.read(maxlen) 201 return self.__buffer.read(maxlen)
202 202
203 def close(self): 203 def close(self):
204 """ 204 """
205 Public method used to cloase the reply. 205 Public method used to cloase the reply.

eric ide

mercurial