def load_html(self, html, base_uri): file_name = '%s.html' % uuid4().hex self.temp_html = os.path.join(WinForms.Application.StartupPath, file_name) with open(self.temp_html, 'w') as f: f.write(inject_base_uri(html, base_uri)) self.web_view.NavigateToLocal(file_name)
def load_html(self, html, base_uri): file_name = '%s.html' % uuid4().hex path = WinForms.Application.StartupPath if sys.version < '3' else WinForms.Application.UserAppDataPath self.temp_html = os.path.join(path, file_name) with open(self.temp_html, 'w') as f: f.write(inject_base_uri(html, base_uri)) self.web_view.NavigateToLocal(file_name)
def load_html(self, html, base_uri): self.tmpdir = tempfile.mkdtemp() self.temp_html = os.path.join(self.tmpdir, 'index.html') with open(self.temp_html, 'w', encoding='utf-8') as f: f.write(inject_base_uri(html, base_uri)) if self.httpd: self.httpd.shutdown() url, _ = start_server('file://' + self.temp_html) self.ishtml = True self.web_view.Navigate(url)
def load_html(self, html, base_uri): self.tmpdir = tempfile.mkdtemp() self.temp_html = os.path.join(self.tmpdir, 'index.html') with open(self.temp_html, 'w', encoding='utf-8') as f: f.write(inject_base_uri(html, base_uri)) if self.httpd: self.httpd.shutdown() url = resolve_url('file://' + self.temp_html, True) self.ishtml = True self.web_view.Source = Uri(url)
def load_html(content, base_uri, uid): def _load_html(): window.web_browser.DocumentText = inject_base_uri(content, base_uri) if is_cef: CEF.load_html(inject_base_uri(content, base_uri), uid) return window = BrowserView.instances[uid] window.load_event.clear() if window.InvokeRequired: window.Invoke(Func[Type](_load_html)) else: _load_html()
def load_html(self, content, base_uri): self.web_browser.DocumentText = inject_base_uri(content, base_uri) self.pywebview_window.loaded.clear()
def _load_html(): window.web_browser.DocumentText = inject_base_uri(content, base_uri)
def load_html(content, base_uri, uid): if is_cef: CEF.load_html(inject_base_uri(content, base_uri), uid) return else: BrowserView.instances[uid].load_html(content, base_uri)