From 1c00c33e73374d5a14e89d7661cb82bc1eac3d07 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 16 Aug 2021 18:50:29 -0700 Subject: [PATCH] Improve debug output from org_to_jsonl.py script --- processor/org_mode/org_to_jsonl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/processor/org_mode/org_to_jsonl.py b/processor/org_mode/org_to_jsonl.py index 43db5b3f..7365e0be 100644 --- a/processor/org_mode/org_to_jsonl.py +++ b/processor/org_mode/org_to_jsonl.py @@ -35,7 +35,7 @@ def dump_jsonl(jsonl_data, output_path, verbose=0): f.write(jsonl_data) if verbose > 0: - print(f'Wrote {len(jsonl_data)} records to jsonl at {output_path}') + print(f'Wrote {len(jsonl_data)} lines to jsonl at {output_path}') def compress_jsonl_data(jsonl_data, output_path, verbose=0): @@ -43,7 +43,7 @@ def compress_jsonl_data(jsonl_data, output_path, verbose=0): gzip_file.write(jsonl_data) if verbose > 0: - print(f'Wrote {len(jsonl_data)} records to gzip compressed jsonl at {output_path}') + print(f'Wrote {len(jsonl_data)} lines to gzip compressed jsonl at {output_path}') def load_jsonl(input_path, verbose=0): @@ -117,6 +117,9 @@ def convert_org_entries_to_jsonl(entries, verbose=0): # Convert Dictionary to JSON and Append to JSONL string jsonl += f'{json.dumps(entry_dict, ensure_ascii=False)}\n' + if verbose > 0: + print(f"Converted {len(entries)} to jsonl format") + return jsonl