generated from felixm/defaultpy
Implement option to add account2s and commodities to resolve #2.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
from src.models import Transaction
|
||||
from src.models import Transaction, Config
|
||||
|
||||
|
||||
LEDGER_TRANSACTION_TEMPLATE = """
|
||||
@@ -10,8 +10,8 @@ LEDGER_TRANSACTION_TEMPLATE = """
|
||||
"""
|
||||
|
||||
|
||||
def render_to_file(transactions: List[Transaction], ledger_file: Path):
|
||||
def render_to_file(transactions: List[Transaction], config: Config):
|
||||
content = "".join([LEDGER_TRANSACTION_TEMPLATE.format(t=t)
|
||||
for t in transactions])
|
||||
with open(ledger_file, 'a') as f:
|
||||
with open(config.output_file, 'a') as f:
|
||||
f.write(content)
|
||||
|
||||
Reference in New Issue
Block a user