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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyloid
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyloid"
3
- version = "0.16.0"
3
+ version = "0.16.1"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -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