diff --git a/modules/adecco/module.py b/modules/adecco/module.py index b787529c7b18843fc751e39aaafcf9fff5377e0f..6f3043806547fea64c18c7219d7b757564ecea16 100644 --- a/modules/adecco/module.py +++ b/modules/adecco/module.py @@ -17,9 +17,9 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from weboob.capabilities.job import CapJob, BaseJobAdvert from .browser import AdeccoBrowser diff --git a/modules/agendadulibre/module.py b/modules/agendadulibre/module.py index 53586d8625803890a6dc13b5c1c353a2fda244be..26066bf9d65588c3731dde7d1acdda5949f63ad6 100644 --- a/modules/agendadulibre/module.py +++ b/modules/agendadulibre/module.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.calendar import CapCalendarEvent, CATEGORIES -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from .browser import AgendadulibreBrowser diff --git a/modules/amazon/module.py b/modules/amazon/module.py index c6ca3355791b029eda3b757eedd2fdcbf60214e0..b2aedda217843b6a0c33d6164d5b684b19ff4204 100644 --- a/modules/amazon/module.py +++ b/modules/amazon/module.py @@ -17,13 +17,13 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.bill import CapDocument, Subscription, Bill, SubscriptionNotFound, DocumentNotFound from weboob.capabilities.shop import CapShop, Order from weboob.capabilities.base import find_object from weboob.tools.backend import Module, BackendConfig from weboob.tools.value import Value, ValueBackendPassword -from weboob.tools.ordereddict import OrderedDict from weboob.browser.exceptions import HTTPNotFound from .browser import Amazon diff --git a/modules/apec/module.py b/modules/apec/module.py index d318b18fe5c8e1143fb59d6e6c213bcbbf20a497..5a1683eec425926200d00f477a5aa930da5a0258 100644 --- a/modules/apec/module.py +++ b/modules/apec/module.py @@ -17,10 +17,11 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict + from weboob.capabilities.job import BaseJobAdvert from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.job import CapJob -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from .browser import ApecBrowser from .job import APEC_CONTRATS, APEC_EXPERIENCE diff --git a/modules/arte/module.py b/modules/arte/module.py index b4becf76ea5970fdb4cae1c89a6bb17d240a4897..48ff902e2575361c00ddd335ae342d57b6cfae94 100644 --- a/modules/arte/module.py +++ b/modules/arte/module.py @@ -19,7 +19,8 @@ import re -from weboob.tools.ordereddict import OrderedDict +from collections import OrderedDict + from weboob.capabilities.video import CapVideo, BaseVideo from weboob.capabilities.collection import CapCollection, CollectionNotFound, Collection from weboob.tools.backend import Module, BackendConfig diff --git a/modules/aum/contact.py b/modules/aum/contact.py index 5e5ff1396f8a8a59e9c612f60548c283f9c8b56f..0dbd56d66402675a7dd90220f0869742cf5b0623 100644 --- a/modules/aum/contact.py +++ b/modules/aum/contact.py @@ -22,8 +22,8 @@ import socket from datetime import datetime from dateutil.parser import parse as parse_dt +from collections import OrderedDict -from weboob.tools.ordereddict import OrderedDict from weboob.capabilities.contact import Contact as _Contact, ProfileNode from weboob.tools.html import html2text diff --git a/modules/axabanque/pages/bank.py b/modules/axabanque/pages/bank.py index 3f35cf7f9a67c83376da9a6e0ad68ce84a4fffa5..d4bb0a58b5bfd0168e8b1c2d6d7b9d5f7e608154 100644 --- a/modules/axabanque/pages/bank.py +++ b/modules/axabanque/pages/bank.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict import re from decimal import Decimal, InvalidOperation @@ -30,7 +30,6 @@ from weboob.capabilities.bank import Account, Investment from weboob.capabilities.base import NotAvailable from weboob.tools.capabilities.bank.transactions import FrenchTransaction -from weboob.tools.ordereddict import OrderedDict def MyDecimal(*args, **kwargs): diff --git a/modules/banquepopulaire/module.py b/modules/banquepopulaire/module.py index ff319d17cb0a5164ca91e663e73590ce5105f6f4..cc7d8b3726a4fade9c1c0a93bcb09a6e2fee17d2 100644 --- a/modules/banquepopulaire/module.py +++ b/modules/banquepopulaire/module.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.bank import CapBank, AccountNotFound from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import ValueBackendPassword, Value from .browser import BanquePopulaire diff --git a/modules/bnporc/deprecated/perso/transfer.py b/modules/bnporc/deprecated/perso/transfer.py index 8c75b336222dafbde22217d2e554517c55ef4778..7b56f14ea6e24c54726c3a8e65899739c49a895d 100644 --- a/modules/bnporc/deprecated/perso/transfer.py +++ b/modules/bnporc/deprecated/perso/transfer.py @@ -17,11 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict import re from weboob.deprecated.browser import Page, BrowserPasswordExpired -from weboob.tools.ordereddict import OrderedDict from weboob.capabilities.bank import TransferError diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index d05e96bbf9cfc51dc4a9939c5ecdf5e9e203ad03..0eed2adab751a94c6ac0187ebc926a215a6f9fc5 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -21,6 +21,7 @@ from cStringIO import StringIO import re from decimal import Decimal +from collections import OrderedDict from weboob.capabilities.base import NotAvailable from weboob.capabilities.bank import Account @@ -31,7 +32,6 @@ from weboob.browser.filters.standard import CleanText, Regexp, Env from weboob.exceptions import BrowserUnavailable, NoAccountsException from weboob.tools.capabilities.bank.transactions import FrenchTransaction -from weboob.tools.ordereddict import OrderedDict from .base import MyHTMLPage diff --git a/modules/bred/dispobank/pages.py b/modules/bred/dispobank/pages.py index 6703675db2af5ca56f3e3db0d4b4ac0c88bc3abd..06d3ccd12fb4ddc1194d6a8d856666e507b54fcd 100644 --- a/modules/bred/dispobank/pages.py +++ b/modules/bred/dispobank/pages.py @@ -24,10 +24,10 @@ from decimal import Decimal, InvalidOperation import re +from collections import OrderedDict from weboob.deprecated.browser import Page from weboob.tools.misc import to_unicode -from weboob.tools.ordereddict import OrderedDict from weboob.capabilities.bank import Account from weboob.tools.capabilities.bank.transactions import FrenchTransaction diff --git a/modules/caissedepargne/module.py b/modules/caissedepargne/module.py index 375b3f8d7eb9a4292222f388f321e0aab31e999a..dc318250b96276ff67c23480823b6a0a92b6f19a 100644 --- a/modules/caissedepargne/module.py +++ b/modules/caissedepargne/module.py @@ -17,12 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.bank import CapBank, AccountNotFound from weboob.capabilities.contact import CapContact from weboob.tools.backend import Module, BackendConfig from weboob.tools.value import Value, ValueBackendPassword -from weboob.tools.ordereddict import OrderedDict from .browser import CaisseEpargne diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 6ef2b5185612620cd0262448adeae16e2f7abaf8..f2d1fb2ff772291d2b43da4aa4436dedf81d1bc6 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict import re import json @@ -31,7 +31,6 @@ from weboob.capabilities import NotAvailable from weboob.capabilities.bank import Account, Transaction, Investment from weboob.capabilities.contact import Advisor -from weboob.tools.ordereddict import OrderedDict from weboob.tools.capabilities.bank.transactions import FrenchTransaction from weboob.tools.capabilities.bank.iban import is_rib_valid, rib2iban from weboob.exceptions import NoAccountsException, BrowserUnavailable diff --git a/modules/cappedtv/browser.py b/modules/cappedtv/browser.py index d3486fa3c11cb41a42ebc48d0b32fcb005a70006..bf6df30ee94effe4b4c241295c795b4d9b0b8d7d 100644 --- a/modules/cappedtv/browser.py +++ b/modules/cappedtv/browser.py @@ -8,9 +8,10 @@ # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. - +from collections import OrderedDict import urllib import datetime + from weboob.capabilities.base import NotAvailable from weboob.tools.misc import to_unicode from weboob.deprecated.browser import Page @@ -19,7 +20,6 @@ from weboob.deprecated.browser.decorators import id2url from weboob.capabilities.image import Thumbnail from weboob.capabilities.video import BaseVideo -from weboob.tools.ordereddict import OrderedDict __all__ = ['CappedBrowser'] diff --git a/modules/cragr/module.py b/modules/cragr/module.py index ae6d11524264ec3e20459496162e76d17e058b33..952a35ea71f2eddc593e4449551fff4850ee0dbb 100644 --- a/modules/cragr/module.py +++ b/modules/cragr/module.py @@ -17,11 +17,11 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.bank import AccountNotFound, CapBankTransfer from weboob.capabilities.contact import CapContact from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import ValueBackendPassword, Value from .web.browser import Cragr diff --git a/modules/creditdunord/module.py b/modules/creditdunord/module.py index 56096d0b610c90c91924ae71a1ebd901e0a6a64b..891a94ed17a14a917bb4665211c613f09cc689ce 100644 --- a/modules/creditdunord/module.py +++ b/modules/creditdunord/module.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.bank import CapBank, AccountNotFound from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import ValueBackendPassword, Value from .browser import CreditDuNordBrowser diff --git a/modules/dailymotion/module.py b/modules/dailymotion/module.py index 0104c93d616c99fb398dedc2b2069830554673db..9085c4ccc98be9ff9e106decaa017000dce796c2 100644 --- a/modules/dailymotion/module.py +++ b/modules/dailymotion/module.py @@ -17,11 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict + from weboob.capabilities.video import CapVideo, BaseVideo from weboob.capabilities.collection import CapCollection, CollectionNotFound from weboob.tools.backend import Module, BackendConfig from weboob.tools.value import Value -from weboob.tools.ordereddict import OrderedDict from .browser import DailymotionBrowser import re diff --git a/modules/ganassurances/module.py b/modules/ganassurances/module.py index 1a6d3800e0fec034dea99dfda566db8d52c1dafb..1b5e7bd786066d93682be72d2e42deff86ee4749 100644 --- a/modules/ganassurances/module.py +++ b/modules/ganassurances/module.py @@ -17,11 +17,11 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.bank import CapBank, AccountNotFound from weboob.capabilities.base import find_object from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import ValueBackendPassword, Value from .browser import GanAssurances diff --git a/modules/happn/module.py b/modules/happn/module.py index 55e9b94f6ce283dafcc9a0a3b2b4ebe043c0bde7..6aa5a41cb95afc993a19a4741518f49422ce326e 100644 --- a/modules/happn/module.py +++ b/modules/happn/module.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict import datetime from dateutil.parser import parse as parse_date from dateutil.relativedelta import relativedelta @@ -31,7 +31,6 @@ from weboob.exceptions import BrowserHTTPError from weboob.tools.backend import Module, BackendConfig from weboob.tools.value import Value, ValueBackendPassword -from weboob.tools.ordereddict import OrderedDict from weboob.tools.log import getLogger from .browser import HappnBrowser, FacebookBrowser diff --git a/modules/indeed/module.py b/modules/indeed/module.py index 574e9ca93dfdf3bb53481f6661dccf039e6e6869..b12462f9cb6dc3e38e45f9c95ff32e6c93afe21f 100644 --- a/modules/indeed/module.py +++ b/modules/indeed/module.py @@ -17,11 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.capabilities.job import CapJob, BaseJobAdvert from weboob.tools.value import Value + from .browser import IndeedBrowser __all__ = ['IndeedModule'] diff --git a/modules/jcvelaux/module.py b/modules/jcvelaux/module.py index 476afb4ab151c2bc6699bb72cf6f853db7732976..85f3c567ff437bbe56db5a29039a90f9d8428a40 100644 --- a/modules/jcvelaux/module.py +++ b/modules/jcvelaux/module.py @@ -19,11 +19,12 @@ from __future__ import unicode_literals +from collections import OrderedDict + from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.base import StringField, UserError from weboob.capabilities.gauge import CapGauge, GaugeSensor, Gauge, GaugeMeasure, SensorNotFound from weboob.tools.value import Value, ValueBackendPassword -from weboob.tools.ordereddict import OrderedDict from .browser import VelibBrowser diff --git a/modules/lolix/module.py b/modules/lolix/module.py index 434bca69ce7da2d96a47bcec6ca3a6dcd9368703..b9e251718e841a6ff66ea65be76bff4e20cdc0cb 100644 --- a/modules/lolix/module.py +++ b/modules/lolix/module.py @@ -17,8 +17,9 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict + from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from weboob.capabilities.job import CapJob, BaseJobAdvert diff --git a/modules/manpower/module.py b/modules/manpower/module.py index 779c9a3e02a1648fab71a0c20885c82790c1b68b..1d7faef57aee3303002737774429dd219b984a93 100644 --- a/modules/manpower/module.py +++ b/modules/manpower/module.py @@ -17,10 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict + from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from weboob.capabilities.job import CapJob, BaseJobAdvert + from .browser import ManpowerBrowser diff --git a/modules/monster/module.py b/modules/monster/module.py index 27beea2885697297af37ffd441ebbbb9f5dcfedc..c38e66c2489fc318485d10106c5e6650e03ac685 100644 --- a/modules/monster/module.py +++ b/modules/monster/module.py @@ -17,11 +17,11 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.job import CapJob, BaseJobAdvert from weboob.tools.value import Value -from weboob.tools.ordereddict import OrderedDict from .browser import MonsterBrowser diff --git a/modules/okc/module.py b/modules/okc/module.py index 33d6cbfdc81676ab562133c01698451139609fc1..d18510e6aae2c4085cb6695ff26f241f7f83d2ca 100644 --- a/modules/okc/module.py +++ b/modules/okc/module.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict from datetime import datetime from html2text import unescape @@ -26,7 +26,6 @@ from weboob.capabilities.messages import CapMessages, CapMessagesPost, Message, Thread from weboob.tools.backend import Module, BackendConfig from weboob.tools.misc import to_unicode -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value, ValueBackendPassword from .browser import OkCBrowser diff --git a/modules/popolemploi/module.py b/modules/popolemploi/module.py index 335bed54ace68b7ee6e8607f5a77d6893a9eaebc..45a915f3cd23bee3e3578ce24b8a2efdb394813b 100644 --- a/modules/popolemploi/module.py +++ b/modules/popolemploi/module.py @@ -16,12 +16,14 @@ # # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . + +from collections import OrderedDict + from weboob.capabilities.job import BaseJobAdvert from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.job import CapJob from weboob.tools.value import Value -from weboob.tools.ordereddict import OrderedDict from .browser import PopolemploiBrowser diff --git a/modules/razibus/module.py b/modules/razibus/module.py index 6c31db14ccc53ff3e293da650180ca220b489a4e..a9ea21296854ada1badf39e748e6d87154b9d819 100644 --- a/modules/razibus/module.py +++ b/modules/razibus/module.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.calendar import CapCalendarEvent, CATEGORIES -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from .browser import RazibusBrowser diff --git a/modules/regionsjob/module.py b/modules/regionsjob/module.py index f402bb7310d23a8d7fe1e982b23f8aa274b2759d..1c56bf8bff5ec29460a59e1c692d0d0d8ca95095 100644 --- a/modules/regionsjob/module.py +++ b/modules/regionsjob/module.py @@ -17,11 +17,11 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig from weboob.capabilities.job import CapJob, BaseJobAdvert from .browser import RegionsjobBrowser -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value diff --git a/modules/societegenerale/pages/transfer.py b/modules/societegenerale/pages/transfer.py index d94aff329e6d24c82c2b2350f11eb7f3f1859b0b..3bcb42d424d825b6f6e3c88c4100caafef7d7226 100644 --- a/modules/societegenerale/pages/transfer.py +++ b/modules/societegenerale/pages/transfer.py @@ -19,6 +19,7 @@ from datetime import datetime, timedelta import re +from collections import OrderedDict from cStringIO import StringIO from logging import error from weboob.tools.json import json @@ -31,7 +32,6 @@ Env, Date from weboob.browser.filters.html import Attr from weboob.tools.capabilities.bank.transactions import FrenchTransaction -from weboob.tools.ordereddict import OrderedDict from ..captcha import Captcha, TileError from .base import BasePage diff --git a/modules/vimeo/module.py b/modules/vimeo/module.py index b264f37208cee575aaf4a868bedc4533b0727ddb..1478defc20f51fc681fe3add4eac777d1ae34174 100644 --- a/modules/vimeo/module.py +++ b/modules/vimeo/module.py @@ -18,11 +18,11 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.capabilities.video import CapVideo, BaseVideo from weboob.capabilities.collection import CapCollection, CollectionNotFound, Collection from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value diff --git a/modules/voyagessncf/module.py b/modules/voyagessncf/module.py index d5cd82f72ae0f1b2637983fe1b5d2d98945bb98a..7c6fb08f5124f6eb85d1eb64bbfab26f3f93f870 100644 --- a/modules/voyagessncf/module.py +++ b/modules/voyagessncf/module.py @@ -17,9 +17,9 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from weboob.capabilities.travel import CapTravel, Station, Departure from weboob.capabilities import UserError diff --git a/modules/yahoo/module.py b/modules/yahoo/module.py index 1b11a9048779e7fdca5e688fbcf9b192e5540dd8..5df08ae1d51313f2a6943c65a03b33db83a4c3a0 100644 --- a/modules/yahoo/module.py +++ b/modules/yahoo/module.py @@ -17,9 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict + from weboob.capabilities.weather import CapWeather from weboob.tools.backend import Module, BackendConfig -from weboob.tools.ordereddict import OrderedDict from weboob.tools.value import Value from .browser import YahooBrowser diff --git a/scripts/weboob b/scripts/weboob index b1892eba1597227285688a0642d82ee580ff702e..999eb605c54bb41210ddd978fdd1098b7cb19ecb 100755 --- a/scripts/weboob +++ b/scripts/weboob @@ -27,9 +27,9 @@ import os import sys import inspect from datetime import datetime, timedelta +from collections import OrderedDict import weboob.applications -from weboob.tools.ordereddict import OrderedDict from weboob.tools.application.console import ConsoleApplication diff --git a/weboob/applications/boobathon/boobathon.py b/weboob/applications/boobathon/boobathon.py index 84e35769c0f716cdce606fb5d31824d9af603f15..9ea248c6a17bd27c8f462ceb4c042d50e9637a87 100644 --- a/weboob/applications/boobathon/boobathon.py +++ b/weboob/applications/boobathon/boobathon.py @@ -24,10 +24,10 @@ import sys from urlparse import urlsplit from random import choice +from collections import OrderedDict from weboob.capabilities.content import CapContent from weboob.tools.application.repl import ReplApplication -from weboob.tools.ordereddict import OrderedDict __all__ = ['Boobathon'] diff --git a/weboob/applications/weboobcfg/weboobcfg.py b/weboob/applications/weboobcfg/weboobcfg.py index 478fb723aa3756bd5b847b9f5e2eb78e4df75fde..2f6bfc3df0a350f74436d3ff07a76ac798c609c2 100644 --- a/weboob/applications/weboobcfg/weboobcfg.py +++ b/weboob/applications/weboobcfg/weboobcfg.py @@ -21,12 +21,12 @@ import os import re +from collections import OrderedDict from weboob.capabilities.account import CapAccount from weboob.exceptions import ModuleLoadError from weboob.tools.application.repl import ReplApplication from weboob.tools.application.console import ConsoleProgress -from weboob.tools.ordereddict import OrderedDict from weboob.tools.application.formatters.iformatter import IFormatter __all__ = ['WeboobCfg'] diff --git a/weboob/browser/browsers.py b/weboob/browser/browsers.py index 77a868743441fe9302c56f575cd06a8d52e2f473..788bd96cf9e07afe0483d6394585f791d6d83067 100644 --- a/weboob/browser/browsers.py +++ b/weboob/browser/browsers.py @@ -19,6 +19,7 @@ from __future__ import absolute_import, print_function +from collections import OrderedDict from functools import wraps import re import pickle @@ -47,7 +48,6 @@ from weboob.exceptions import BrowserHTTPSDowngrade, ModuleInstallError from weboob.tools.log import getLogger -from weboob.tools.ordereddict import OrderedDict from weboob.tools.json import json from .cookies import WeboobCookieJar diff --git a/weboob/browser/elements.py b/weboob/browser/elements.py index f0288ddea0b2ab0acbffe0c1a8fa75475d877be3..ffda7873d7193a105db5cf1f2c7a2bfbbe5c9384 100644 --- a/weboob/browser/elements.py +++ b/weboob/browser/elements.py @@ -19,10 +19,10 @@ import re import sys +from collections import OrderedDict from copy import deepcopy from weboob.tools.log import getLogger, DEBUG_FILTERS -from weboob.tools.ordereddict import OrderedDict from weboob.browser.pages import NextPage from .filters.standard import _Filter, CleanText diff --git a/weboob/browser/pages.py b/weboob/browser/pages.py index 1abd313db8eef5c9a9c42a8381205715c80876a5..826da1328dadd4a00ec703dab1449133f65b366b 100644 --- a/weboob/browser/pages.py +++ b/weboob/browser/pages.py @@ -19,6 +19,7 @@ from __future__ import absolute_import +from collections import OrderedDict from functools import wraps import warnings from io import BytesIO @@ -34,7 +35,6 @@ from weboob.exceptions import ParseError, ModuleInstallError from weboob.tools.compat import basestring from weboob.tools.log import getLogger -from weboob.tools.ordereddict import OrderedDict from weboob.tools.pdf import decompress_pdf diff --git a/weboob/capabilities/base.py b/weboob/capabilities/base.py index b91ac5e694565215246c6a1a989916726bc25943..921b8455b621b2778f324864261e7be445e9c1dd 100644 --- a/weboob/capabilities/base.py +++ b/weboob/capabilities/base.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict import warnings import re from decimal import Decimal @@ -25,7 +25,6 @@ from weboob.tools.compat import unicode, long from weboob.tools.misc import to_unicode -from weboob.tools.ordereddict import OrderedDict __all__ = ['UserError', 'FieldNotFound', 'NotAvailable', diff --git a/weboob/capabilities/collection.py b/weboob/capabilities/collection.py index 08f177880de33d3dacfb423dd12fb43b931e891c..0704543414bcec71380af1a743f3aaa6bbfec231 100644 --- a/weboob/capabilities/collection.py +++ b/weboob/capabilities/collection.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from weboob.tools.ordereddict import OrderedDict +from collections import OrderedDict from .base import Capability, BaseObject, UserError, StringField, Field diff --git a/weboob/capabilities/contact.py b/weboob/capabilities/contact.py index bdf1e5de3a14711966a24f7770af44be6a90a88e..70a4d7d76caee0116740fd6f21b014b392b1855b 100644 --- a/weboob/capabilities/contact.py +++ b/weboob/capabilities/contact.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . +from collections import OrderedDict from .base import Capability, BaseObject, Field, StringField, BytesField, IntField, \ UserError -from weboob.tools.ordereddict import OrderedDict __all__ = ['ProfileNode', 'ContactPhoto', 'Contact', 'QueryError', 'Query', 'CapContact'] diff --git a/weboob/capabilities/image.py b/weboob/capabilities/image.py index ee6c9338cc5d147f53478b7bf4c905464d658785..672ae929a4662d58ad2ec7b51542fae65501f115 100644 --- a/weboob/capabilities/image.py +++ b/weboob/capabilities/image.py @@ -18,7 +18,8 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from weboob.tools.ordereddict import OrderedDict +from collections import OrderedDict + from .base import NotLoaded, Field, BytesField from .file import CapFile, BaseFile diff --git a/weboob/tools/application/console.py b/weboob/tools/application/console.py index 9ac0726ec4fc808c1eaf8b41dd1960e57c7825ae..e63804d716bb66d5953b6d7276acf123c1e6f187 100644 --- a/weboob/tools/application/console.py +++ b/weboob/tools/application/console.py @@ -20,6 +20,7 @@ from __future__ import print_function +from collections import OrderedDict from copy import copy import getpass import logging @@ -38,7 +39,6 @@ from weboob.tools.value import Value, ValueBool, ValueFloat, ValueInt, ValueBackendPassword from weboob.tools.misc import to_unicode from weboob.tools.compat import check_output -from weboob.tools.ordereddict import OrderedDict from .base import Application, MoreResultsAvailable diff --git a/weboob/tools/application/formatters/iformatter.py b/weboob/tools/application/formatters/iformatter.py index cd9ff574bf974f3c07367a86d399eb46903bf815..d82c480bcccf4733e1105a271db8654264406312 100644 --- a/weboob/tools/application/formatters/iformatter.py +++ b/weboob/tools/application/formatters/iformatter.py @@ -20,6 +20,7 @@ from __future__ import print_function +from collections import OrderedDict import os import sys import subprocess @@ -61,7 +62,6 @@ def readch(): from weboob.capabilities.base import BaseObject from weboob.tools.application.console import ConsoleApplication -from weboob.tools.ordereddict import OrderedDict from weboob.tools.misc import guess_encoding __all__ = ['IFormatter', 'MandatoryFieldsNotFound'] diff --git a/weboob/tools/application/qt5/backendcfg.py b/weboob/tools/application/qt5/backendcfg.py index 15c128749404273e6d1af301747c44b944d637c0..b8ef49729dfe73864efd03266c6bb9f0ab4fa36c 100644 --- a/weboob/tools/application/qt5/backendcfg.py +++ b/weboob/tools/application/qt5/backendcfg.py @@ -26,6 +26,7 @@ from PyQt5.QtCore import Qt, QVariant, QUrl, QThread from PyQt5.QtCore import pyqtSignal as Signal, pyqtSlot as Slot +from collections import OrderedDict import re import os from logging import warning @@ -36,7 +37,6 @@ from weboob.exceptions import ModuleInstallError, ModuleLoadError from .backendcfg_ui import Ui_BackendCfg from .reposdlg_ui import Ui_RepositoriesDlg -from weboob.tools.ordereddict import OrderedDict from weboob.tools.misc import to_unicode from .qt import QtValue diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index 545d80ea2f6fcc47db891a51f817c02289fb7a8e..ed864dfad60cd3f648ca2340dd03524187014ad3 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -21,6 +21,7 @@ import atexit from cmd import Cmd +from collections import OrderedDict import logging import re from optparse import OptionGroup, OptionParser, IndentedHelpFormatter @@ -32,7 +33,6 @@ from weboob.tools.application.formatters.iformatter import MandatoryFieldsNotFound from weboob.tools.misc import to_unicode from weboob.tools.path import WorkingPath -from weboob.tools.ordereddict import OrderedDict from weboob.capabilities.collection import Collection, BaseCollection, CapCollection, CollectionNotFound from .console import BackendNotGiven, ConsoleApplication diff --git a/weboob/tools/config/iniconfig.py b/weboob/tools/config/iniconfig.py index 859f9eb14fdf17d8473ac42e1ccd63b90ae2e612..1f08a113b434cb9408b717fe14af572bccb81f81 100644 --- a/weboob/tools/config/iniconfig.py +++ b/weboob/tools/config/iniconfig.py @@ -19,11 +19,11 @@ from ConfigParser import RawConfigParser, DEFAULTSECT +from collections import OrderedDict from decimal import Decimal import logging import os -from weboob.tools.ordereddict import OrderedDict from .iconfig import IConfig diff --git a/weboob/tools/ordereddict.py b/weboob/tools/ordereddict.py deleted file mode 100644 index 269e43859b25be5773d224394363593e927d8975..0000000000000000000000000000000000000000 --- a/weboob/tools/ordereddict.py +++ /dev/null @@ -1,133 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright(C) 2010-2011 Christophe Benz -# -# This file is part of weboob. -# -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . -from __future__ import absolute_import - -__all__ = ['OrderedDict'] - - -try: - from collections import OrderedDict -except ImportError: - try: - from simplejson import OrderedDict - except ImportError: - try: - from ordereddict import OrderedDict - except ImportError: - # {{{ http://code.activestate.com/recipes/576693/ (r6) - from UserDict import DictMixin - - class OrderedDict(dict, DictMixin): - def __init__(self, *args, **kwds): - if len(args) > 1: - raise TypeError('expected at most 1 arguments, got %d' % len(args)) - try: - self.__end - except AttributeError: - self.clear() - self.update(*args, **kwds) - - def clear(self): - self.__end = end = [] - end += [None, end, end] # sentinel node for doubly linked list - self.__map = {} # key --> [key, prev, next] - dict.clear(self) - - def __setitem__(self, key, value): - if key not in self: - end = self.__end - curr = end[1] - curr[2] = end[1] = self.__map[key] = [key, curr, end] - dict.__setitem__(self, key, value) - - def __delitem__(self, key): - dict.__delitem__(self, key) - key, prev, next = self.__map.pop(key) - prev[2] = next - next[1] = prev - - def __iter__(self): - end = self.__end - curr = end[2] - while curr is not end: - yield curr[0] - curr = curr[2] - - def __reversed__(self): - end = self.__end - curr = end[1] - while curr is not end: - yield curr[0] - curr = curr[1] - - def popitem(self, last=True): - if not self: - raise KeyError('dictionary is empty') - if last: - key = reversed(self).next() - else: - key = iter(self).next() - value = self.pop(key) - return key, value - - def __reduce__(self): - items = [[k, self[k]] for k in self] - tmp = self.__map, self.__end - del self.__map, self.__end - inst_dict = vars(self).copy() - self.__map, self.__end = tmp - if inst_dict: - return (self.__class__, (items,), inst_dict) - return self.__class__, (items,) - - def keys(self): - return list(self) - - setdefault = DictMixin.setdefault - update = DictMixin.update - pop = DictMixin.pop - values = DictMixin.values - items = DictMixin.items - iterkeys = DictMixin.iterkeys - itervalues = DictMixin.itervalues - iteritems = DictMixin.iteritems - - def __repr__(self): - if not self: - return '%s()' % (self.__class__.__name__,) - return '%s(%r)' % (self.__class__.__name__, self.items()) - - def copy(self): - return self.__class__(self) - - @classmethod - def fromkeys(cls, iterable, value=None): - d = cls() - for key in iterable: - d[key] = value - return d - - def __eq__(self, other): - if isinstance(other, OrderedDict): - return len(self) == len(other) and self.items() == other.items() - return dict.__eq__(self, other) - - def __ne__(self, other): - return not self == other - # end of http://code.activestate.com/recipes/576693/ }}} diff --git a/weboob/tools/value.py b/weboob/tools/value.py index fe1b81ea33810e8a84923baeadabe2abc14ba769..1914d0b9256287dd34dc7ed05598ebd5c30a1f6c 100644 --- a/weboob/tools/value.py +++ b/weboob/tools/value.py @@ -17,13 +17,12 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - +from collections import OrderedDict import re import subprocess from .compat import check_output from .misc import to_unicode -from .ordereddict import OrderedDict __all__ = ['ValuesDict', 'Value', 'ValueBackendPassword', 'ValueInt', 'ValueFloat', 'ValueBool']