src/eric7/UI/BrowserModel.py

branch
eric7
changeset 10433
328f3ec4b77a
parent 10398
ef1ea18994d5
child 10439
21c28b0f9e41
--- a/src/eric7/UI/BrowserModel.py	Thu Dec 21 15:46:22 2023 +0100
+++ b/src/eric7/UI/BrowserModel.py	Thu Dec 21 19:50:01 2023 +0100
@@ -30,6 +30,7 @@
 from eric7.Utilities import ClassBrowsers
 from eric7.Utilities.ClassBrowsers import ClbrBaseClasses
 
+# TODO: change this to enum.Enum
 BrowserItemRoot = 0
 BrowserItemSimpleDirectory = 1
 BrowserItemDirectory = 2
@@ -53,9 +54,10 @@
         """
         Constructor
 
-        @param parent reference to parent object (QObject)
+        @param parent reference to parent object
+        @type QObject
         @param nopopulate flag indicating to not populate the model
-            (boolean)
+        @type bool
         """
         super().__init__(parent)
 
@@ -80,8 +82,10 @@
         """
         Public method to get the number of columns.
 
-        @param parent index of parent item (QModelIndex)
-        @return number of columns (integer)
+        @param parent index of parent item
+        @type QModelIndex
+        @return number of columns
+        @rtype int
         """
         if parent is None:
             parent = QModelIndex()
@@ -94,9 +98,12 @@
         """
         Public method to get data of an item.
 
-        @param index index of the data to retrieve (QModelIndex)
-        @param role role of data (Qt.ItemDataRole)
+        @param index index of the data to retrieve
+        @type QModelIndex
+        @param role role of data
+        @type Qt.ItemDataRole
         @return requested data
+        @rtype Any
         """
         if not index.isValid():
             return None
@@ -128,8 +135,10 @@
         """
         Public method to get the item flags.
 
-        @param index index of the data to retrieve (QModelIndex)
-        @return requested flags (Qt.ItemFlags)
+        @param index index of the data to retrieve
+        @type QModelIndex
+        @return requested flags
+        @rtype Qt.ItemFlags
         """
         if not index.isValid():
             return Qt.ItemFlag.ItemIsEnabled
