Mon, 03 May 2021 19:58:28 +0200
Changed some source docu string to the new style.
--- a/eric6/Graphics/ApplicationDiagramBuilder.py Mon May 03 19:42:27 2021 +0200 +++ b/eric6/Graphics/ApplicationDiagramBuilder.py Mon May 03 19:58:28 2021 +0200 @@ -29,11 +29,15 @@ """ Constructor - @param dialog reference to the UML dialog (UMLDialog) - @param view reference to the view object (UMLGraphicsView) - @param project reference to the project object (Project) + @param dialog reference to the UML dialog + @type UMLDialog + @param view reference to the view object + @type UMLGraphicsView + @param project reference to the project object + @type Project @param noModules flag indicating, that no module names should be - shown (boolean) + shown + @type bool """ super().__init__(dialog, view, project) self.setObjectName("ApplicationDiagram") @@ -49,7 +53,8 @@ Private method to build a dictionary of modules contained in the application. - @return dictionary of modules contained in the application. + @return dictionary of modules contained in the application + @rtype dict """ import Utilities.ModuleParser extensions = ( @@ -269,12 +274,16 @@ """ Private method to add a package to the diagram. - @param name package name to be shown (string) + @param name package name to be shown + @type str @param modules list of module names contained in the package - (list of strings) - @param x x-coordinate (float) - @param y y-coordinate (float) - @return reference to the package item (PackageItem) + @type list of str + @param x x-coordinate + @type float + @param y y-coordinate + @type float + @return reference to the package item + @rtype PackageItem """ from .PackageItem import PackageItem, PackageModel modules.sort() @@ -383,7 +392,8 @@ """ Public method to get a string for data to be persisted. - @return persisted data string (string) + @return persisted data string + @rtype str """ return "project={0}, no_modules={1}".format( self.project.getProjectFile(), self.noModules) @@ -392,9 +402,12 @@ """ Public method to parse persisted data. - @param version version of the data (string) - @param data persisted data to be parsed (string) - @return flag indicating success (boolean) + @param version version of the data + @type str + @param data persisted data to be parsed + @type str + @return flag indicating success + @rtype bool """ parts = data.split(", ") if (
--- a/eric6/Graphics/AssociationItem.py Mon May 03 19:42:27 2021 +0200 +++ b/eric6/Graphics/AssociationItem.py Mon May 03 19:58:28 2021 +0200 @@ -107,8 +107,10 @@ Private method to map item's rectangle to this item's coordinate system. - @param item reference to the item to be mapped (QGraphicsRectItem) - @return item's rectangle in local coordinates (QRectF) + @param item reference to the item to be mapped + @type QGraphicsRectItem + @return item's rectangle in local coordinates + @rtype QRectF """ rect = item.rect() tl = self.mapFromItem(item, rect.topLeft()) @@ -260,9 +262,12 @@ Private method to find out, which region of rectangle rect contains the point (PosX, PosY) and returns the region number. - @param rect rectangle to calculate the region for (QRectF) - @param posX x position of point (float) - @param posY y position of point (float) + @param rect rectangle to calculate the region for + @type QRectF + @param posX x position of point + @type float + @param posY y position of point + @type float @return the calculated region number<br /> West = Region 1<br /> North = Region 2<br /> @@ -273,6 +278,7 @@ SouthEast = On diagonal 2 between Region 3 and 4<br /> SouthWest = On diagonal 1 between Region4 and 1<br /> Center = On diagonal 1 and On diagonal 2 (the center)<br /> + @rtype AssociationPointRegion """ w = rect.width() h = rect.height() @@ -330,8 +336,10 @@ """ Private method to update an endpoint. - @param region the region for the endpoint (integer) - @param isWidgetA flag indicating update for itemA is done (boolean) + @param region the region for the endpoint + @type AssociationPointRegion + @param isWidgetA flag indicating update for itemA is done + @type bool """ if region == AssociationPointRegion.NO_REGION: return @@ -371,13 +379,17 @@ def __findRectIntersectionPoint(self, item, p1, p2): """ - Private method to find the intersetion point of a line with a + Private method to find the intersection point of a line with a rectangle. @param item item to check against - @param p1 first point of the line (QPointF) - @param p2 second point of the line (QPointF) - @return the intersection point (QPointF) + @type UMLItem + @param p1 first point of the line + @type QPointF + @param p2 second point of the line + @type QPointF + @return the intersection point + @rtype QPointF """ rect = self.__mapRectFromItem(item) lines = [ @@ -419,11 +431,16 @@ In order for the linear function calculations to work in this method we must switch x and y values (x values become y values and viceversa) - @param p1 first point of first line (QPointF) - @param p2 second point of first line (QPointF) - @param p3 first point of second line (QPointF) - @param p4 second point of second line (QPointF) - @return the intersection point (QPointF) + @param p1 first point of first line + @type QPointF + @param p2 second point of first line + @type QPointF + @param p3 first point of second line + @type QPointF + @param p4 second point of second line + @type QPointF + @return the intersection point + @rtype QPointF """ x1 = p1.y() y1 = p1.x() @@ -545,7 +562,8 @@ This string should be built like "attribute=value" with pairs separated by ", ". value must not contain ", " or newlines. - @return persistence data (string) + @return persistence data + @rtype str """ entries = [ "src={0}".format(self.itemA.getId()), @@ -560,10 +578,12 @@ """ Class method to parse the given persistence data. - @param data persisted data to be parsed (string) + @param data persisted data to be parsed + @type str @return tuple with the IDs of the source and destination items, the association type and a flag indicating to associate from top - to bottom (integer, integer, integer, boolean) + to bottom + @rtype tuple of (int, int, int, bool) """ src = -1 dst = -1
--- a/eric6/Graphics/ClassItem.py Mon May 03 19:42:27 2021 +0200 +++ b/eric6/Graphics/ClassItem.py Mon May 03 19:58:28 2021 +0200 @@ -229,7 +229,9 @@ height = self.header.boundingRect().height() if self.classAttributes: width = max(width, self.classAttributes.boundingRect().width()) - height += self.classAttributes.boundingRect().height() + self.margin + height += ( + self.classAttributes.boundingRect().height() + self.margin + ) if self.attrs: width = max(width, self.attrs.boundingRect().width()) height = height + self.attrs.boundingRect().height() + self.margin @@ -243,7 +245,8 @@ """ Public method to set the class model. - @param model class model containing the class data (ClassModel) + @param model class model containing the class data + @type ClassModel """ self.scene().removeItem(self.header) self.header = None @@ -264,9 +267,12 @@ """ Public method to paint the item in local coordinates. - @param painter reference to the painter object (QPainter) - @param option style options (QStyleOptionGraphicsItem) - @param widget optional reference to the widget painted on (QWidget) + @param painter reference to the painter object + @type QPainter + @param option style options + @type QStyleOptionGraphicsItem + @param widget optional reference to the widget painted on + @type QWidget """ pen = self.pen() if ( @@ -304,7 +310,8 @@ """ Public method returning the external state. - @return external state (boolean) + @return external state + @rtype bool """ return self.external @@ -316,7 +323,8 @@ "attribute=value" with pairs separated by ", ". value must not contain ", " or newlines. - @return persistence data (string) + @return persistence data + @rtype str """ entries = [ "is_external={0}".format(self.external), @@ -342,9 +350,12 @@ """ Public method to parse the given persistence data. - @param version version of the data (string) - @param data persisted data to be parsed (string) - @return flag indicating success (boolean) + @param version version of the data + @type str + @param data persisted data to be parsed + @type str + @return flag indicating success + @rtype bool """ parts = data.split(", ") if len(parts) < 3:
--- a/eric6/Graphics/GraphicsUtilities.py Mon May 03 19:42:27 2021 +0200 +++ b/eric6/Graphics/GraphicsUtilities.py Mon May 03 19:58:28 2021 +0200 @@ -25,9 +25,13 @@ The algorithm was taken from Boa Constructor. @param nodes list of nodes to be sorted + @type str @param routes list of routes between the nodes + @type list of tuple of (str, str) @param noRecursion flag indicating, if recursion errors should be raised + @type bool @return list of stages + @rtype list of lists of str @exception RecursionError a recursion error was detected """ children, parents = _buildChildrenLists(routes) @@ -97,7 +101,9 @@ Taken from Boa Constructor. @param routes list of routes between nodes + @type list of tuple of (str, str) @return dictionary of child and dictionary of parent relationships + @rtype tuple of (dict, dict) """ childrenTable = {} parentTable = {}
--- a/eric6/Graphics/ImportsDiagramBuilder.py Mon May 03 19:42:27 2021 +0200 +++ b/eric6/Graphics/ImportsDiagramBuilder.py Mon May 03 19:58:28 2021 +0200 @@ -32,13 +32,18 @@ """ Constructor - @param dialog reference to the UML dialog (UMLDialog) - @param view reference to the view object (UMLGraphicsView) - @param project reference to the project object (Project) + @param dialog reference to the UML dialog + @type UMLDialog + @param view reference to the view object + @type UMLGraphicsView + @param project reference to the project object + @type Project @param package name of a python package to show the import - relationships (string) + relationships + @type str @param showExternalImports flag indicating to show exports from - outside the package (boolean) + outside the package + @type bool """ super().__init__(dialog, view, project) self.setObjectName("ImportsDiagram") @@ -74,7 +79,8 @@ Private method to build a dictionary of modules contained in the package. - @return dictionary of modules contained in the package. + @return dictionary of modules contained in the package + @rtype dict """ import Utilities.ModuleParser extensions = ( @@ -202,12 +208,16 @@ """ Private method to add a module to the diagram. - @param name module name to be shown (string) + @param name module name to be shown + @type str @param classes list of class names contained in the module - (list of strings) - @param x x-coordinate (float) - @param y y-coordinate (float) - @return reference to the imports item (ModuleItem) + @type list of str + @param x x-coordinate + @type float + @param y y-coordinate + @type float + @return reference to the imports item + @rtype ModuleItem """ from .ModuleItem import ModuleItem, ModuleModel classes.sort() @@ -316,7 +326,8 @@ """ Public method to get a string for data to be persisted. - @return persisted data string (string) + @return persisted data string + @rtype str """ return "package={0}, show_external={1}".format( self.packagePath, self.showExternalImports) @@ -325,9 +336,12 @@ """ Public method to parse persisted data. - @param version version of the data (string) - @param data persisted data to be parsed (string) - @return flag indicating success (boolean) + @param version version of the data + @type str + @param data persisted data to be parsed + @type str + @return flag indicating success + @rtype bool """ parts = data.split(", ") if (