diff --git a/aessuccess.py b/aessuccess.py index a731e54..c6fe778 100644 --- a/aessuccess.py +++ b/aessuccess.py @@ -6,13 +6,14 @@ from billmonster import _element_available -from clint import args +from clint.arguments import Args +args = Args() from clint.textui import colored, puts import keyring, sys -def aessuccess(user=None, quit_when_finished=True, browser=None): +def aessuccess(user=None, quit_when_finished=True, browser=None, index=None): if not user: # Get the username from the command line arguments. diff --git a/att.py b/att.py index c25104d..b5898de 100644 --- a/att.py +++ b/att.py @@ -6,13 +6,14 @@ from billmonster import _element_available -from clint import args +from clint.arguments import Args +args = Args() from clint.textui import colored, puts import keyring, sys -def att(user=None, quit_when_finished=True, browser=None): +def att(user=None, quit_when_finished=True, browser=None, index=None): if not user: # Get the username from the command line arguments. diff --git a/bankofamerica.py b/bankofamerica.py index 37eab38..18edff2 100644 --- a/bankofamerica.py +++ b/bankofamerica.py @@ -8,7 +8,8 @@ from billmonster import _element_available -from clint import args +from clint.arguments import Args +args = Args() from clint.textui import colored, puts import keyring, os, sys diff --git a/billmonster.py b/billmonster.py index ab07041..2a138be 100755 --- a/billmonster.py +++ b/billmonster.py @@ -29,22 +29,24 @@ def main(): # Init the WebDriver. browser = webdriver.Firefox() + try: - for account in config._sections: + for account in config._sections: - # Grab the provider and the usernames. - provider = account - usernames = config._sections[account]['users'] - usernames = [x.strip() for x in usernames.split(',')] + # Grab the provider and the usernames. + provider = account + usernames = config._sections[account]['users'] + usernames = [x.strip() for x in usernames.split(',')] - index = 0 + index = 0 - # Run the script for each account user. - for user in usernames: - PROVIDERS[provider](user, False, browser, index) - index = index + 1 + # Run the script for each account user. + for user in usernames: + PROVIDERS[provider](user, False, browser, index) + index = index + 1 - browser.quit() + finally: + browser.quit() # Helper function to check whether an element exists yet on the page. diff --git a/capitalone.py b/capitalone.py index ee113ef..e8e86ed 100644 --- a/capitalone.py +++ b/capitalone.py @@ -6,13 +6,14 @@ from billmonster import _element_available -from clint import args +from clint.arguments import Args +args = Args() from clint.textui import colored, puts import keyring, sys -def capitalone(user=None, quit_when_finished=True, browser=None): +def capitalone(user=None, quit_when_finished=True, browser=None, index=None): if not user: # Get the username from the command line arguments. diff --git a/wellsfargo.py b/wellsfargo.py index 3a84f96..b97c4fe 100644 --- a/wellsfargo.py +++ b/wellsfargo.py @@ -6,13 +6,14 @@ from billmonster import _element_available -from clint import args +from clint.arguments import Args +args = Args() from clint.textui import colored, puts import keyring, sys -def wellsfargo(user=None, quit_when_finished=True, browser=None): +def wellsfargo(user=None, quit_when_finished=True, browser=None, index=None): if not user: # Get the username from the command line arguments.