Skip to content

Commit

Permalink
ci: flake
Browse files Browse the repository at this point in the history
  • Loading branch information
redstreet committed Jul 15, 2024
1 parent f7d0864 commit 95d4ffc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 6 additions & 1 deletion beancount_reds_importers/importers/ibkr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
Cash Transactions
-----------------
Options: Dividends, Payment in Lieu of Dividends, Withholding Tax, 871(m) Withholding, Advisor Fees, Other Fees, Deposits & Withdrawals, Carbon Credits, Bill Pay, Broker Interest Paid, Broker Interest Received, Broker Fees, Bond Interest Paid, Bond Interest Received, Price Adjustments, Commission Adjustments, Detail
Options: Dividends, Payment in Lieu of Dividends, Withholding Tax, 871(m) Withholding,
Advisor Fees, Other Fees, Deposits & Withdrawals, Carbon Credits, Bill Pay, Broker
Interest Paid, Broker Interest Received, Broker Fees, Bond Interest Paid, Bond Interest
Received, Price Adjustments, Commission Adjustments, Detail
1.Date/Time
2.Amount
Expand Down Expand Up @@ -91,11 +94,13 @@
from beancount_reds_importers.libtransactionbuilder import investments
from beancount.core.number import D


class DictToObject:
def __init__(self, dictionary):
for key, value in dictionary.items():
setattr(self, key, value)


# xml on left, ofx on right
ofx_type_map = {
'BUY': 'buystock',
Expand Down
2 changes: 1 addition & 1 deletion beancount_reds_importers/importers/vanguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def cleanup_memo(self, ot):
# some vanguard files have memos repeated like this:
# 'DIVIDEND REINVESTMENTDIVIDEND REINVESTMENT'
retval = ot.memo
if ot.memo[: int(len(ot.memo) / 2)] == ot.memo[int(len(ot.memo) / 2) :]:
if ot.memo[: int(len(ot.memo) / 2)] == ot.memo[int(len(ot.memo) / 2):]:
retval = ot.memo[: int(len(ot.memo) / 2)]
return retval

Expand Down
9 changes: 1 addition & 8 deletions beancount_reds_importers/libreader/xmlreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,20 @@
"""

import datetime
import warnings
from collections import namedtuple
from lxml import etree

from beancount.ingest import importer
from beancount_reds_importers.libreader import reader



class Importer(reader.Reader, importer.ImporterProtocol):
FILE_EXTS = ["xml"]

def initialize_reader(self, file):
if getattr(self, "file", None) != file:
self.file = file
self.reader_ready = False
try:
self.xmltree = etree.parse(file.name)
except:
return
self.xmltree = etree.parse(file.name)
self.reader_ready = self.deep_identify()
if self.reader_ready:
self.set_currency()
Expand Down

0 comments on commit 95d4ffc

Please sign in to comment.