-
Notifications
You must be signed in to change notification settings - Fork 35
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
Improves Warning messaging #11
base: master
Are you sure you want to change the base?
Conversation
Improves on the original warning.warn message (for when an envfile wasn't found) by including the search path used for a given file.
@@ -183,6 +199,8 @@ def read_envfile(path=None, **overrides): | |||
with open(path, 'r') as f: | |||
content = f.read() | |||
except getattr(__builtins__, 'FileNotFoundError', IOError): | |||
# Append the path we tried (and failed) to find to a tracking table | |||
traversed_paths = Env.track_path(path) |
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.
Nit, but Env can be cls
here.
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.
Where it's used inside a static method, so there's no cls
binding param AFAIK.
Looks useful. Think an additional function for this is probably overkill, just adding a |
Instead of implementing the (missing path) logging on the class level, instead just track as a list in the read_envfile params.
Thanks for saying that it looks useful and for quickly responding to the PR (👍 ). I think the last commit is what you had in mind, but let me know if I misunderstood and I can modify it. |
It is worth noting that the change to only use a list in that fashion means that the |
@rconradharris are you still maintaining this repo? The last commit is 7 years ago. Thanks |
Improves on the original warning.warn message (for when an envfile wasn't found) by including the search path used for a given file.