def __init__(self, opts, parent, log): QWebEnginePage.__init__(self, parent.profile, parent) secure_webengine(self) self.working = False self.log = log self.load_complete = False self.settle_time = 0 self.wait_for_title = None s = self.settings() s.setAttribute(s.JavascriptEnabled, True) s.setFontSize(s.DefaultFontSize, opts.pdf_default_font_size) s.setFontSize(s.DefaultFixedFontSize, opts.pdf_mono_font_size) s.setFontSize(s.MinimumLogicalFontSize, 8) s.setFontSize(s.MinimumFontSize, 8) std = { 'serif': opts.pdf_serif_family, 'sans' : opts.pdf_sans_family, 'mono' : opts.pdf_mono_family }.get(opts.pdf_standard_font, opts.pdf_serif_family) if std: s.setFontFamily(s.StandardFont, std) if opts.pdf_serif_family: s.setFontFamily(s.SerifFont, opts.pdf_serif_family) if opts.pdf_sans_family: s.setFontFamily(s.SansSerifFont, opts.pdf_sans_family) if opts.pdf_mono_family: s.setFontFamily(s.FixedFont, opts.pdf_mono_family) self.titleChanged.connect(self.title_changed) self.loadStarted.connect(self.load_started) self.loadFinished.connect(self.load_finished)
def __init__(self, url): self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self._on_load_finished) self.load(QUrl(url)) self.app.exec_()
def __init__(self, html): # self.html = None self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.loadFinished.connect(self._loadFinished) self.load(QUrl(url)) self.app.exec_()
def __init__(self, html): self.html = None self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.loadFinished.connect(self._loadFinished) self.mainFrame().setHtml(html) self.app.exec_()
def __init__(self, url, appl): self.app = appl QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self._on_load_finished) self.load(QUrl(url)) self.app.exec_()
def __init__(self): self.is_first = True self.html = '' self.task_time = [] self.task_info = [] self.app = QApplication(sys.argv) # PyQt5 QWebEnginePage.__init__(self) # PyQt5
def __init__(self): QWebEnginePage.__init__(self) self.titleChanged.connect(self.title_changed) secure_webengine(self) self.scripts().insert(create_script(js, 'test-rapydscript.js')) self.setHtml('<p>initialize') self.working = True
def __init__(self, url): self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = '' # acts as a browser to read the html file self.loadFinished.connect(self._on_load_finished) self.load(QUrl(url)) self.app.exec_()
def __init__(self, url=None): QWebEnginePage.__init__(self) # put the most recent buffer at the beginning of the BUFFERS list BUFFERS.insert(0, self) hooks.webbuffer_created(self) self.fullScreenRequested.connect(self._on_full_screen_requested) self.featurePermissionRequested.connect(self._on_feature_requested) self._content_handler = WebContentHandler(self) channel = QWebChannel(self) channel.registerObject("contentHandler", self._content_handler) self.setWebChannel(channel, QWebEngineScript.ApplicationWorld) self.loadFinished.connect(self.finished) self.authenticationRequired.connect(self.handle_authentication) self.linkHovered.connect(self.on_url_hovered) self.titleChanged.connect(self.update_title) self.__authentication_data = None self.__delay_loading_url = None self.__keymap_mode = Mode.KEYMAP_NORMAL self.__mode = get_mode("standard-mode") self.__text_edit_mark = False if url: if isinstance(url, DelayedLoadingUrl): self.__delay_loading_url = url else: self.load(url)
def __init__(self, url): if not WebClient.app: WebClient.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = "" self.loadFinished.connect(self.on_load_finished) self.load(QUrl(url)) WebClient.app.exec_()
def __init__(self, parent): profile = create_profile() QWebEnginePage.__init__(self, profile, parent) profile.setParent(self) secure_webengine(self, for_viewer=True) apply_font_settings(self) self.bridge = ViewerBridge(self) self.bridge.copy_selection.connect(self.trigger_copy)
def __init__(self, url): global app set_app() QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self._on_load_finished) self.load(QUrl(url)) app.exec()
def __init__(self, url, cb): QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self.on_page_load) self.load(QUrl(url)) self.cb = cb self.url = url app.exec_()
def __init__(self): QWebEnginePage.__init__(self) secure_webengine(self) self.printing_started = False self.loadFinished.connect(self.load_finished, type=Qt.QueuedConnection) self.pdfPrintingFinished.connect(self.print_finished) self.hang_timer = t = QTimer(self) t.setInterval(500) t.timeout.connect(self.hang_check)
def __init__(self, url): # Startup the webpage self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self._on_load_finished) # Connecting the methd self.load(QUrl(url)) self.app.exec_()
def __init__(self): """ Initialize the client. It defines and initializes some internal data. """ self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.loadedSem = threading.Semaphore(0) self.html = None self.loadFinished.connect(self.on_page_load)
def __init__(self, parent, tab): QWebEnginePage.__init__(self, parent) self.tab = tab self.interceptor = ReTextWebEngineUrlRequestInterceptor(self) if hasattr(self, 'setUrlRequestInterceptor'): # Available since Qt 5.13 self.setUrlRequestInterceptor(self.interceptor) else: self.profile().setRequestInterceptor(self.interceptor)
def __init__(self): must_use_qt() QWebEnginePage.__init__(self, create_profile(), QApplication.instance()) self.titleChanged.connect(self.title_changed) secure_webengine(self.settings()) self.console_messages = [] self.ready = False self.working = False self.pending = None self.setHtml('')
def __init__(self): QWebEnginePage.__init__(self) self.errors = [] secure_webengine(self) script = buf.getvalue().decode('utf-8') script += '\n\n;;\n\n' + vfs_script() self.scripts().insert(create_script(script, 'rapydscript.js')) self.setHtml('<p>initialize') while self.title() != 'compiler initialized': self.spin_loop()
def __init__(self, url): from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEnginePage from PyQt5.QtCore import QUrl self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self._on_load_finished) self.load(QUrl(url)) self.app.exec_()
def __init__(self): self.app = QApplication(sys.argv) QWebEnginePage.__init__(self) self.html = '' self.loadFinished.connect(self._on_load_finished) self.load( QUrl('https://www.flashscore.pl/mecz/SWuyfsa1/#szczegoly-meczu')) self.app.exec_() self.wynik = [] self.minuta = 0
def __init__(self, parent=None, **kw): Frame.__init__(self, parent, kw) # tkinter的初始化 self.is_first = True self.html = '' self.task_time = [] self.task_info = [] # self.timestr = StringVar() # l = Label(self, textvariable=self.timestr) self.display_info = Listbox(self, width=50) # l.pack() self.display_info.pack() self.app = QApplication(sys.argv) # PyQt5 QWebEnginePage.__init__(self) # PyQt5
def __init__(self): QWebEnginePage.__init__(self) self.loadFinished.connect(self.loadCompleted) self.gosig.connect(self.load) self._pipequeue = None self.free = True self.contentloadhandler = None self.checkktime = 400 self.thread = None self.starttime = 0
def __init__(self): self.log = default_log self.current_frag = None self.com_id = unicode_type(uuid4()) QWebEnginePage.__init__(self) secure_webengine(self.settings(), for_viewer=True) self.titleChanged.connect(self.title_changed) self.loadFinished.connect(self.show_frag) s = QWebEngineScript() s.setName('toc.js') s.setInjectionPoint(QWebEngineScript.InjectionPoint.DocumentReady) s.setRunsOnSubFrames(True) s.setWorldId(QWebEngineScript.ScriptWorldId.ApplicationWorld) s.setSourceCode(P('toc.js', allow_user_override=False, data=True).decode('utf-8').replace('COM_ID', self.com_id)) self.scripts().insert(s)
def __init__(self, url): try: self.app = QApplication(sys.argv) print(15) QWebEnginePage.__init__(self) print(17) self.html = '' print(19) self.loadFinished.connect(self._on_load_finished) print(21) self.load(QUrl(url)) print(23) self.app.exec_() print(25) except Exception as e: print(e)
def __init__(self, url=None): """ Create a webbuffer. :param url: the url to use for the buffer. Must be an instance of QUrl, an str or None to not load any url. """ QWebEnginePage.__init__(self) self.last_use = time.time() cb = current_buffer() if cb: BUFFERS.insert(BUFFERS.index(cb) + 1, self) else: BUFFERS.append(self) hooks.webbuffer_created(self) self.fullScreenRequested.connect(self._on_full_screen_requested) self.featurePermissionRequested.connect(self._on_feature_requested) self._content_handler = WebContentHandler(self) channel = QWebChannel(self) channel.registerObject("contentHandler", self._content_handler) self.setWebChannel(channel, QWebEngineScript.ApplicationWorld) self.loadFinished.connect(self.finished) self.authenticationRequired.connect(self.handle_authentication) self.linkHovered.connect(self.on_url_hovered) self.titleChanged.connect(self.update_title) self.__authentication_data = None self.__delay_loading_url = None self.__keymap_mode = Mode.KEYMAP_NORMAL self.__mode = get_mode("standard-mode") self.__text_edit_mark = False if url: if isinstance(url, DelayedLoadingUrl): self.__delay_loading_url = url else: self.load(url)
def __init__(self, opts, parent, log): QWebEnginePage.__init__(self, parent.profile, parent) secure_webengine(self) self.working = False self.log = log self.load_complete = False self.settle_time = 0 self.wait_for_title = None s = self.settings() s.setAttribute(s.JavascriptEnabled, True) s.setFontSize(s.DefaultFontSize, opts.pdf_default_font_size) s.setFontSize(s.DefaultFixedFontSize, opts.pdf_mono_font_size) s.setFontSize(s.MinimumLogicalFontSize, 8) s.setFontSize(s.MinimumFontSize, 8) std = { 'serif': opts.pdf_serif_family, 'sans' : opts.pdf_sans_family, 'mono' : opts.pdf_mono_family }.get(opts.pdf_standard_font, opts.pdf_serif_family) if std: s.setFontFamily(s.StandardFont, std) if opts.pdf_serif_family: s.setFontFamily(s.SerifFont, opts.pdf_serif_family) if opts.pdf_sans_family: s.setFontFamily(s.SansSerifFont, opts.pdf_sans_family) if opts.pdf_mono_family: s.setFontFamily(s.FixedFont, opts.pdf_mono_family) self.titleChanged.connect(self.title_changed) self.loadStarted.connect(self.load_started) self.loadProgress.connect(self.load_progress) self.loadFinished.connect(self.load_finished) self.load_hang_check_timer = t = QTimer(self) self.load_started_at = 0 t.setTimerType(Qt.VeryCoarseTimer) t.setInterval(HANG_TIME * 1000) t.setSingleShot(True) t.timeout.connect(self.on_load_hang)
def __init__(self, debug=False): QWebEnginePage.__init__(self)
def __init__(self, parent, tab): QWebEnginePage.__init__(self, parent) self.tab = tab
def __init__(self): QWebEnginePage.__init__(self)
def __init__(self, *args, **kwargs): QWebEnginePage.__init__(self, *args, **kwargs) self.featurePermissionRequested.connect( self.onFeaturePermissionRequested)
def __init__(self, parent): QWebEnginePage.__init__(self, create_profile(), parent) secure_webengine(self, for_viewer=True) self.bridge = PreviewBridge(self)