1 |
# Wesabe |
2 |
# |
3 |
# Douglas Thrift |
4 |
# |
5 |
# $Id$ |
6 |
|
7 |
import dtwesabe |
8 |
|
9 |
def main(calendar, config, banks, debug): |
10 |
wesabe = dtwesabe.Wesabe(config.getusername(), config.getpassword()) |
11 |
accounts = {} |
12 |
|
13 |
for account in wesabe.accounts(): |
14 |
if account.account_number is not None: |
15 |
accounts[account.account_number] = account |
16 |
|
17 |
for module in config.getlist('banks'): |
18 |
bank = banks.bank(module) |
19 |
|
20 |
for name, number in bank.accounts(): |
21 |
account = accounts[number] |
22 |
|
23 |
wesabe.upload(number, account.account_type, account.financial_institution.id, *bank.download(number)) |