hasii2011 / pyut

A UML Diagrammer implemented in Python
GNU Affero General Public License v3.0
12 stars 4 forks source link

Loading a file with multiple classes does not work 🐛 #338

Closed hasii2011 closed 1 year ago

hasii2011 commented 2 years ago

Discovered during investigation of creating the external plugin manager core project

hasii2011 commented 1 year ago

Unable to reproduce this; Imported this file:


class ParentClass1:

    def __init(self):
        pass

class ParentClass2:

    def __init(self):
        pass

class ChildClass1(ParentClass1):

    def __init(self):
        pass

class ChildClass2(ParentClass1):

    def __init(self):
        pass

class ChildClass3(ParentClass2):

    def __init(self):
        pass

class ChildClass4(ParentClass2):

    def __init(self):
        pass

And drew this:

image
hasii2011 commented 1 year ago

Tried this file:


from typing import List

class Cat:
    """
    I am just a gato
    """
    def __init__(self, name, age):
        """
        Args:
            name:
            age:
        """
        self._name: str = name
        self._age:  int = age

    def sit(self):
        """
        (TODO : add description)

        """
        pass

    def rollOver(self):
        """
        (TODO : add description)

        """
        pass

class Opie(Cat):
    """
    I am Opie the cat
    """
    def __init__(self):
        """
        """
        super().__init__(name='Opie', age=15)

        self.__privateParts: List[str] = []
        self.publicEars:     float     = 1.0
        self._protectedTail: int       = 22

    def publicMethod(self, param1: float = 23.0) -> bool:
        """
        (TODO : add description)

        Args:
            param1:
        Returns:
            bool
        """
        ans: bool = False
        if param1 > 23:
            ans = False

        return ans

And drew this:

image