Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to deprecate config options and refactor pwndbg.color.context #1339

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

gsingh93
Copy link
Member

The changes to lib/config.py and gdblib/config.py add a way to deprecate configuration parameters. When a configuration parameter is deprecated, the first time a user tries to set it, they'll see a warning telling them the new parameter name. Any time a user tries to set a deprecated parameter, we forward it to the new parameter.

This PR also refactors pwndbg.color.context to use ColorConfig, and makes use of the configuration deprecation.

from pwndbg.gdblib import config

config_prefix_color = theme.add_color_param(
"code-prefix-color", "none", "color for 'context code' command (prefix marker)"
# TODO: Should probably change - to .
Copy link
Member Author

Choose a reason for hiding this comment

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

Before making this change we should decide on exactly how we want the namespacing to look. Should a config option appear as context-code-prefix-color, context.code-prefix-color, or context.code.prefix-color? I prefer the last option, but I'm also OK with the second option.

An alternative here is I can disable the warning (while keeping the forwarding to the new parameters), and then we can just figure out how we want to do this later.

Copy link
Member Author

Choose a reason for hiding this comment

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

@disconnect3d Ping on this question.

Copy link
Member

Choose a reason for hiding this comment

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

Another option is: context code prefix-color but I think keeping it without spaces may make more sense.

Anyway, context.code.prefix-color or context-code-prefix-color i think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants