Commit 5c0135b6 authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Romain Bignon

modules: add sensible accepted_document_types in CapDocument modules

parent 62b7fbae
......@@ -20,7 +20,7 @@
from __future__ import unicode_literals
from collections import OrderedDict
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object, NotAvailable
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
......@@ -64,6 +64,8 @@ class AmazonModule(Module, CapDocument):
Value('pin_code', label='OTP response', required=False, default='')
)
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
self.BROWSER = self.BROWSERS[self.config['website'].get()]
return self.create_browser(self.config)
......
......@@ -19,7 +19,7 @@
from __future__ import unicode_literals
from weboob.capabilities.bill import CapDocument, SubscriptionNotFound, DocumentNotFound, Subscription, Bill
from weboob.capabilities.bill import DocumentTypes, CapDocument, SubscriptionNotFound, DocumentNotFound, Subscription, Bill
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword
from .browser import AmeliBrowser
......@@ -38,6 +38,8 @@ class AmeliModule(Module, CapDocument):
CONFIG = BackendConfig(ValueBackendPassword('login', label='Numero de SS', regexp=r'^\d{13}$', masked=False),
ValueBackendPassword('password', label='Password', masked=True))
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(),
self.config['password'].get())
......
......@@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, SubscriptionNotFound, DocumentNotFound, Subscription, Bill
from weboob.capabilities.bill import DocumentTypes, CapDocument, SubscriptionNotFound, DocumentNotFound, Subscription, Bill
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword
from .browser import AmeliProBrowser
......@@ -40,6 +40,8 @@ class AmeliProModule(Module, CapDocument):
masked=True)
)
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
self.logger.settings['save_responses'] = False # Set to True to help debugging
return self.create_browser(self.config['login'].get(),
......
......@@ -26,6 +26,7 @@ from weboob.capabilities.bank import CapBankWealth, Account
from weboob.capabilities.base import find_object
from weboob.capabilities.bill import (
CapDocument, Subscription, SubscriptionNotFound, DocumentNotFound, Document,
DocumentTypes,
)
from weboob.capabilities.profile import CapProfile
......@@ -50,6 +51,8 @@ class BoldenModule(Module, CapBankWealth, CapDocument, CapProfile):
ValueBackendPassword('password', label='Mot de passe'),
)
accepted_document_types = (DocumentTypes.OTHER,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -24,7 +24,7 @@ from decimal import Decimal
from weboob.capabilities.bank import CapBankWealth, CapBankTransferAddRecipient, AccountNotFound, Account, RecipientNotFound
from weboob.capabilities.bill import (
CapDocument, Subscription, SubscriptionNotFound,
Document, DocumentNotFound,
Document, DocumentNotFound, DocumentTypes,
)
from weboob.capabilities.base import NotAvailable
from weboob.capabilities.contact import CapContact
......@@ -56,6 +56,8 @@ class CaisseEpargneModule(Module, CapBankWealth, CapBankTransferAddRecipient, Ca
Value('nuser', label='User ID (optional)', default='', regexp='\d{0,8}'),
Value('pincode', label='pincode', required=False))
accepted_document_types = (DocumentTypes.OTHER,)
def create_default_browser(self):
return self.create_browser(nuser=self.config['nuser'].get(),
username=self.config['login'].get(),
......
......@@ -20,7 +20,7 @@
from __future__ import unicode_literals
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object, NotAvailable
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword
......@@ -43,6 +43,8 @@ class CityscootModule(Module, CapDocument):
BROWSER = CityscootBrowser
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -30,7 +30,7 @@ from weboob.capabilities.contact import CapContact
from weboob.capabilities.profile import CapProfile
from weboob.capabilities.bill import (
CapDocument, Subscription, SubscriptionNotFound,
Document, DocumentNotFound,
Document, DocumentNotFound, DocumentTypes,
)
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword
......@@ -56,6 +56,8 @@ class CreditMutuelModule(
ValueBackendPassword('password', label='Mot de passe'))
BROWSER = CreditMutuelBrowser
accepted_document_types = (DocumentTypes.OTHER,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
......@@ -44,6 +44,8 @@ class EdfModule(Module, CapDocument, CapProfile):
choices={'par': 'Particulier', 'pro': 'Entreprise'}),
Value('captcha_response', label='Reponse Captcha', required=False, default=''))
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
browsers = {'pro': EdfproBrowser, 'par': EdfBrowser}
self.BROWSER = browsers[self.config['website'].get()]
......
......@@ -24,7 +24,7 @@ from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import Value, ValueBackendPassword
from weboob.capabilities.base import find_object
from weboob.capabilities.bill import (
CapDocument, Document, DocumentNotFound, Subscription
CapDocument, Document, DocumentNotFound, Subscription, DocumentTypes,
)
from .browser import EkwateurBrowser
......@@ -48,6 +48,8 @@ class EkwateurModule(Module, CapDocument):
ValueBackendPassword('password', help='Password'),
)
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Bill, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Bill, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.profile import CapProfile
from weboob.capabilities.messages import CantSendMessage, CapMessages, CapMessagesPost
from weboob.capabilities.base import find_object
......@@ -46,6 +46,8 @@ class FreeMobileModule(Module, CapDocument, CapMessages, CapMessagesPost, CapPro
)
BROWSER = Freemobile
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(),
self.config['password'].get())
......
......@@ -20,7 +20,7 @@
from __future__ import unicode_literals
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword
......@@ -43,6 +43,8 @@ class InfomaniakModule(Module, CapDocument):
BROWSER = InfomaniakBrowser
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -24,7 +24,7 @@ from decimal import Decimal
from weboob.capabilities.bank import CapBankWealth, CapBankTransfer, Account, AccountNotFound, RecipientNotFound
from weboob.capabilities.bill import (
CapDocument, Bill, Subscription,
SubscriptionNotFound, DocumentNotFound
SubscriptionNotFound, DocumentNotFound, DocumentTypes,
)
from weboob.capabilities.profile import CapProfile
from weboob.capabilities.base import find_object, NotAvailable
......@@ -56,6 +56,8 @@ class INGModule(Module, CapBankWealth, CapBankTransfer, CapDocument, CapProfile)
)
BROWSER = IngBrowser
accepted_document_types = (DocumentTypes.STATEMENT,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(),
self.config['password'].get(),
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object, NotAvailable
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword
......@@ -41,6 +41,8 @@ class MaterielnetModule(Module, CapDocument):
BROWSER = MaterielnetBrowser
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object, NotAvailable
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
......@@ -41,6 +41,8 @@ class OnlinenetModule(Module, CapDocument):
BROWSER = OnlinenetBrowser
accepted_document_types = (DocumentTypes.BILL, DocumentTypes.OTHER,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object, NotAvailable
from weboob.capabilities.account import CapAccount
from weboob.capabilities.profile import CapProfile
......@@ -46,6 +46,8 @@ class OrangeModule(Module, CapAccount, CapDocument, CapProfile):
self._browsers = dict()
super(OrangeModule, self).__init__(*args, **kwargs)
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Bill, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Bill, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
......@@ -42,6 +42,8 @@ class OvhModule(Module, CapDocument):
BROWSER = OvhBrowser
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config)
......
......@@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.bill import CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, Document, SubscriptionNotFound, DocumentNotFound
from weboob.capabilities.base import find_object, NotAvailable
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
......@@ -41,6 +41,8 @@ class TrainlineModule(Module, CapDocument):
BROWSER = TrainlineBrowser
accepted_document_types = (DocumentTypes.BILL,)
def create_default_browser(self):
return self.create_browser(self.config['login'].get(), self.config['password'].get())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment