5 if mod.startswith("fulbank."):
7 return "%s.%s" % (mod, type.__name__)
11 def number(self): raise NotImplementedError("account.number")
13 def name(self): raise NotImplementedError("account.name")
14 def transactions(self): raise NotImplementedError("account.transactions")
17 return "#<%s %s: %r>" % (_localname(type(self)), self.number, self.name)
19 class txnaccount(account):
21 def balance(self): raise NotImplementedError("txnaccount.balance")
23 def clearing(self): raise NotImplementedError("txnaccount.clearing")
25 def fullnumber(self): raise NotImplementedError("txnaccount.fullnumber")
27 class cardaccount(account):
30 class transaction(object):
32 def value(self): raise NotImplementedError("transaction.value")
34 def message(self): raise NotImplementedError("transaction.message")
36 def date(self): raise NotImplementedError("transaction.date")
40 dig = hashlib.sha256()
41 dig.update(str(self.date.toordinal()).encode("ascii") + b"\0")
42 dig.update(self.message.encode("utf-8") + b"\0")
43 dig.update(str(self.value.amount).encode("ascii") + b"\0")
44 dig.update(self.value.currency.symbol.encode("ascii") + b"\0")
45 return dig.hexdigest()
48 return "#<%s %s: %r>" % (_localname(type(self)), self.value, self.message)