pyloid 0.16.0__tar.gz → 0.16.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pyloid-0.16.0 → pyloid-0.16.1}/PKG-INFO +1 -1
- {pyloid-0.16.0 → pyloid-0.16.1}/pyproject.toml +1 -1
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/browser_window.py +25 -2
- {pyloid-0.16.0 → pyloid-0.16.1}/LICENSE +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/README.md +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/__init__.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/api.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/autostart.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/custom/titlebar.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/filewatcher.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/js_api/event_api.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/js_api/window_api.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/monitor.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/pyloid.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/timer.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/tray.py +0 -0
- {pyloid-0.16.0 → pyloid-0.16.1}/src/pyloid/utils.py +0 -0
@@ -353,7 +353,7 @@ class BrowserWindow:
|
|
353
353
|
###########################################################################################
|
354
354
|
# Load
|
355
355
|
###########################################################################################
|
356
|
-
def load_file(self, file_path):
|
356
|
+
def load_file(self, file_path: str):
|
357
357
|
"""
|
358
358
|
Loads a local HTML file into the web view.
|
359
359
|
|
@@ -374,7 +374,7 @@ class BrowserWindow:
|
|
374
374
|
self.web_view.setUrl(QUrl.fromLocalFile(file_path))
|
375
375
|
self.web_view.focusProxy().installEventFilter(self.web_view)
|
376
376
|
|
377
|
-
def load_url(self, url):
|
377
|
+
def load_url(self, url: str):
|
378
378
|
"""
|
379
379
|
Sets the URL of the window.
|
380
380
|
|
@@ -394,6 +394,29 @@ class BrowserWindow:
|
|
394
394
|
self.web_view.setUrl(QUrl(url))
|
395
395
|
self.web_view.focusProxy().installEventFilter(self.web_view)
|
396
396
|
|
397
|
+
def load_html(self, html_content: str, base_url: str = ""):
|
398
|
+
"""
|
399
|
+
Loads HTML content directly into the web view.
|
400
|
+
|
401
|
+
Parameters
|
402
|
+
----------
|
403
|
+
html_content : str
|
404
|
+
The HTML content to be loaded.
|
405
|
+
base_url : str, optional
|
406
|
+
The base URL to use for resolving relative URLs (default is "").
|
407
|
+
|
408
|
+
Examples
|
409
|
+
--------
|
410
|
+
>>> app = Pyloid(app_name="Pyloid-App")
|
411
|
+
>>> window = app.create_window("pyloid-window")
|
412
|
+
>>> html_content = "<html><body><h1>Hello, Pyloid!</h1></body></html>"
|
413
|
+
>>> window.load_html(html_content)
|
414
|
+
>>> window.show()
|
415
|
+
"""
|
416
|
+
self._load()
|
417
|
+
self.web_view.setHtml(html_content, QUrl(base_url))
|
418
|
+
self.web_view.focusProxy().installEventFilter(self.web_view)
|
419
|
+
|
397
420
|
###########################################################################################
|
398
421
|
# Set Parameters
|
399
422
|
###########################################################################################
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|