s/find_id_list/find_object/
This commit is contained in:
parent
0f75a86185
commit
6591785a10
5 changed files with 11 additions and 11 deletions
|
|
@ -21,7 +21,7 @@
|
|||
from .browser import DresdenWetterBrowser
|
||||
from weboob.capabilities.gauge import ICapGauge, GaugeSensor, Gauge,\
|
||||
SensorNotFound
|
||||
from weboob.capabilities.base import find_id_list
|
||||
from weboob.capabilities.base import find_object
|
||||
from weboob.tools.backend import BaseBackend
|
||||
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ class DresdenWetterBackend(BaseBackend, ICapGauge):
|
|||
|
||||
def iter_sensors(self, gauge, pattern=None):
|
||||
if not isinstance(gauge, Gauge):
|
||||
gauge = find_id_list(self.iter_gauges(), gauge, error=SensorNotFound)
|
||||
gauge = find_object(self.iter_gauges(), gauge, error=SensorNotFound)
|
||||
if pattern is None:
|
||||
for sensor in gauge.sensors:
|
||||
yield sensor
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from weboob.capabilities.bank import ICapBank, AccountNotFound,\
|
|||
Account, Recipient
|
||||
from weboob.capabilities.bill import ICapBill, Bill, Subscription,\
|
||||
SubscriptionNotFound, BillNotFound
|
||||
from weboob.capabilities.base import UserError, find_id_list
|
||||
from weboob.capabilities.base import UserError, find_object
|
||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||
from weboob.tools.value import ValueBackendPassword
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ class INGBackend(BaseBackend, ICapBank, ICapBill):
|
|||
return self.browser.get_accounts_list()
|
||||
|
||||
def get_account(self, _id):
|
||||
return find_id_list(self.browser.get_accounts_list(), _id, error=AccountNotFound)
|
||||
return find_object(self.browser.get_accounts_list(), _id, error=AccountNotFound)
|
||||
|
||||
def iter_history(self, account):
|
||||
if not isinstance(account, Account):
|
||||
|
|
@ -100,11 +100,11 @@ class INGBackend(BaseBackend, ICapBank, ICapBill):
|
|||
return self.browser.get_subscriptions()
|
||||
|
||||
def get_subscription(self, _id):
|
||||
return find_id_list(self.browser.get_subscriptions(), _id, error=SubscriptionNotFound)
|
||||
return find_object(self.browser.get_subscriptions(), _id, error=SubscriptionNotFound)
|
||||
|
||||
def get_bill(self, id):
|
||||
subscription = self.get_subscription(id.split('-')[0])
|
||||
return find_id_list(self.browser.get_bills(subscription), id, error=BillNotFound)
|
||||
return find_object(self.browser.get_bills(subscription), id, error=BillNotFound)
|
||||
|
||||
def iter_bills(self, subscription):
|
||||
if not isinstance(subscription, Subscription):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
from weboob.capabilities.bill import ICapBill, Subscription, SubscriptionNotFound, Detail
|
||||
from weboob.capabilities.base import find_id_list
|
||||
from weboob.capabilities.base import find_object
|
||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||
from weboob.tools.value import ValueBackendPassword
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ class PoivyBackend(BaseBackend, ICapBill):
|
|||
return self.browser.get_subscription_list()
|
||||
|
||||
def get_subscription(self, _id):
|
||||
return find_id_list(self.iter_subscription(), _id, error=SubscriptionNotFound)
|
||||
return find_object(self.iter_subscription(), _id, error=SubscriptionNotFound)
|
||||
|
||||
def iter_bills_history(self, subscription):
|
||||
# Try if we have a real subscription before to load the history
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
from .browser import SachsenBrowser
|
||||
from weboob.capabilities.gauge import ICapGauge, GaugeSensor, Gauge,\
|
||||
SensorNotFound
|
||||
from weboob.capabilities.base import find_id_list
|
||||
from weboob.capabilities.base import find_object
|
||||
from weboob.tools.backend import BaseBackend
|
||||
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ class SachsenLevelBackend(BaseBackend, ICapGauge):
|
|||
|
||||
def iter_sensors(self, gauge, pattern=None):
|
||||
if not isinstance(gauge, Gauge):
|
||||
gauge = find_id_list(self.browser.get_rivers_list(), gauge, error=SensorNotFound)
|
||||
gauge = find_object(self.browser.get_rivers_list(), gauge, error=SensorNotFound)
|
||||
if pattern is None:
|
||||
for sensor in gauge.sensors:
|
||||
yield sensor
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ def empty(value):
|
|||
return True
|
||||
return False
|
||||
|
||||
def find_id_list(mylist, _id, error=None):
|
||||
def find_object(mylist, _id, error=None):
|
||||
"""
|
||||
Very simple tools to return an object with the matching _id
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue