Skip to content

Commit d468bb8

Browse files
committed
Added a cli arguments which will be displayed after the deltas are compared in the form of key and value pairs
Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com> added delta stats to the cli and the output is displayed in the form of key and value pairs Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
1 parent 6778882 commit d468bb8

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

configure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2727
if [[ "$PYTHON_EXE" == "" ]]; then
2828
PYTHON_EXE=python
2929
fi
30-
3130
$PYTHON_EXE "$CONFIGURE_ROOT_DIR/etc/configure.py" $CFG_CMD_LINE_ARGS
3231

3332
if [ -f "$CONFIGURE_ROOT_DIR/bin/activate" ]; then

src/deltacode/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ def write_json(deltacode, outfile, all_delta_types=False):
5151
('delta_stats', deltacode.stats.to_dict()),
5252
('deltas', deltas(deltacode, all_delta_types))
5353
])
54-
54+
click.secho(get_notice(),fg="green")
55+
click.echo('deltas_count: {}'.format(len([d for d in deltas(deltacode, all_delta_types)])))
56+
click.echo('delta_stats: ')
57+
for stat in deltacode.stats.to_dict():
58+
click.echo(""" "{}": {}""".format(str(stat),deltacode.stats.to_dict()[stat]))
5559
# TODO: add toggle for pretty printing
5660
simplejson.dump(results, outfile, iterable_as_array=True, indent=2)
5761
outfile.write('\n')
5862

59-
6063
def print_version(ctx, param, value):
6164
if not value or ctx.resilient_parsing:
6265
return

src/deltacode/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ def get_notice():
275275
delimiter = '\n\n\n'
276276
[notice_text, extra_notice_text] = notice_text.split(delimiter, 1)
277277
extra_notice_text = delimiter + extra_notice_text
278-
279-
delimiter = '\n\n '
278+
279+
delimiter = '\n\n '
280280
[notice_text, acknowledgment_text] = notice_text.split(delimiter, 1)
281281
acknowledgment_text = delimiter + acknowledgment_text
282282

0 commit comments

Comments
 (0)