Skip to content

feat: rename process_name to name in ProcessInfo and related utilities#55

Merged
JeanExtreme002 merged 4 commits into
mainfrom
jeanextreme002/rename-process-name-to-name
Jun 6, 2026
Merged

feat: rename process_name to name in ProcessInfo and related utilities#55
JeanExtreme002 merged 4 commits into
mainfrom
jeanextreme002/rename-process-name-to-name

Conversation

@JeanExtreme002

Copy link
Copy Markdown
Owner

Summary

Simplify the public API by removing the redundant process_ prefix from several identifiers.

Changes

  • ProcessInfo.process_nameProcessInfo.name
  • ProcessInfo.set_process_name()ProcessInfo.set_name()
  • get_process_ids_by_process_name()get_process_ids_by_name()
  • get_process_id_by_process_name()get_process_id_by_name()

All call-sites across the linux, macOS, win32 and app layers have been updated, along with the documentation and test suite.

- Rename ProcessInfo.process_name property to ProcessInfo.name
- Rename ProcessInfo.set_process_name() to ProcessInfo.set_name()
- Rename get_process_ids_by_process_name() to get_process_ids_by_name()
- Rename get_process_id_by_process_name() to get_process_id_by_name()
- Update all call-sites across linux, macos, win32 and app layers
- Update docs and tests accordingly
@github-actions github-actions Bot added docs Documentation changes (docs/) app GUI application changes (PyMemoryEditor/app/) linux Linux backend changes (PyMemoryEditor/linux/) win32 Windows backend changes (PyMemoryEditor/win32/) macOS macOS backend changes (PyMemoryEditor/macos/) lib Library changes (PyMemoryEditor/) tests Test changes (tests/) labels Jun 6, 2026
@JeanExtreme002 JeanExtreme002 changed the title Rename process_name to name in ProcessInfo and related utilities feat: rename process_name to name in ProcessInfo and related utilities Jun 6, 2026
@JeanExtreme002 JeanExtreme002 requested a review from Copilot June 6, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the public API by removing the redundant process_ prefix from process-name-related identifiers, primarily switching to name across ProcessInfo, lookup utilities, and OpenProcess construction. It also updates cross-platform backends, the GUI dialog, tests, and documentation to use the new naming.

Changes:

  • Renames ProcessInfo.process_name/set_process_name() to name/set_name(), and updates AbstractProcess + OS-specific process constructors accordingly.
  • Renames lookup helpers to get_process_id(s)_by_name() and updates call sites/tests.
  • Updates user-facing docs and README examples to use OpenProcess(name=...).

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_process_lookup.py Updates lookup helper calls to *_by_name; docstring text updated (needs minor grammar fix).
tests/test_process_enumeration.py Updates native enumeration tests to use get_process_ids_by_name.
tests/test_partial_name_match.py Updates partial/exact matching tests to use *_by_name and OpenProcess(name=...).
README.md Updates primary usage example to OpenProcess(name=...).
PyMemoryEditor/win32/process.py Renames constructor kwarg to name and updates docstring + super().__init__ call.
PyMemoryEditor/process/util.py Renames lookup functions to get_process_id(s)_by_name (contains readability issues due to variable shadowing).
PyMemoryEditor/process/info.py Renames ProcessInfo field/property/methods to name and updates lookup call.
PyMemoryEditor/process/abstract.py Renames constructor kwarg to name and updates error message + plumbing to ProcessInfo.set_name.
PyMemoryEditor/macos/process.py Renames constructor kwarg to name and updates docstring + super().__init__ call.
PyMemoryEditor/linux/process.py Renames constructor kwarg to name and updates docstring + super().__init__ call.
PyMemoryEditor/app/open_process_dialog.py Updates UI tooltip text and passes name=... when opening by typed entry.
docs/why.md Updates example to OpenProcess(name=...).
docs/troubleshooting.md Updates examples and guidance to OpenProcess(name=...).
docs/quickstart.md Updates quickstart snippets to OpenProcess(name=...).
docs/platform-notes.md Updates permission examples to OpenProcess(name=...).
docs/index.md Updates landing-page example to OpenProcess(name=...).
docs/guide/searching.md Updates searching guide examples to OpenProcess(name=...).
docs/guide/read-write.md Updates read/write guide examples to OpenProcess(name=...).
docs/guide/opening-process.md Updates opening-process guide to name terminology and examples.
docs/guide/modules-threads.md Updates modules/threads guide examples to OpenProcess(name=...).
docs/guide/memory-regions.md Updates memory-regions guide examples to OpenProcess(name=...).
docs/guide/allocate-free.md Updates allocate/free guide examples to OpenProcess(name=...).
docs/api/thread-info.md Updates API docs example to OpenProcess(name=...).
docs/api/openprocess.md Updates OpenProcess signature and examples to name=....
docs/api/module-info.md Updates API docs example to OpenProcess(name=...).
docs/api/memory-region.md Updates API docs example to OpenProcess(name=...).
docs/api/errors.md Updates error docs for OpenProcess(name=...) but currently mis-documents exception attribute names vs implementation.
docs/api/enums.md Updates enums doc example to OpenProcess(name=...).
Comments suppressed due to low confidence (1)

PyMemoryEditor/process/util.py:59

  • The loop variable name shadows the function parameter name, and process_name_cmp still uses the old identifier. This makes the function harder to read and reason about (especially with case-folding and substring matching). Rename the variables to avoid shadowing and keep the terminology consistent with the new API.
    if not case_sensitive:
        process_name_cmp = name.casefold()
    else:
        process_name_cmp = name

    matches: List[int] = []

    for pid, name in _iter_processes():
        name = name or ""

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 3 to 5
"""
Cross-platform tests for process_name lookup logic, exercising
Cross-platform tests for process's name lookup logic, exercising
AmbiguousProcessNameError and the case_sensitive flag without depending on
Comment thread docs/api/errors.md Outdated
Comment thread docs/api/errors.md Outdated
JeanExtreme002 and others added 2 commits June 6, 2026 20:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

PyMemoryEditor/process/util.py:60

  • In get_process_ids_by_name, the loop variable name shadows the function argument name, which makes the logic harder to follow and is easy to misuse in future edits. Rename the per-row variable to avoid shadowing (e.g., proc_name).
    matches: List[int] = []

    for pid, name in _iter_processes():
        name = name or ""
        name_cmp = name if case_sensitive else name.casefold()

Comment thread tests/test_process_lookup.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@JeanExtreme002 JeanExtreme002 merged commit 8cc1626 into main Jun 6, 2026
2 checks passed
@github-actions github-actions Bot deleted the jeanextreme002/rename-process-name-to-name branch June 6, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app GUI application changes (PyMemoryEditor/app/) docs Documentation changes (docs/) lib Library changes (PyMemoryEditor/) linux Linux backend changes (PyMemoryEditor/linux/) macOS macOS backend changes (PyMemoryEditor/macos/) tests Test changes (tests/) win32 Windows backend changes (PyMemoryEditor/win32/)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants