display a warning when the password is expired and has been switched
This commit is contained in:
parent
481226c6d0
commit
25916abbcd
2 changed files with 3 additions and 1 deletions
|
|
@ -16,6 +16,8 @@
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
|
from logging import warning
|
||||||
|
|
||||||
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword
|
||||||
from weboob.backends.bnporc import pages
|
from weboob.backends.bnporc import pages
|
||||||
from .errors import PasswordExpired
|
from .errors import PasswordExpired
|
||||||
|
|
@ -86,6 +88,7 @@ class BNPorc(BaseBrowser):
|
||||||
return func(self, *args, **kwargs)
|
return func(self, *args, **kwargs)
|
||||||
except PasswordExpired:
|
except PasswordExpired:
|
||||||
if self.rotating_password is not None:
|
if self.rotating_password is not None:
|
||||||
|
warning('[%s] Your password has expired. Switching...' % self.username)
|
||||||
self.change_password(self.rotating_password)
|
self.change_password(self.rotating_password)
|
||||||
return func(self, *args, **kwargs)
|
return func(self, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.mech import ClientForm
|
from weboob.tools.mech import ClientForm
|
||||||
import sys
|
|
||||||
import urllib
|
import urllib
|
||||||
from logging import error
|
from logging import error
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue