[weboob] [PATCH 2/2] remove old code: use exec_method

Pierre-Louis Bonicoli pierre-louis.bonicoli at gmx.fr
Sun Jul 26 01:54:53 CEST 2015


Signed-off-by: Pierre-Louis Bonicoli <pierre-louis.bonicoli at gmx.fr>
---
 weboob/applications/boobill/boobill.py | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/weboob/applications/boobill/boobill.py b/weboob/applications/boobill/boobill.py
index ce95a7e..1866e22 100644
--- a/weboob/applications/boobill/boobill.py
+++ b/weboob/applications/boobill/boobill.py
@@ -102,31 +102,8 @@ class Boobill(ReplApplication):
         Get details of subscriptions.
         If no ID given, display all details of all backends.
         """
-        l = []
-        id, backend_name = self.parse_id(id)
-
-        if not id:
-            for subscrib in self.get_object_list('iter_subscription'):
-                l.append((subscrib.id, subscrib.backend))
-        else:
-            l.append((id, backend_name))
 
-        for id, backend in l:
-            names = (backend,) if backend is not None else None
-            # XXX: should be generated by backend? -Flo
-            # XXX: no, but you should do it in a specific formatter -romain
-            # TODO: do it, and use exec_method here. Code is obsolete
-            mysum = Detail()
-            mysum.label = u"Sum"
-            mysum.infos = u"Generated by boobill"
-            mysum.price = Decimal("0.")
-
-            self.start_format()
-            for detail in self.do('get_details', id, backends=names):
-                self.format(detail)
-                mysum.price = detail.price + mysum.price
-
-            self.format(mysum)
+        self.exec_method(id, 'get_details')
 
     def do_balance(self, id):
         """
-- 
2.1.4




More information about the weboob mailing list