ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/Reminder/wellsfargo.py
Revision: 1178
Committed: 2009-05-17T14:30:08-07:00 (16 years, 1 month ago) by douglas
Content type: text/x-python
File size: 834 byte(s)
Log Message:
Checkpoint the current state of the code.

File Contents

# User Rev Content
1 douglas 1131 # Wells Fargo
2     #
3     # Douglas Thrift
4     #
5     # $Id$
6    
7 douglas 1178 import common
8 douglas 1145 from datetime import date, datetime
9 douglas 1131 import re
10     import website
11    
12 douglas 1178 class Bank(website.Website, common.Bank):
13 douglas 1145 DUE_ON = re.compile(r'DUE ON (\d{2}/\d{2}/\d{2})')
14    
15 douglas 1131 def __init__(self, username, password, debug):
16     website.Website.__init__(self, debug)
17    
18     self.browser.open('https://www.wellsfargo.com/')
19     self.browser.select_form(name = 'signon')
20    
21     self.browser['userid'] = username
22     self.browser['password'] = password
23    
24     self.browser.submit()
25    
26     self.browser.follow_link(text = 'Accounts')
27    
28 douglas 1145 def due(self, account):
29     try:
30 douglas 1178 due_on = self.Soup(self._follow_link(text_regex = account)).find(text = self.DUE_ON)
31 douglas 1131
32 douglas 1145 if due_on is None:
33     return date.fromtimestamp(0)
34    
35     return datetime.strptime(self.DUE_ON.search(due_on).group(1), '%m/%d/%y').date()
36 douglas 1131 finally:
37 douglas 1178 self._back()

Properties

Name Value
svn:keywords Id