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

Support a default context #23

Open
wasade opened this issue May 3, 2017 · 1 comment
Open

Support a default context #23

wasade opened this issue May 3, 2017 · 1 comment

Comments

@wasade
Copy link
Member

wasade commented May 3, 2017

It is annoying entering the context repeatedly. It would be great to have a default or to source from the environment but allow it to be overridden if the user specifies. Ie:

# in redbiom/__init__.py
def get_config():
    ...
    ctx = os.environ.get('REDBIOM_CONTEXT')

# in redbiom/command/__init__.py
def get_context(user_specified):
    if user_specified is None:
        import redbiom
        return redbiom.get_config()['ctx']
    else:
        return user_specified

...any redbiom/command/*.py method can then leverage get_context. Or, perhaps a click.option('--context', ...) callback so it's implicit.

@wasade
Copy link
Member Author

wasade commented Dec 19, 2022

I'm marking this as having server side support as one possible solution here is an API endpoint where the client asks for a context suggestion

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

No branches or pull requests

1 participant