Tool modernize.py
- Class methods decorated with
@property: can only be calledh.typeas it shoud - Composite data types like
Vector3: syntactic sugar for tuples - Functions with type annotated args and returns
- Docstring lines ends up with two spaces (markdown newline)
- Reorder of docstring structure: Description came first, everything else - below
- See-also function links to navigate thru
Appears there is no single point of truth in VectorScript definitions...
So we gather relevant pieces from several different places:
- Arg types from
vs.pytrailing comments:# REAL - Real number. - Return types from
vs.pypascal docstring:VectorScript: FUNCTION Abs(v:REAL) : REAL; - See-also links and Deprecated status from
VectorScript Reference.xml
There is some hacks to work around data inconsistancy:
- Class method types hardcoded: seems there is no data to derive from...
- Funcs with extra phantom return in Python docstrings: corrected from VectorScript counterparts...
CreateDataVisPDMenu, CreateStyledStatic, GetDrawingArea, GetGradientDataN, GetLBItemMkrChoice,PopupGetChoices, RefreshResManager, RunImageComp, SetLBItemByClass, SetLBItemMkrChoice, SetParamStyleType - Funcs with variadic arg: marked as *arg
Concat, Message, Poly, Poly3D, Write, WriteBin, WriteLn, WriteLnMac, WriteMac
GS_EdSh_ConstructLayout: not marked because it has 3 variadic args - not possible in python - Funcs with wrong arg types:
Poly: argpmust bePOINTinstead ofREAL
Poly3D: argpmust bePOINT3Dinstead ofREAL - Funcs with wrong arg count:
Comp: must bev3,v4 = Comp(v1,v2)instead ofv3,v4 = Comp(v1,v2,v3,v4)