Skip to content

Commit

Permalink
fix #1343: document Process.as_dict() attrs values
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Sep 26, 2018
1 parent 5e90b0a commit 39811bb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1179,11 +1179,14 @@ Process class

Utility method retrieving multiple process information as a dictionary.
If *attrs* is specified it must be a list of strings reflecting available
:class:`Process` class's attribute names (e.g. ``['cpu_times', 'name']``),
else all public (read only) attributes are assumed. *ad_value* is the
value which gets assigned to a dict key in case :class:`AccessDenied`
or :class:`ZombieProcess` exception is raised when retrieving that
particular process information.
:class:`Process` class's attribute names. Here's a list of possible string
values:
``'cmdline'``, ``'connections'``, ``'cpu_affinity'``, ``'cpu_num'``, ``'cpu_percent'``, ``'cpu_times'``, ``'create_time'``, ``'cwd'``, ``'environ'``, ``'exe'``, ``'gids'``, ``'io_counters'``, ``'ionice'``, ``'memory_full_info'``, ``'memory_info'``, ``'memory_maps'``, ``'memory_percent'``, ``'name'``, ``'nice'``, ``'num_ctx_switches'``, ``'num_fds'``, ``'num_handles'``, ``'num_threads'``, ``'open_files'``, ``'pid'``, ``'ppid'``, ``'status'``, ``'terminal'``, ``'threads'``, ``'uids'``, ``'username'```.
If *attrs* argument is not passed all public read only attributes are
assumed.
*ad_value* is the value which gets assigned to a dict key in case
:class:`AccessDenied` or :class:`ZombieProcess` exception is raised when
retrieving that particular process information.
Internally, :meth:`as_dict` uses :meth:`oneshot` context manager so
there's no need you use it also.

Expand Down

1 comment on commit 39811bb

@dyadav7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it quickly.

Please sign in to comment.