--- a/eric6/Graphics/UMLClassDiagramBuilder.py Sat Sep 21 16:04:17 2019 +0200 +++ b/eric6/Graphics/UMLClassDiagramBuilder.py Sat Sep 21 17:41:22 2019 +0200 @@ -72,8 +72,11 @@ self.allModules = {} try: - extensions = Preferences.getPython("PythonExtensions") + \ - Preferences.getPython("Python3Extensions") + ['.rb'] + extensions = ( + Preferences.getPython("PythonExtensions") + + Preferences.getPython("Python3Extensions") + + ['.rb'] + ) module = Utilities.ModuleParser.readModule( self.file, extensions=extensions, caching=False) except ImportError: @@ -205,12 +208,15 @@ # distribute each generation across the width and the # generations across height y = 10.0 - for currentWidth, currentHeight, generation in \ - zip_longest(widths, heights, generations): + for currentWidth, currentHeight, generation in ( + zip_longest(widths, heights, generations) + ): x = 10.0 # whiteSpace is the space between any two elements - whiteSpace = (width - currentWidth - 20) / \ + whiteSpace = ( + (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0) + ) for className in generation: cw = self.__getCurrentShape(className) cw.setPos(x, y) @@ -293,9 +299,11 @@ @return flag indicating success (boolean) """ parts = data.split(", ") - if len(parts) != 2 or \ - not parts[0].startswith("file=") or \ - not parts[1].startswith("no_attributes="): + if ( + len(parts) != 2 or + not parts[0].startswith("file=") or + not parts[1].startswith("no_attributes=") + ): return False self.file = parts[0].split("=", 1)[1].strip()