| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -132,7 +132,7 @@ def render(self, url): | |||
| 132 | 132 | # We have to use this helper object because | |
| 133 | 133 | # QApplication.processEvents may be called, causing | |
| 134 | 134 | # this method to get called while it has not returned yet. | |
| 135 | - helper = _WebkitRendererHelper(self) | ||
| 135 | + helper = _WebkitRendererHelper(self) | ||
| 136 | 136 | image = helper.render(url) | |
| 137 | 137 | ||
| 138 | 138 | # Bind helper instance to this image to prevent the | |
@@ -146,7 +146,7 @@ def render_to_file(self, url, file): | |||
| 146 | 146 | """Renders the image into a File resource. | |
| 147 | 147 | Returns the size of the data that has been written. | |
| 148 | 148 | """ | |
| 149 | - format = self.format # this may not be constant due to processEvents() | ||
| 149 | + format = self.format # this may not be constant due to processEvents() | ||
| 150 | 150 | image = self.render(url) | |
| 151 | 151 | qBuffer = QBuffer() | |
| 152 | 152 | image.save(qBuffer, format) | |
@@ -215,7 +215,7 @@ def render(self, url): | |||
| 215 | 215 | on the value of 'grabWholeWindow' is drawn into a QPixmap | |
| 216 | 216 | and postprocessed (_post_process_image). | |
| 217 | 217 | """ | |
| 218 | - self._load_page(url, self.width, self.height, self.timeout) | ||
| 218 | + self._load_page(url, self.width, self.height, self.timeout) | ||
| 219 | 219 | # Wait for end of timer. In this time, process | |
| 220 | 220 | # other outstanding Qt events. | |
| 221 | 221 | if self.wait > 0: | |
@@ -248,14 +248,20 @@ def render(self, url): | |||
| 248 | 248 | return self._post_process_image(image) | |
| 249 | 249 | ||
| 250 | 250 | def _load_page(self, url, width, height, timeout): | |
| 251 | - """This method implements the logic for retrieving and displaying the requested page.""" | ||
| 251 | + """ | ||
| 252 | + This method implements the logic for retrieving and displaying | ||
| 253 | + the requested page. | ||
| 254 | + """ | ||
| 252 | 255 | ||
| 253 | 256 | # This is an event-based application. So we have to wait until | |
| 254 | 257 | # "loadFinished(bool)" raised. | |
| 255 | 258 | cancelAt = time.time() + timeout | |
| 256 | 259 | self.__loading = True | |
| 257 | 260 | self.__loadingResult = False # Default | |
| 258 | - self._page.mainFrame().load(QUrl.fromEncoded(url)) | ||
| 261 | + # TODO: fromEncoded() needs to be used in some situations. Some | ||
| 262 | + # sort of flag should be passed in to WebkitRenderer maybe? | ||
| 263 | + #self._page.mainFrame().load(QUrl.fromEncoded(url)) | ||
| 264 | + self._page.mainFrame().load(QUrl(url)) | ||
| 259 | 265 | while self.__loading: | |
| 260 | 266 | if timeout > 0 and time.time() >= cancelAt: | |
| 261 | 267 | raise RuntimeError("Request timed out on %s" % url) | |
@@ -418,7 +424,7 @@ def init_qtgui(display=None, style=None, qtargs=[]): | |||
| 418 | 424 | else: | |
| 419 | 425 | newArgs.append(sys.argv[i]) | |
| 420 | 426 | logger.debug("Executing %s" % " ".join(newArgs)) | |
| 421 | - os.execvp(newArgs[0],newArgs[1:]) | ||
| 427 | + os.execvp(newArgs[0],newArgs[1:]) | ||
| 422 | 428 | ||
| 423 | 429 | # Prepare outout ("1" means STDOUT) | |
| 424 | 430 | if options.output == None: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments