Fix line terminations.

This commit is contained in:
Chris Berkhout 2021-04-24 23:02:09 +02:00
parent 22ebdb151d
commit 417bdfcf84
3 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ class Beancount:
lines.append( lines.append(
f"{price.date} price {price.base} {price.amount} {price.quote}" f"{price.date} price {price.base} {price.amount} {price.quote}"
) )
return "\n".join(lines) return "\n".join(lines) + "\n"
# https://beancount.github.io/docs/fetching_prices_in_beancount.html # https://beancount.github.io/docs/fetching_prices_in_beancount.html

View file

@ -4,4 +4,4 @@ class CSV:
for price in prices: for price in prices:
line = ",".join([price.date, price.base, price.quote, str(price.amount)]) line = ",".join([price.date, price.base, price.quote, str(price.amount)])
lines.append(line) lines.append(line)
return "\n".join(lines) return "\n".join(lines) + "\n"

View file

@ -4,7 +4,7 @@ class Ledger:
for price in prices: for price in prices:
date = str(price.date).translate(str.maketrans("-", "/")) date = str(price.date).translate(str.maketrans("-", "/"))
lines.append(f"P {date} 00:00:00 {price.base} {price.amount} {price.quote}") lines.append(f"P {date} 00:00:00 {price.base} {price.amount} {price.quote}")
return "\n".join(lines) return "\n".join(lines) + "\n"
# TODO support additional details of the format: # TODO support additional details of the format:
# https://www.ledger-cli.org/3.0/doc/ledger3.html#Commodities-and-Currencies # https://www.ledger-cli.org/3.0/doc/ledger3.html#Commodities-and-Currencies