ProjectWeb/Html5ToJsConverter.py

branch
eric7
changeset 38
6a12561fc0b5
parent 35
a3f1dcf94fe4
child 40
a9b17341d181
diff -r 01822a402c97 -r 6a12561fc0b5 ProjectWeb/Html5ToJsConverter.py
--- a/ProjectWeb/Html5ToJsConverter.py	Tue May 25 19:44:14 2021 +0200
+++ b/ProjectWeb/Html5ToJsConverter.py	Tue May 25 20:12:47 2021 +0200
@@ -12,8 +12,8 @@
 import datetime
 import getpass
 
-from PyQt5.QtCore import QObject
-from PyQt5.QtWidgets import QDialog
+from PyQt6.QtCore import QObject
+from PyQt6.QtWidgets import QDialog
 
 from .Html5ToJsConverterParameterDialog import (
     Html5ToJsConverterParameterDialog
@@ -34,8 +34,10 @@
         """
         Constructor
         
-        @param html HTML text to be converted (string)
-        @param parent reference to the parent object (QObject)
+        @param html HTML text to be converted
+        @type str
+        @param parent reference to the parent object
+        @type QObject
         """
         super().__init__(parent)
         
@@ -45,10 +47,11 @@
         """
         Public method to get the converted JavaScript text.
         
-        @return JavaScript text (string)
+        @return JavaScript text
+        @rtype str
         """
         dlg = Html5ToJsConverterParameterDialog()
-        if dlg.exec() == QDialog.Accepted:
+        if dlg.exec() == QDialog.DialogCode.Accepted:
             indentation, scriptTags = dlg.getData()
             
             self.__createSoup()
@@ -133,7 +136,8 @@
         Private method to extract all classes of the HTML text.
         
         @return list of tuples containing the tag name and its classes
-            as a blank separated string (list of tuples of two strings)
+            as a blank separated string
+        @rtype list of tuples of (str, str)
         """
         classes = [(t.name, " ".join(t["class"])) for t in
                    self.__soup.find_all(True, {"class": True})]
@@ -144,7 +148,7 @@
         Private method to extract all IDs of the HTML text.
         
         @return list of tuples containing the tag name and its ID
-            (list of tuples of two strings)
+        @rtype list of tuples of (str, str)
         """
         ids = [(t.name, t["id"]) for t in
                self.__soup.find_all(True, {"id": True})]

eric ide

mercurial