diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-15 13:29:21 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-15 13:29:21 +0100 |
commit | a1517dd205b46841d7317123dc1c0495ad48599b (patch) | |
tree | 673ff6aedec03dc4e550c2b98d6f35384374be72 | |
parent | cec43a2015da2b7cf02d7f01b719731348881ce2 (diff) | |
download | psutil-a1517dd205b46841d7317123dc1c0495ad48599b.tar.gz |
update doc
-rw-r--r-- | docs/index.rst | 6 | ||||
-rw-r--r-- | psutil/__init__.py | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/index.rst b/docs/index.rst index 499c7996..67719992 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -873,8 +873,8 @@ Functions ``info`` attribute attached to the returned :class:`Process` instances. If *attrs* is an empty list it will retrieve all process info (slow). - If *new_only* is true this function will yield only new processes which - appeared since the last time it was called. + If *new_only* is true this function will take into consideration only + new PIDs which appeared since the last time it was was called. Sorting order in which processes are returned is based on their PID. Example:: @@ -898,7 +898,7 @@ Functions 3: {'name': 'ksoftirqd/0', 'username': 'root'}, ...} - Get new processes since last call:: + Get only new processes since last call:: >>> for proc in psutil.process_iter(['pid', 'name'], new_only=True): ... print(proc.info) diff --git a/psutil/__init__.py b/psutil/__init__.py index e74bb109..a58b452c 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -1427,8 +1427,9 @@ def process_iter(attrs=None, ad_value=None, new_only=False): to returned Process instance. If *attrs* is an empty list it will retrieve all process info (slow). - If *new_only* is true this function will yield only new processes - which appeared since the last time it was called. + + If *new_only* is true this function will take into consideration + only new PIDs which appeared since the last time it was called. """ def add(pid): proc = Process(pid) |