Skip to content

Commit

Permalink
<>[]: <On last update>
Browse files Browse the repository at this point in the history
[]

[#532]
  • Loading branch information
Humberto Sanchez II committed Dec 18, 2023
1 parent da29522 commit 96979c9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pyut/experimental/PythonMetaClassDataHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
from logging import Logger
from logging import getLogger

from pyutmodel.PyutClass import PyutClass
from pyutmodel.PyutMethod import PyutMethod
from pyutmodel.PyutMethod import PyutMethods
from pyutmodel.PyutParameter import PyutParameter
from pyutmodel.PyutType import PyutType
from pyutmodel.PyutVisibilityEnum import PyutVisibilityEnum
from pyutmodelv2.PyutClass import PyutClass
from pyutmodelv2.PyutMethod import PyutMethod
from pyutmodelv2.PyutMethod import PyutMethods
from pyutmodelv2.PyutParameter import PyutParameter
from pyutmodelv2.PyutType import PyutType

from pyutmodelv2.enumerations.PyutVisibility import PyutVisibility


class PythonMetaClassDataHandler:
Expand Down Expand Up @@ -91,7 +92,7 @@ def generatePyutMethods(self, clsMethods: List[classmethod]) -> PyutMethods:
defVal = args[3][i - firstDefVal]
if isinstance(defVal, str):
defVal = f'"{defVal}"'
param = PyutParameter(arg, PyutType(""), str(defVal))
param = PyutParameter(name=arg, type=PyutType(value=""), defaultValue=str(defVal))
else:
param = PyutParameter(arg)
meth.addParameter(param)
Expand All @@ -100,9 +101,9 @@ def generatePyutMethods(self, clsMethods: List[classmethod]) -> PyutMethods:
func_name = funcName
if func_name[-2:] != "__":
if func_name[0:2] == "__":
meth.visibility = PyutVisibilityEnum.PRIVATE
meth.visibility = PyutVisibility.PRIVATE
elif func_name[0] == "_":
meth.visibility = PyutVisibilityEnum.PROTECTED
meth.visibility = PyutVisibility.PROTECTED

return methods

Expand Down

0 comments on commit 96979c9

Please sign in to comment.