ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/Reminder/wesabe.py
Revision: 1179
Committed: 2009-05-19T16:53:29-07:00 (16 years, 1 month ago) by douglas
Content type: text/x-python
File size: 755 byte(s)
Log Message:
Working somewhat again.

File Contents

# Content
1 #!/usr/local/bin/python
2 # Wesabe
3 #
4 # Douglas Thrift
5 #
6 # $Id$
7
8 from M2Crypto import m2urllib2, SSL
9
10 class Wesabe(object):
11 def __init__(self, username, password, debug):
12 context = SSL.Context()
13
14 context.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth = 9)
15 context.load_verify_locations('/etc/ssl/cert.pem')
16
17 self.opener = m2urllib2.build_opener(context)
18
19 def upload(self, name, filename, data, balance = None):
20 print name, filename, balance
21
22 def main(calendar, config, banks, debug):
23 wesabe = Wesabe(config.get('username'), config.getpassword('password'), debug)
24
25 for module in config.getlist('banks'):
26 bank = banks.bank(module)
27
28 for name, account in bank.accounts():
29 wesabe.upload(account, *bank.download(account))

Properties

Name Value
svn:keywords Id