Created
September 22, 2015 12:56
-
-
Save larsimmisch/24683a2af4b2be0be7d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import click | |
@click.command() | |
@click.option('--site-title', | |
default="Notizen", | |
prompt='Enter site title.') | |
@click.option('--user-backend', | |
default="db", | |
type=click.Choice(['db', 'ldap']), | |
prompt='User backend?') | |
@click.pass_context | |
def setup(ctx, **kw): | |
""" Start setup wizard | |
""" | |
if kw.get('user_backend', None) == 'db': | |
ctx.invoke(setup_db) | |
@click.command() | |
@click.option('--db_url', | |
default='sqlite://///tmp/notizen.sql', | |
prompt='Database URL?') | |
@click.pass_context | |
def setup_db(ctx, **kw): | |
pass | |
if __name__ == '__main__': | |
setup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment