diff --git a/modules/amazon/browser.py b/modules/amazon/browser.py old mode 100755 new mode 100644 diff --git a/modules/amazon/fr/pages.py b/modules/amazon/fr/pages.py old mode 100755 new mode 100644 index 223a5c248b5f0d9c5f384ffe04133dc267e46254..1f05c928b2d4efe7e09817f2111109a07e435231 --- a/modules/amazon/fr/pages.py +++ b/modules/amazon/fr/pages.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- -# Copyright(C) 2014 Oleg Plakhotniuk +# Copyright(C) 2015 Christophe Lampin # # This file is part of weboob. # @@ -91,7 +91,7 @@ def decimal_amount(self, amount): m = re.match(u'.*EUR ([,0-9]+).*', amount) if m: return Decimal(m.group(1).replace(",",".")) - + def month_to_int(self, text): for (idx, month) in enumerate(FRENCH_MONTHS): text = text.replace(month, str(idx + 1)) @@ -102,9 +102,6 @@ class OrderNewPage(OrderPage): ENCODING='ISO-8859-15' is_here = u'//*[contains(text(),"Commandé le")]' -# def text(self): -# return self.response.text.decode('iso-8859-1').encode('utf-8') - def order(self): if not self.shouldSkip(): order = Order(id=self.order_number()) @@ -116,7 +113,7 @@ def order(self): return order def order_date(self): - return datetime.strptime( + return datetime.strptime( re.match(u'.*Commandé le ([0-9]+ [0-9]+ [0-9]+) .*', self.month_to_int(self.date_num())).group(1), '%d %m %Y') @@ -245,7 +242,7 @@ def order(self): def order_date(self): date_str = self.doc.xpath(u'//b[contains(text(),"Commande numérique")]')[0].text month_str = re.match(u'.*Commande numérique : [0-9]+ ([^ ]+) [0-9]+.*', date_str).group(1) - return datetime.strptime( + return datetime.strptime( re.match(u'.*Commande numérique : ([0-9]+ [0-9]+ [0-9]+).*', date_str.replace(month_str, str(FRENCH_MONTHS.index(month_str) + 1))).group(1), '%d %m %Y') diff --git a/modules/amazon/module.py b/modules/amazon/module.py old mode 100755 new mode 100644 index 19ad866b4e0ab75c187ffaa36e4e7e1b81d67df0..8aac4e48fe0ab0c72a09dc73c1665e828eff7aa7 --- a/modules/amazon/module.py +++ b/modules/amazon/module.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # Copyright(C) 2014 Oleg Plakhotniuk # diff --git a/modules/ameli/__init__.py b/modules/ameli/__init__.py index 4a75134e71bd5812855af05a265c809e7d16e7a4..c679cf0a7e70bf5ef1e02908e7fecf64256c0815 100644 --- a/modules/ameli/__init__.py +++ b/modules/ameli/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/ameli/browser.py b/modules/ameli/browser.py old mode 100755 new mode 100644 index 956976ea6d19e94c806ff6c0092698f1715bc31a..6af534560c435d780e70bb9396fb6bfdbcde775c --- a/modules/ameli/browser.py +++ b/modules/ameli/browser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/ameli/module.py b/modules/ameli/module.py index 561aa025ff235352e096f63d235a319d6e83fff0..8671e627a309075c1102abfe81dbd7dafb82c444 100755 --- a/modules/ameli/module.py +++ b/modules/ameli/module.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/ameli/pages.py b/modules/ameli/pages.py index 8dd3cce3c9d548db6ba7ebedc7a337d3eef84d92..14c14047b85cb5e6f0de9690f59a50cfd9f8771a 100644 --- a/modules/ameli/pages.py +++ b/modules/ameli/pages.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/ameli/test.py b/modules/ameli/test.py index 7b08ee8405d2047c7fb17ca7a11fe201550b9a23..80de9958234e69a95f6369ea2e931dc4701947d9 100644 --- a/modules/ameli/test.py +++ b/modules/ameli/test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/amelipro/__init__.py b/modules/amelipro/__init__.py index 8014e86bf92997f7f666f5e94f9b1cdb53844c92..e847285b6619f9c9a7a94eef80e58d8c64830cf2 100644 --- a/modules/amelipro/__init__.py +++ b/modules/amelipro/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/amelipro/browser.py b/modules/amelipro/browser.py index ec1887f8c44d04ff1222d649b1179589b38db4fc..20cda994828f7fe96c0ec798dff3fa490414a988 100755 --- a/modules/amelipro/browser.py +++ b/modules/amelipro/browser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/amelipro/module.py b/modules/amelipro/module.py index f55dacbe4920ea0e5ecfc84fe969606cdf5d04c2..739ef64f41b0882c987b31fd6336c880472cd757 100755 --- a/modules/amelipro/module.py +++ b/modules/amelipro/module.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/amelipro/pages.py b/modules/amelipro/pages.py index b60df9d1412481b69407fd3bfd605187667615f0..64602411cea911b88563019b540e9469f73a5ea1 100755 --- a/modules/amelipro/pages.py +++ b/modules/amelipro/pages.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/amelipro/test.py b/modules/amelipro/test.py index 9b2bdccf06fd7a10546bdc3cce35d7dac6dd856a..3ab80696dee2bd9199aa1ce826095ef30d1a9f7a 100644 --- a/modules/amelipro/test.py +++ b/modules/amelipro/test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/hellobank/__init__.py b/modules/hellobank/__init__.py index 8501ea1db6176cccc3fb3fd99321742bce453aa6..619ae4526e7745f2a2f321b55126fff49902ea97 100644 --- a/modules/hellobank/__init__.py +++ b/modules/hellobank/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/hellobank/browser.py b/modules/hellobank/browser.py index e1aa66f6881164b887afc46078bf5ecfa59ca244..df715ed0228f03f6cef26b2c5293d339dc5181ef 100644 --- a/modules/hellobank/browser.py +++ b/modules/hellobank/browser.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin -# Copyright(C) 2009-2013 Romain Bignon +# Copyright(C) 2009-2012 Romain Bignon +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/modules/hellobank/module.py b/modules/hellobank/module.py index 52938641b8207f738dc18ac13a16a32da535a657..54e21d1227e5651726406f01a723af6ba036a491 100644 --- a/modules/hellobank/module.py +++ b/modules/hellobank/module.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2013 Christophe Lampin # Copyright(C) 2010-2012 Romain Bignon -# +# Copyright(C) 2013-2015 Christophe Lampin + # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify diff --git a/modules/hellobank/test.py b/modules/hellobank/test.py index d4daf1f2fc3bf124ddfadf8b3dc96b17a88a87af..182c952498415c9d20877eadde72af76a0a47c35 100644 --- a/modules/hellobank/test.py +++ b/modules/hellobank/test.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2010-2011 Romain Bignon +# Copyright(C) 2010-2012 Romain Bignon +# Copyright(C) 2013-2015 Christophe Lampin # # This file is part of weboob. # diff --git a/scripts/shopoob b/scripts/shopoob index ec4e8a211c91fdcefb76cf492b51afc94af9d69d..3715dd03a182d21ae154f95665969f05b9f6b314 100755 --- a/scripts/shopoob +++ b/scripts/shopoob @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # vim: ft=python et softtabstop=4 cinoptions=4 shiftwidth=4 ts=4 ai -# Copyright(C) 2012 Fourcot Florent +# Copyright(C) 2015 Christophe Lampin # # This file is part of weboob. # diff --git a/weboob/applications/shopoob/shopoob.py b/weboob/applications/shopoob/shopoob.py index 24d55de64348345d1a50d0a363952414ccd72711..e2c2653893eae67970d9483a803f01d63d8578a1 100755 --- a/weboob/applications/shopoob/shopoob.py +++ b/weboob/applications/shopoob/shopoob.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2012-2013 Florent Fourcot +# Copyright(C) 2015 Christophe Lampin # # This file is part of weboob. # @@ -22,11 +22,9 @@ from decimal import Decimal from weboob.capabilities.base import empty -from weboob.capabilities.shop import CapShop, Order, Payment, Item +from weboob.capabilities.shop import CapShop, Order, Item from weboob.tools.application.repl import ReplApplication, defaultcount -from weboob.tools.application.formatters.iformatter import PrettyFormatter, IFormatter -from weboob.tools.application.base import MoreResultsAvailable -from weboob.core import CallErrors +from weboob.tools.application.formatters.iformatter import IFormatter __all__ = ['Shopoob'] @@ -92,7 +90,7 @@ def format_obj(self, obj, alias): def flush(self): self.output(u'-----------+-----------------+----------') - + class Shopoob(ReplApplication): APPNAME = 'shopoob' VERSION = '1.1' @@ -145,9 +143,7 @@ def do_items(self, id): 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 + # TODO: Use specific formatter mysum = Item() mysum.label = u"Sum" mysum.url = u"Generated by shopoob"