From 3e1323971b9c059620ad5a77c54ecc3433003234 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sat, 10 Sep 2022 22:56:06 +0300 Subject: [PATCH] Stack function calls in jsonl converters to avoid unneeded variables --- src/processor/ledger/beancount_to_jsonl.py | 5 ++--- src/processor/markdown/markdown_to_jsonl.py | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/processor/ledger/beancount_to_jsonl.py b/src/processor/ledger/beancount_to_jsonl.py index 8a376663..3baa2d54 100644 --- a/src/processor/ledger/beancount_to_jsonl.py +++ b/src/processor/ledger/beancount_to_jsonl.py @@ -30,8 +30,7 @@ def beancount_to_jsonl(beancount_files, beancount_file_filter, output_file, prev # Extract Entries from specified Beancount files start = time.time() - extracted_transactions, transaction_to_file_map = extract_beancount_entries(beancount_files) - current_entries = convert_transactions_to_maps(extracted_transactions, transaction_to_file_map) + current_entries = convert_transactions_to_maps(*extract_beancount_transactions(beancount_files)) end = time.time() logger.debug(f"Parse transactions from Beancount files into dictionaries: {end - start} seconds") @@ -84,7 +83,7 @@ def get_beancount_files(beancount_files=None, beancount_file_filter=None): return all_beancount_files -def extract_beancount_entries(beancount_files): +def extract_beancount_transactions(beancount_files): "Extract entries from specified Beancount files" # Initialize Regex for extracting Beancount Entries diff --git a/src/processor/markdown/markdown_to_jsonl.py b/src/processor/markdown/markdown_to_jsonl.py index ebfc9472..118e66dd 100644 --- a/src/processor/markdown/markdown_to_jsonl.py +++ b/src/processor/markdown/markdown_to_jsonl.py @@ -30,8 +30,7 @@ def markdown_to_jsonl(markdown_files, markdown_file_filter, output_file, previou # Extract Entries from specified Markdown files start = time.time() - extracted_entries, entry_to_file_map = extract_markdown_entries(markdown_files) - current_entries = convert_markdown_entries_to_maps(extracted_entries, entry_to_file_map) + current_entries = convert_markdown_entries_to_maps(*extract_markdown_entries(markdown_files)) end = time.time() logger.debug(f"Parse entries from Markdown files into dictionaries: {end - start} seconds")