ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/Reminder/wesabe.py
(Generate patch)

Comparing FreeBSDAdmin/Reminder/wesabe.py (file contents):
Revision 1178 by douglas, 2009-05-17T14:30:08-07:00 vs.
Revision 1229 by douglas, 2009-10-03T22:58:25-07:00

# Line 1 | Line 1
1 #!/usr/local/bin/python
1   # Wesabe
2   #
3   # Douglas Thrift
4   #
5   # $Id$
6  
7 < import common
9 < from M2Crypto import m2urllib2, SSL
7 > import dtwesabe
8  
9 < class Wesabe(object):
10 <        def __init__(self, username, password, debug):
11 <                context = SSL.Context()
9 > def main(calendar, config, banks, debug):
10 >        wesabe = dtwesabe.Wesabe(config.getusername(), config.getpassword())
11 >        accounts = {}
12  
13 <                context.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth = 9)
14 <                context.load_verify_locations('/etc/ssl/cert.pem')
13 >        for account in wesabe.accounts():
14 >                if account.account_number is not None:
15 >                        accounts[account.account_number] = account
16  
17 <                self.opener = m2urllib2.build_opener(context)
17 >        for module in config.getlist('banks'):
18 >                bank = banks.bank(module)
19  
20 <        def upload(self, name, filename, data, balance = None):
21 <                print name, filename, balance
20 >                for name, number in bank.accounts():
21 >                        account = accounts[number]
22  
23 < if __name__ == '__main__':
24 <        parser = common.OptionParser()
25 <        options = parser.parse_args()[0]
26 <
27 <        config, banks = common.config(parser, options, '.wesabe')
28 <        wesabe = Wesabe(config.get('wesabe', 'username'), common.decode(config.get('wesabe', 'password')), True)#options.debug)
29 <
30 <        for bank, accounts in banks.iteritems():
31 <                bank = common.bank(bank, options, config)
32 <
33 <                for account in accounts:
34 <                        name, account = account.rsplit(' ', 1)
35 <
36 <                        wesabe.upload(name, *bank.download(account))
23 >                        wesabe.upload(number, account.account_type, account.financial_institution.id, *bank.download(number))

Comparing FreeBSDAdmin/Reminder/wesabe.py (property svn:executable):
Revision 1178 by douglas, 2009-05-17T14:30:08-07:00 vs.
Revision 1229 by douglas, 2009-10-03T22:58:25-07:00

# Line 1 | Line 0
1 *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines