--- a/eric6/Graphics/PackageDiagramBuilder.py Sat Sep 21 16:04:17 2019 +0200 +++ b/eric6/Graphics/PackageDiagramBuilder.py Sat Sep 21 17:41:22 2019 +0200 @@ -73,14 +73,18 @@ """ import Utilities.ModuleParser - supportedExt = \ + supportedExt = ( ['*{0}'.format(ext) for ext in - Preferences.getPython("PythonExtensions")] + \ + Preferences.getPython("PythonExtensions")] + ['*{0}'.format(ext) for ext in - Preferences.getPython("Python3Extensions")] + \ + Preferences.getPython("Python3Extensions")] + ['*.rb'] - extensions = Preferences.getPython("PythonExtensions") + \ - Preferences.getPython("Python3Extensions") + ['.rb'] + ) + extensions = ( + Preferences.getPython("PythonExtensions") + + Preferences.getPython("Python3Extensions") + + ['.rb'] + ) moduleDict = {} modules = [] @@ -125,23 +129,31 @@ """ import Utilities.ModuleParser - supportedExt = \ + supportedExt = ( ['*{0}'.format(ext) for ext in - Preferences.getPython("PythonExtensions")] + \ + Preferences.getPython("PythonExtensions")] + ['*{0}'.format(ext) for ext in - Preferences.getPython("Python3Extensions")] + \ + Preferences.getPython("Python3Extensions")] + ['*.rb'] - extensions = Preferences.getPython("PythonExtensions") + \ - Preferences.getPython("Python3Extensions") + ['.rb'] + ) + extensions = ( + Preferences.getPython("PythonExtensions") + + Preferences.getPython("Python3Extensions") + + ['.rb'] + ) subpackagesDict = {} subpackagesList = [] for subpackage in os.listdir(self.package): subpackagePath = os.path.join(self.package, subpackage) - if os.path.isdir(subpackagePath) and \ - subpackage != "__pycache__" and \ - len(glob.glob(os.path.join(subpackagePath, "__init__.*"))) != 0: + if ( + os.path.isdir(subpackagePath) and + subpackage != "__pycache__" and + len(glob.glob( + os.path.join(subpackagePath, "__init__.*") + )) != 0 + ): subpackagesList.append(subpackagePath) tot = 0 @@ -349,12 +361,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) @@ -450,9 +465,11 @@ @return flag indicating success (boolean) """ parts = data.split(", ") - if len(parts) != 2 or \ - not parts[0].startswith("package=") or \ - not parts[1].startswith("no_attributes="): + if ( + len(parts) != 2 or + not parts[0].startswith("package=") or + not parts[1].startswith("no_attributes=") + ): return False self.package = parts[0].split("=", 1)[1].strip()