@@ -140,10 +149,14 @@
         """
         Public method to get the header data.
 
-        @param section number of section to get data for (integer)
-        @param orientation header orientation (Qt.Orientation)
-        @param role role of data (Qt.ItemDataRole)
+        @param section number of section to get data for
+        @type int
+        @param orientation header orientation
+        @type Qt.Orientation
+        @param role role of data
+        @type Qt.ItemDataRole
         @return requested header data
+        @rtype Any
         """
         if (
             orientation == Qt.Orientation.Horizontal
@@ -160,10 +173,14 @@
         """
         Public method to create an index.
 
-        @param row row number of the new index (integer)
-        @param column column number of the new index (integer)
-        @param parent index of parent item (QModelIndex)
-        @return index object (QModelIndex)
+        @param row row number of the new index
+        @type int
+        @param column column number of the new index
+        @type int
+        @param parent index of parent item
+        @type QModelIndex
+        @return index object
+        @rtype QModelIndex
         """
         if parent is None:
             parent = QModelIndex()
@@ -196,8 +213,10 @@
         """
         Public method to get the index of the parent object.
 
-        @param index index of the item (QModelIndex)
-        @return index of parent item (QModelIndex)
+        @param index index of the item
+        @type QModelIndex
+        @return index of parent item
+        @rtype QModelIndex
         """
         if not index.isValid():
             return QModelIndex()
@@ -214,8 +233,10 @@
         """
         Public method to get the number of rows.
 
-        @param parent index of parent item (QModelIndex)
-        @return number of rows (integer)
+        @param parent index of parent item
+        @type QModelIndex
+        @return number of rows
+        @rtype int
         """
         if parent is None:
             parent = QModelIndex()
@@ -240,8 +261,10 @@
         We always return True for normal items in order to do lazy
         population of the tree.
 
-        @param parent index of parent item (QModelIndex)
-        @return flag indicating the presence of child items (boolean)
+        @param parent index of parent item
+        @type QModelIndex
+        @return flag indicating the presence of child items
+        @rtype bool
         """
         if parent is None:
             parent = QModelIndex()
@@ -270,8 +293,10 @@
         """
         Public method to get a reference to an item.
 
-        @param index index of the data to retrieve (QModelIndex)
-        @return requested item reference (BrowserItem)
+        @param index index of the data to retrieve
+        @type QModelIndex
+        @return requested item reference
+        @rtype BrowserItem
         """
         if not index.isValid():
             return None
@@ -282,7 +307,8 @@
         """
         Protected method to watch an item.
 
-        @param itm item to be watched (BrowserDirectoryItem)
+        @param itm item to be watched
+        @type BrowserDirectoryItem
         """
         if isinstance(itm, BrowserDirectoryItem):
             dirName = itm.dirName()
@@ -303,7 +329,8 @@
         """
         Protected method to remove a watched item.
 
-        @param itm item to be removed (BrowserDirectoryItem)
+        @param itm item to be removed
+        @type BrowserDirectoryItem
         """
         if isinstance(itm, BrowserDirectoryItem):
             dirName = itm.dirName()
@@ -318,7 +345,8 @@
         """
         Public slot to handle the directoryChanged signal of the watcher.
 
-        @param path path of the directory (string)
+        @param path path of the directory
+        @type str
         """
         if path not in self.watchedItems:
             # just ignore the situation we don't have a reference to the item
@@ -409,7 +437,8 @@
         """
         Public method to handle a change of the debug client's interpreter.
 
-        @param interpreter interpreter of the debug client (string)
+        @param interpreter interpreter of the debug client
+        @type str
         """
         if interpreter and "python" in interpreter.lower():
             if interpreter.endswith("w.exe"):
@@ -447,7 +476,8 @@
         Public method to change the entry for the directory of file being
         debugged.
 
-        @param dirname name of the directory containing the file (string)
+        @param dirname name of the directory containing the file
+        @type str
         """
         if self.progDir:
             if dirname == self.progDir.dirName():
@@ -468,7 +498,8 @@
         """
         Public method to add a new toplevel directory.
 
-        @param dirname name of the new toplevel directory (string)
+        @param dirname name of the new toplevel directory
+        @type str
         """
         if dirname not in self.toplevelDirs:
             itm = BrowserDirectoryItem(self.rootItem, dirname)
@@ -480,7 +511,7 @@
         Public method to remove a toplevel directory.
 
         @param index index of the toplevel directory to be removed
-            (QModelIndex)
+        @type QModelIndex
         """
         if not index.isValid():
             return
@@ -505,8 +536,10 @@
         """
         Protected slot to add an item.
 
-        @param itm reference to item to add (BrowserItem)
-        @param parentItem reference to item to add to (BrowserItem)
+        @param itm reference to item to add
+        @type BrowserItem
+        @param parentItem reference to item to add to
+        @type BrowserItem
         """
         parentItem.appendChild(itm)
 
@@ -514,8 +547,10 @@
         """
         Public slot to add an item.
 
-        @param itm item to add (BrowserItem)
-        @param parent index of parent item (QModelIndex)
+        @param itm item to add
+        @type BrowserItem
+        @param parent index of parent item
+        @type QModelIndex
         """
         if parent is None:
             parent = QModelIndex()
@@ -532,7 +567,9 @@
         Public method to populate an item's subtree.
 
         @param parentItem reference to the item to be populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         if parentItem.type() == BrowserItemDirectory:
             self.populateDirectoryItem(parentItem, repopulate)
@@ -552,7 +589,9 @@
         Public method to populate a directory item's subtree.
 
         @param parentItem reference to the directory item to be populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserDirectoryItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         self._addWatchedItem(parentItem)
 
@@ -595,7 +634,9 @@
         Public method to populate a sys.path item's subtree.
 
         @param parentItem reference to the sys.path item to be populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserSysPathItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         if self.__sysPathInterpreter:
             script = "import sys, json; print(json.dumps(sys.path))"
@@ -633,7 +674,9 @@
         Public method to populate a file item's subtree.
 
         @param parentItem reference to the file item to be populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserFileItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         from eric7.Utilities import ClassBrowsers
 
@@ -764,7 +807,9 @@
         Public method to populate a class item's subtree.
 
         @param parentItem reference to the class item to be populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserClassItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         cl = parentItem.classObject()
         file_ = parentItem.fileName()
@@ -821,7 +866,9 @@
         Public method to populate a method item's subtree.
 
         @param parentItem reference to the method item to be populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         fn = parentItem.functionObject()
         file_ = parentItem.fileName()
@@ -856,7 +903,9 @@
 
         @param parentItem reference to the class attributes item to be
             populated
-        @param repopulate flag indicating a repopulation (boolean)
+        @type BrowserClassAttributesItem
+        @param repopulate flag indicating a repopulation
+        @type bool
         """
         classAttributes = parentItem.isClassAttributes()
         attributes = parentItem.attributes()
@@ -888,7 +937,9 @@
         Constructor
 
         @param parent reference to the parent item
+        @type BrowserItem
         @param data single data of the item
+        @type Any
         """
         self.childItems = []
 
@@ -904,7 +955,8 @@
         """
         Public method to add a child to this item.
 
-        @param child reference to the child item to add (BrowserItem)
+        @param child reference to the child item to add
+        @type BrowserItem
         """
         self.childItems.append(child)
         self._populated = True
@@ -913,7 +965,8 @@
         """
         Public method to remove a child.
 
-        @param child reference to the child to remove (BrowserItem)
+        @param child reference to the child to remove
+        @type BrowserItem
         """
         self.childItems.remove(child)
 
@@ -927,8 +980,10 @@
         """
         Public method to get a child id.
 
-        @param row number of child to get the id of (integer)
-        @return reference to the child item (BrowserItem)
+        @param row number of child to get the id of
+        @type int
+        @return reference to the child item
+        @rtype BrowserItem
         """
         return self.childItems[row]
 
@@ -936,7 +991,8 @@
         """
         Public method to get the ids of all child items.
 
-        @return references to all child items (list of BrowserItem)
+        @return references to all child items
+        @rtype list of BrowserItem
         """
         return self.childItems[:]
 
@@ -944,7 +1000,8 @@
         """
         Public method to get the number of available child items.
 
-        @return number of child items (integer)
+        @return number of child items
+        @rtype int
         """
         return len(self.childItems)
 
@@ -952,7 +1009,8 @@
         """
         Public method to get the number of available data items.
 
-        @return number of data items (integer)
+        @return number of data items
+        @rtype int
         """
         return len(self.itemData)
 
@@ -960,8 +1018,10 @@
         """
         Public method to get a specific data item.
 
-        @param column number of the requested data item (integer)
+        @param column number of the requested data item
+        @type int
         @return stored data item
+        @rtype Any
         """
         try:
             return self.itemData[column]
@@ -973,6 +1033,7 @@
         Public method to get the reference to the parent item.
 
         @return reference to the parent item
+        @rtype BrowserItem
         """
         return self.parentItem
 
@@ -980,7 +1041,8 @@
         """
         Public method to get the row number of this item.
 
-        @return row number (integer)
+        @return row number
+        @rtype int
         """
         try:
             return self.parentItem.childItems.index(self)
@@ -992,14 +1054,17 @@
         Public method to get the item type.
 
         @return type of the item
+        @rtype int
         """
+        # TODO: change this to reference the new Enum
         return self.type_
 
     def isPublic(self):
         """
         Public method returning the public visibility status.
 
-        @return flag indicating public visibility (boolean)
+        @return flag indicating public visibility
+        @rtype bool
         """
         return True
 
@@ -1007,7 +1072,8 @@
         """
         Public method to get the items icon.
 
-        @return the icon (QIcon)
+        @return the icon
+        @rtype QIcon
         """
         return self.icon
 
@@ -1015,7 +1081,8 @@
         """
         Public method to chek, if this item is populated.
 
-        @return population status (boolean)
+        @return population status
+        @rtype bool
         """
         return self._populated
 
@@ -1023,7 +1090,8 @@
         """
         Public method to check, if this item should be populated lazyly.
 
-        @return lazy population flag (boolean)
+        @return lazy population flag
+        @rtype bool
         """
         return self._lazyPopulation
 
@@ -1031,10 +1099,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         try:
             return self.itemData[column] < other.itemData[column]
@@ -1045,7 +1117,8 @@
         """
         Public method to check, if the items is a symbolic link.
 
-        @return flag indicating a symbolic link (boolean)
+        @return flag indicating a symbolic link
+        @rtype bool
         """
         return self.symlink
 
@@ -1060,8 +1133,11 @@
         Constructor
 
         @param parent parent item
-        @param text text to be displayed (string)
-        @param path path of the directory (string)
+        @type BrowserItem
+        @param text text to be displayed
+        @type str
+        @param path path of the directory
+        @type str
         """
         BrowserItem.__init__(self, parent, text)
 
@@ -1081,8 +1157,10 @@
         """
         Public method to set the directory name.
 
-        @param dinfo dinfo is the string for the directory (string)
-        @param full flag indicating full path name should be displayed (boolean)
+        @param dinfo dinfo is the string for the directory
+        @type str
+        @param full flag indicating full path name should be displayed
+        @type bool
         """
         self._dirName = os.path.abspath(dinfo)
         self.itemData[0] = os.path.basename(self._dirName)
@@ -1091,7 +1169,8 @@
         """
         Public method returning the directory name.
 
-        @return directory name (string)
+        @return directory name
+        @rtype str
         """
         return self._dirName
 
@@ -1099,7 +1178,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return self._dirName
 
@@ -1107,10 +1187,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(other.__class__, BrowserFileItem) and Preferences.getUI(
             "BrowsersListFoldersFirst"
@@ -1130,8 +1214,11 @@
         Constructor
 
         @param parent parent item
-        @param dinfo dinfo is the string for the directory (string)
-        @param full flag indicating full pathname should be displayed (boolean)
+        @type BrowserItem
+        @param dinfo dinfo is the string for the directory
+        @type str
+        @param full flag indicating full pathname should be displayed
+        @type bool
         """
         self._dirName = os.path.abspath(dinfo)
         dn = self._dirName if full else os.path.basename(self._dirName)
@@ -1154,8 +1241,10 @@
         """
         Public method to set the directory name.
 
-        @param dinfo dinfo is the string for the directory (string)
-        @param full flag indicating full pathname should be displayed (boolean)
+        @param dinfo dinfo is the string for the directory
+        @type str
+        @param full flag indicating full pathname should be displayed
+        @type bool
         """
         self._dirName = os.path.abspath(dinfo)
         dn = self._dirName if full else os.path.basename(self._dirName)
@@ -1165,7 +1254,8 @@
         """
         Public method returning the directory name.
 
-        @return directory name (string)
+        @return directory name
+        @rtype str
         """
         return self._dirName
 
@@ -1173,7 +1263,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return self._dirName
 
@@ -1181,10 +1272,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(other.__class__, BrowserFileItem) and Preferences.getUI(
             "BrowsersListFoldersFirst"
@@ -1204,6 +1299,7 @@
         Constructor
 
         @param parent parent item
+        @type BrowserItem
         """
         BrowserItem.__init__(self, parent, "sys.path")
 
@@ -1216,7 +1312,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return "sys.path"
 
@@ -1231,9 +1328,13 @@
         Constructor
 
         @param parent parent item
-        @param finfo the string for the file (string)
-        @param full flag indicating full pathname should be displayed (boolean)
-        @param sourceLanguage source code language of the project (string)
+        @type BrowserItem
+        @param finfo the string for the file
+        @type str
+        @param full flag indicating full pathname should be displayed
+        @type bool
+        @param sourceLanguage source code language of the project
+        @type str
         """
         BrowserItem.__init__(self, parent, os.path.basename(finfo))
 
@@ -1305,8 +1406,10 @@
         """
         Public method to set the directory name.
 
-        @param finfo the string for the file (string)
-        @param full flag indicating full pathname should be displayed (boolean)
+        @param finfo the string for the file
+        @type str
+        @param full flag indicating full pathname should be displayed
+        @type bool
         """
         self._filename = os.path.abspath(finfo)
         self.itemData[0] = os.path.basename(finfo)
@@ -1319,7 +1422,8 @@
         """
         Public method returning the filename.
 
-        @return filename (string)
+        @return filename
+        @rtype str
         """
         return self._filename
 
@@ -1327,7 +1431,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return self._filename
 
@@ -1335,7 +1440,8 @@
         """
         Public method returning the file extension.
 
-        @return file extension (string)
+        @return file extension
+        @rtype str
         """
         return self.fileext
 
@@ -1343,7 +1449,8 @@
         """
         Public method returning the directory name.
 
-        @return directory name (string)
+        @return directory name
+        @rtype str
         """
         return self._dirName
 
@@ -1351,7 +1458,8 @@
         """
         Public method returning the module name.
 
-        @return module name (string)
+        @return module name
+        @rtype str
         """
         return self._moduleName
 
@@ -1478,7 +1586,8 @@
         """
         Public method to check, if this file is a D file.
 
-        @return flag indicating a D file (boolean)
+        @return flag indicating a D file
+        @rtype bool
         """
         return self.fileext in [".d", ".di"] or (
             self.fileext == "" and self.sourceLanguage == "D"
@@ -1506,10 +1615,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if not issubclass(other.__class__, BrowserFileItem) and Preferences.getUI(
             "BrowsersListFoldersFirst"
@@ -1537,8 +1650,11 @@
         Constructor
 
         @param parent parent item
+        @type BrowserItem
         @param cl Class object to be shown
-        @param filename filename of the file defining this class
+        @type Class
+        @param filename file name of the file defining this class
+        @type str
         """
         name = cl.name
         if hasattr(cl, "super") and cl.super:
@@ -1605,7 +1721,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return "{0}@@{1}".format(self._filename, self.lineno())
 
@@ -1613,7 +1730,8 @@
         """
         Public method returning the filename.
 
-        @return filename (string)
+        @return filename
+        @rtype str
         """
         return self._filename
 
@@ -1622,6 +1740,7 @@
         Public method returning the class object.
 
         @return reference to the class object
+        @rtype Class
         """
         return self._classObject
 
@@ -1629,7 +1748,8 @@
         """
         Public method returning the line number defining this object.
 
-        @return line number defining the object (integer)
+        @return line number defining the object
+        @rtype int
         """
         return self._classObject.lineno
 
@@ -1637,7 +1757,8 @@
         """
         Public method returning the boundaries of the method definition.
 
-        @return tuple with start end end line number (integer, integer)
+        @return tuple with start end end line number
+        @rtype tuple of (int, int)
         """
         return (self._classObject.lineno, self._classObject.endlineno)
 
@@ -1645,10 +1766,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(other.__class__, (BrowserCodingItem, BrowserClassAttributesItem)):
             return order == Qt.SortOrder.DescendingOrder
@@ -1665,7 +1790,8 @@
         """
         Public method returning the public visibility status.
 
-        @return flag indicating public visibility (boolean)
+        @return flag indicating public visibility
+        @rtype bool
         """
         return self._classObject.isPublic()
 
@@ -1680,8 +1806,11 @@
         Constructor
 
         @param parent parent item
+        @type BrowserItem
         @param fn Function object to be shown
-        @param filename filename of the file defining this class (string)
+        @type Function
+        @param filename filename of the file defining this class
+        @type str
         """
         name = fn.name
         BrowserItem.__init__(self, parent, name)
@@ -1721,7 +1850,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return "{0}@@{1}".format(self._filename, self.lineno())
 
@@ -1729,7 +1859,8 @@
         """
         Public method returning the filename.
 
-        @return filename (string)
+        @return filename
+        @rtype str
         """
         return self._filename
 
@@ -1738,6 +1869,7 @@
         Public method returning the function object.
 
         @return reference to the function object
+        @rtype Function
         """
         return self._functionObject
 
@@ -1745,7 +1877,8 @@
         """
         Public method returning the line number defining this object.
 
-        @return line number defining the object (integer)
+        @return line number defining the object
+        @rtype int
         """
         return self._functionObject.lineno
 
@@ -1753,7 +1886,8 @@
         """
         Public method returning the boundaries of the method definition.
 
-        @return tuple with start end end line number (integer, integer)
+        @return tuple with start end end line number
+        @rtype tuple of (int, int)
         """
         return (self._functionObject.lineno, self._functionObject.endlineno)
 
@@ -1761,10 +1895,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(other.__class__, BrowserMethodItem):
             if self._name.startswith("__init__"):
@@ -1786,7 +1924,8 @@
         """
         Public method returning the public visibility status.
 
-        @return flag indicating public visibility (boolean)
+        @return flag indicating public visibility
+        @rtype bool
         """
         return self._functionObject.isPublic()
 
@@ -1801,9 +1940,13 @@
         Constructor
 
         @param parent parent item
+        @type BrowserItem
         @param attributes list of attributes
-        @param text text to be shown by this item (string)
-        @param isClass flag indicating class attributes (boolean)
+        @type list of Attribute
+        @param text text to be shown by this item
+        @type str
+        @param isClass flag indicating class attributes
+        @type bool
         """
         BrowserItem.__init__(self, parent, text)
 
@@ -1821,7 +1964,8 @@
         """
         Public method to return the name of the item.
 
-        @return name of the item (string)
+        @return name of the item
+        @rtype str
         """
         return "{0}@@{1}".format(self.parentItem.name(), self.data(0))
 
@@ -1830,6 +1974,7 @@
         Public method returning the attribute list.
 
         @return reference to the list of attributes
+        @rtype list of Attribute
         """
         return self._attributes
 
@@ -1837,7 +1982,8 @@
         """
         Public method returning the attributes type.
 
-        @return flag indicating class attributes (boolean)
+        @return flag indicating class attributes
+        @rtype bool
         """
         return self.__isClass
 
@@ -1845,10 +1991,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(other.__class__, BrowserCodingItem):
             return order == Qt.SortOrder.DescendingOrder
@@ -1868,8 +2018,11 @@
         Constructor
 
         @param parent parent item
+        @type BrowserItem
         @param attribute reference to the attribute object
-        @param isClass flag indicating a class attribute (boolean)
+        @type Attribute
+        @param isClass flag indicating a class attribute
+        @type bool
         """
         BrowserItem.__init__(self, parent, attribute.name)
 
@@ -1889,7 +2042,8 @@
         """
         Public method returning the public visibility status.
 
-        @return flag indicating public visibility (boolean)
+        @return flag indicating public visibility
+        @rtype bool
         """
         return self.__public
 
@@ -1898,6 +2052,7 @@
         Public method returning the class object.
 
         @return reference to the class object
+        @rtype Class
         """
         return self._attributeObject
 
@@ -1905,7 +2060,8 @@
         """
         Public method returning the filename.
 
-        @return filename (string)
+        @return filename
+        @rtype str
         """
         return self._attributeObject.file
 
@@ -1913,7 +2069,8 @@
         """
         Public method returning the line number defining this object.
 
-        @return line number defining the object (integer)
+        @return line number defining the object
+        @rtype int
         """
         return self._attributeObject.lineno
 
@@ -1921,7 +2078,8 @@
         """
         Public method returning the line numbers this object is assigned to.
 
-        @return line number the object is assigned to (list of integers)
+        @return line number the object is assigned to
+        @rtype list of int
         """
         return self._attributeObject.linenos[:]
 
@@ -1929,10 +2087,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if Preferences.getUI("BrowsersListContentsByOccurrence") and column == 0:
             if order == Qt.SortOrder.AscendingOrder:
@@ -1953,8 +2115,11 @@
         Constructor
 
         @param parent parent item
+        @type BrowserItem
         @param attributes list of attributes
-        @param text text to be shown by this item (string)
+        @type list of Attribute
+        @param text text to be shown by this item
+        @type str
         """
         BrowserClassAttributesItem.__init__(self, parent, attributes, text)
 
@@ -1995,10 +2160,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(
             other.__class__,
@@ -2019,7 +2188,9 @@
         Constructor
 
         @param parent parent item
-        @param text text to be shown by this item (string)
+        @type BrowserItem
+        @param text text to be shown by this item
+        @type str
         """
         BrowserItem.__init__(self, parent, text)
 
@@ -2030,10 +2201,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if issubclass(other.__class__, (BrowserClassItem, BrowserClassAttributesItem)):
             return order == Qt.SortOrder.AscendingOrder
@@ -2052,11 +2227,15 @@
         Constructor
 
         @param parent parent item
-        @param text text to be shown by this item (string)
-        @param filename name of the file (string)
+        @type BrowserItem
+        @param text text to be shown by this item
+        @type str
+        @param filename name of the file
+        @type str
         @param lineNumbers list of line numbers of the import statement
-            (list of integer)
-        @param isModule flag indicating a module item entry (boolean)
+        @type list of int
+        @param isModule flag indicating a module item entry
+        @type bool
         """
         BrowserItem.__init__(self, parent, text)
 
@@ -2073,7 +2252,8 @@
         """
         Public method returning the filename.
 
-        @return filename (string)
+        @return filename
+        @rtype str
         """
         return self.__filename
 
@@ -2081,7 +2261,8 @@
         """
         Public method returning the line number of the first import.
 
-        @return line number of the first import (integer)
+        @return line number of the first import
+        @rtype int
         """
         return self.__linenos[0]
 
@@ -2089,7 +2270,8 @@
         """
         Public method returning the line numbers of all imports.
 
-        @return line numbers of all imports (list of integers)
+        @return line numbers of all imports
+        @rtype list of int
         """
         return self.__linenos[:]
 
@@ -2097,10 +2279,14 @@
         """
         Public method to check, if the item is less than the other one.
 
-        @param other reference to item to compare against (BrowserItem)
-        @param column column number to use for the comparison (integer)
-        @param order sort order (Qt.SortOrder) (for special sorting)
-        @return true, if this item is less than other (boolean)
+        @param other reference to item to compare against
+        @type BrowserItem
+        @param column column number to use for the comparison
+        @type int
+        @param order sort order (for special sorting)
+        @type Qt.SortOrder
+        @return true, if this item is less than other
+        @rtype bool
         """
         if Preferences.getUI("BrowsersListContentsByOccurrence") and column == 0:
             if order == Qt.SortOrder.AscendingOrder:

eric ide

mercurial