mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Stack function calls in jsonl converters to avoid unneeded variables
This commit is contained in:
parent
4eb84c7f51
commit
3e1323971b
2 changed files with 3 additions and 5 deletions
|
@ -30,8 +30,7 @@ def beancount_to_jsonl(beancount_files, beancount_file_filter, output_file, prev
|
||||||
|
|
||||||
# Extract Entries from specified Beancount files
|
# Extract Entries from specified Beancount files
|
||||||
start = time.time()
|
start = time.time()
|
||||||
extracted_transactions, transaction_to_file_map = extract_beancount_entries(beancount_files)
|
current_entries = convert_transactions_to_maps(*extract_beancount_transactions(beancount_files))
|
||||||
current_entries = convert_transactions_to_maps(extracted_transactions, transaction_to_file_map)
|
|
||||||
end = time.time()
|
end = time.time()
|
||||||
logger.debug(f"Parse transactions from Beancount files into dictionaries: {end - start} seconds")
|
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
|
return all_beancount_files
|
||||||
|
|
||||||
|
|
||||||
def extract_beancount_entries(beancount_files):
|
def extract_beancount_transactions(beancount_files):
|
||||||
"Extract entries from specified Beancount files"
|
"Extract entries from specified Beancount files"
|
||||||
|
|
||||||
# Initialize Regex for extracting Beancount Entries
|
# Initialize Regex for extracting Beancount Entries
|
||||||
|
|
|
@ -30,8 +30,7 @@ def markdown_to_jsonl(markdown_files, markdown_file_filter, output_file, previou
|
||||||
|
|
||||||
# Extract Entries from specified Markdown files
|
# Extract Entries from specified Markdown files
|
||||||
start = time.time()
|
start = time.time()
|
||||||
extracted_entries, entry_to_file_map = extract_markdown_entries(markdown_files)
|
current_entries = convert_markdown_entries_to_maps(*extract_markdown_entries(markdown_files))
|
||||||
current_entries = convert_markdown_entries_to_maps(extracted_entries, entry_to_file_map)
|
|
||||||
end = time.time()
|
end = time.time()
|
||||||
logger.debug(f"Parse entries from Markdown files into dictionaries: {end - start} seconds")
|
logger.debug(f"Parse entries from Markdown files into dictionaries: {end - start} seconds")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue