-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 pwnlib.config module and documentation #893
Conversation
910da53
to
829814b
Compare
It's not clear whether we should continue to use |
829814b
to
f5e38fc
Compare
pwnlib/context/__init__.py
Outdated
from pwnlib.util import safeeval | ||
for key, value in section.items(): | ||
if key not in ContextType.defaults: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this get a warning?
pwnlib/log.py
Outdated
if section not in _msgtype_prefixes: | ||
def read_log_config(settings): | ||
for key, value in settings.items(): | ||
if '.' not in key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question.
elif key == 'symbol': | ||
_msgtype_prefixes[section][1] = value | ||
elif key == 'symbol': | ||
_msgtype_prefixes[msgtype][1] = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f5e38fc
to
9bc6bcf
Compare
Added warning messages, though it requires more circular imports |
This adds functionality for user configuration files at ~/.pwn.conf and /etc/pwn.conf. Previously this was only used by the pwnlib.log module, and was entirely undocumented. This is now documented, and offers an easy mechanism for other parts of the code to have extension points.
9bc6bcf
to
857f903
Compare
This adds functionality for user configuration files at ~/.pwn.conf
and /etc/pwn.conf. Previously this was only used by the pwnlib.log
module, and was entirely undocumented.
This is now documented, and offers an easy mechanism for other parts
of the code to have extension points.
An example configuration might look like: