X-Git-Url: http://dolda2000.com/gitweb/?p=fulbank.git;a=blobdiff_plain;f=fulbank%2Ffsb.py;h=33346da0e0f382b7bb27150d4a66b6f45c8e17b3;hp=ef413ae91232bd29d69f82b200b370ceb98140ab;hb=8e415ee75ca73b4d5f07cab41f2177eba6c3eed0;hpb=61fd054fe24ac51425b1cdf03f90ed2cbacc63bd diff --git a/fulbank/fsb.py b/fulbank/fsb.py index ef413ae..33346da 100644 --- a/fulbank/fsb.py +++ b/fulbank/fsb.py @@ -1,6 +1,7 @@ import json, http.cookiejar, binascii, time, pickle from urllib import request, parse from bs4 import BeautifulSoup as soup +from . import currency soupify = lambda cont: soup(cont, "html.parser") apibase = "https://online.swedbank.se/TDE_DAP_Portal_REST_WEB/api/" @@ -53,12 +54,12 @@ class transaction(object): self._data = data @property - def amount(self): return float(resolve(self._data, ("amount",))) + def value(self): return currency.currency.get(resolve(self._data, ("currency",))).parse(resolve(self._data, ("amount",))) @property def message(self): return resolve(self._data, ("details", "message")) def __repr__(self): - return "#" % (self.amount, self.message) + return "#" % (self.value, self.message) class account(object): def __init__(self, sess, id, idata):