display an error message when user IP address is localized outside of France (closes #1327)

This commit is contained in:
Romain Bignon 2014-01-17 00:15:33 +01:00
commit 17c2a74707
2 changed files with 8 additions and 2 deletions

View file

@ -28,9 +28,14 @@ from weboob.tools.mech import ClientForm
from weboob.capabilities.base import UserError, Currency
__all__ = ['CitiesPage', 'SearchPage']
__all__ = ['CitiesPage', 'SearchPage', 'SearchErrorPage', 'SearchInProgressPage',
'ResultsPage', 'ForeignPage']
class ForeignPage(BasePage):
def on_loaded(self):
raise UserError('Your IP address is localized in a country not supported by this module (%s). Currently only the French website is supported.' % self.group_dict['country'])
class CitiesPage(BasePage):
def get_stations(self):
result = json.loads(self.document[self.document.find('{'):-2])