-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use global config module #100
base: master
Are you sure you want to change the base?
Conversation
4e7bce3
to
904a956
Compare
904a956
to
64eee34
Compare
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.
This is just a first pass. Everything should work as is since the module is still passed on, but I would prefer to remove all function parameters that refer to command line params before merging.
@egh - what do you think so far? I went global instead of just passing the args
namespace as it makes things easier. For example, to address #97 one can simply import config
and then add
if config.input_date_format:
self.args += ["--input-date-format", config.input_date_format]
to Ledger.enqueue_output
.
@@ -33,6 +33,12 @@ | |||
|
|||
|
|||
class CliTest(): | |||
def tearDown(self): | |||
# Clean up global config |
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.
Not sure if there's a better way to handle this, I was a bit surprised nose
didn't handle it but I've admittedly never dealt with something like this
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.
Seems good enough 🤷♂️ I'd like to move to pytest
at some point soon in any case.
Thanks @kevinjfoley ! This seems a lot simpler. The global nature of the config doesn't bother me in a CLI app like this. In fact it would probably make it easier to allow other config mechanisms. |
First pass at addressing #99.