Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/cli/__init__.py
Show All 18 Lines | |||||
@click.pass_context | @click.pass_context | ||||
def cli(ctx, log_level): | def cli(ctx, log_level): | ||||
logger.setLevel(log_level) | logger.setLevel(log_level) | ||||
ctx.ensure_object(dict) | ctx.ensure_object(dict) | ||||
def main(): | def main(): | ||||
logging.basicConfig() | logging.basicConfig() | ||||
from . import deposit # noqa | from . import client # noqa | ||||
try: | try: | ||||
from . import admin # noqa | from . import admin # noqa | ||||
except ImportError: # server part is optional | except ImportError: # server part is optional | ||||
pass | pass | ||||
return cli(auto_envvar_prefix='SWH_DEPOSIT') | return cli(auto_envvar_prefix='SWH_DEPOSIT') | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
main() | main() |