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

Use global config module #100

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

kevinjfoley
Copy link
Contributor

First pass at addressing #99.

Copy link
Contributor Author

@kevinjfoley kevinjfoley left a 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
Copy link
Contributor Author

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

Copy link
Owner

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.

@egh
Copy link
Owner

egh commented May 1, 2020

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.

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

Successfully merging this pull request may close these issues.

2 participants