Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Enhance vs.py file with several IDE-friedly modern features

  1. Class methods decorated with @property: can only be called h.type as it shoud
  2. Composite data types like Vector3: syntactic sugar for tuples
  3. Functions with type annotated args and returns
  4. Docstring lines ends up with two spaces (markdown newline)
  5. Reorder of docstring structure: Description came first, everything else - below
  6. See-also function links to navigate thru

Info gathering

Appears there is no single point of truth in VectorScript definitions...
So we gather relevant pieces from several different places:

  1. Arg types from vs.py trailing comments: # REAL - Real number.
  2. Return types from vs.py pascal docstring: VectorScript: FUNCTION Abs(v:REAL) : REAL;
  3. See-also links and Deprecated status from VectorScript Reference.xml

Inconsistancy hacks

There is some hacks to work around data inconsistancy:

  1. Class method types hardcoded: seems there is no data to derive from...
  2. Funcs with extra phantom return in Python docstrings: corrected from VectorScript counterparts...
    CreateDataVisPDMenu, CreateStyledStatic, GetDrawingArea, GetGradientDataN, GetLBItemMkrChoice,PopupGetChoices, RefreshResManager, RunImageComp, SetLBItemByClass, SetLBItemMkrChoice, SetParamStyleType
  3. 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
  4. Funcs with wrong arg types:
    Poly: arg p must be POINT instead of REAL
    Poly3D: arg p must be POINT3D instead of REAL
  5. Funcs with wrong arg count:
    Comp: must be v3,v4 = Comp(v1,v2) instead of v3,v4 = Comp(v1,v2,v3,v4)