History

scripting (lua/js): utils.getpid: make wrapper of pid property

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.

Avi Halachmi (:avih) committed 5 years ago

Commit 02fbdf81 parent f3b2ea94 files · +5 −16Browse files

Showing the changes to player/lua/defaults.lua (1 of 4 files). Show all

Unified · Split

player/lua/defaults.lua+4−0
@@ -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")
748end748end
749 749
750function mp_utils.getpid()
751 return mp.get_property_number("pid")
752end
753
750function mp_utils.format_bytes_humanized(b)754function 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 = 1756 local i = 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t