Generate perfectly consistent and complete Python interface #126
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Extension of #20 - use mcrfpy classes:
__init__(see #110)This is the "leader issue" for a broader class of pain-in-the-ass deficiencies with the way C++ items are exposed and the way Python has to present them.
Acceptable shorthand for Python
We have these vectors across all classes:
position->pospos.xandpos.ysize->sizesize.xandsize.ygrid_posandgrid_sizeSimilarly, we have
fillandoutlinecolorsThere are a lot of other ints and floats these objects expose - they should be enumerated and made into optional
__init__keyword-only argsMandatory args, positional args, and rules for
mcrfpyPython objects during__init__Caption(),Sprite(),Grid()andFrame()must result in valid, safe objects[pos, size, grid_pos, grid_size vectors], [texture/font objects], [text]Other optional args
keyword-only.
Wiki References:
Blocked by: Need to document current patterns before automating generation
Issue #126 Completed
This issue has been addressed through cumulative work over time:
Original Goals - All Met ✅
ClassName()x,y,w,h,pos,size)namefield on UIDrawables (#39)childrenarg on Frame (#38)on_*pattern (#139)on_click,on_enter,on_exit,on_moveon_cell_click,on_cell_enter,on_cell_exitFinal Change: Constructor kwarg consistency
Commit
c9c7375renamed the constructor keyword argument fromclicktoon_clickfor all UIDrawable types:This is a breaking change:
The property was already named
on_click- this makes the constructor kwarg match.Note on Type Stubs
The
stubs/mcrfpy.pyifile is manually maintained and currently missing the newer types (Line, Circle, Arc). This is a separate maintenance task for the stub generator script..boundsand.global_boundsshould be a pair of vectors, not 4 values #188