We now have at least 3 scripting APIs which are trivial wrappers around properties: mp.get_mouse_pos, utils.getcwd, utils.getpid. After some discussion on IRC it was decided that it's easier for us to maintain them as trivial wrappers than to deprecate them and inflict pain on users and script authors, so currently no plan to deprecate.
Showing the changes to player/lua/defaults.lua (1 of 4 files). Show all
Unified · Split
| @@ -747,6 +747,10 @@ function mp_utils.getcwd() · 746 unmodified lines | |||
| 747 | return mp.get_property("working-directory") | 747 | return mp.get_property("working-directory") |
| 748 | end | 748 | end |
| 749 | 749 | ||
| 750 | function mp_utils.getpid() | ||
| 751 | return mp.get_property_number("pid") | ||
| 752 | end | ||
| 753 | |||
| 750 | function mp_utils.format_bytes_humanized(b) | 754 | function mp_utils.format_bytes_humanized(b) |
| 751 | local d = {"Bytes", "KiB", "MiB", "GiB", "TiB", "PiB"} | 755 | local d = {"Bytes", "KiB", "MiB", "GiB", "TiB", "PiB"} |
| 752 | local i = 1 | 756 | local i = 1 |