diff --git a/cli/commands.py b/cli/commands.py index 3dde2786c83aac4fb3777a2fc8ac2dd536b5cff3..09fa5fdaa911ff41db30c50bbb38a43819ec8fe8 100644 --- a/cli/commands.py +++ b/cli/commands.py @@ -81,13 +81,14 @@ def _as_table(upload_result): "errors": format_error, } - basic_data = [{"key": format_property(k), "value": v} for k, v in apply_formatters(upload_result, formatters).items()] + basic_data = [ + {"key": format_property(k), "value": v} + for k, v in apply_formatters(upload_result, formatters).items() + ] return [*basic_data] - -""" @click.option("-a", "--activity_type", type=str, help="Type of activity",) @click.option("-c", "--commute", type=int, default="0", help="Set to 1 to mark as commute",) @click.option("-d", "--desc", type=str, default=DEFAULT_DESC, help="Description of the activity",) @@ -98,11 +99,12 @@ def _as_table(upload_result): # @click.option("-t", "--time", type=int, required=True, help="In seconds",) @click.option("-T", "--trainer", type=int, default="0", help="Set to 1 to mark as a trainer activity",) @output_option() -""" -@click.argument('gpx_filename', type=click.Path(exists=True)) +@click.argument("gpx_filename", type=click.Path(exists=True)) @click.command("fcreate") @login_required -def post_create_file(gpx_filename): +def post_create_file(**kwargs): """Create an manual activity from a GPX file.""" - click.echo(f"Processing: {click.format_filename(gpx_filename)}") - click.echo(f"Summary: {gpx.run([gpx_filename])}") + click.echo(f"Processing: {click.format_filename(kwargs['gpx_filename'])}") + click.echo(gpx.run([kwargs.pop("gpx_filename")])) + + post_create_manu(**kwargs)