Commit 84e4e9a3 authored by Vincent A's avatar Vincent A

use weboob.tools.compat.basestring and unicode where needed

parent a9bedf4d
......@@ -23,6 +23,7 @@ from weboob.capabilities.base import empty
from weboob.capabilities.gauge import CapGauge, SensorNotFound
from weboob.tools.application.repl import ReplApplication
from weboob.tools.application.formatters.iformatter import IFormatter
from weboob.tools.compat import unicode
__all__ = ['Boobsize']
......
......@@ -32,6 +32,7 @@ from weboob.capabilities.base import empty, BaseObject
from weboob.capabilities.bugtracker import CapBugTracker, Query, Update, Project, Issue, IssueError
from weboob.tools.application.repl import ReplApplication, defaultcount
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
from weboob.tools.compat import basestring, unicode
from weboob.tools.html import html2text
from weboob.tools.date import parse_french_date
......
......@@ -36,6 +36,7 @@ from weboob.core import Weboob, CallErrors
from weboob.core.scheduler import Scheduler
from weboob.capabilities.messages import CapMessages, CapMessagesPost, Thread, Message
from weboob.tools.application.repl import ReplApplication
from weboob.tools.compat import unicode
from weboob.tools.date import utc2local
from weboob.tools.html import html2text
from weboob.tools.misc import get_backtrace, to_unicode
......
......@@ -31,6 +31,7 @@ from weboob.tools.application.qt5 import QtMainWindow, QtDo
from weboob.tools.application.qt5.backendcfg import BackendCfg
from weboob.tools.application.qt5.models import BackendListModel
from weboob.tools.application.qt5.search_history import HistoryCompleter
from weboob.tools.compat import unicode
from weboob.applications.suboob.suboob import LANGUAGE_CONV
from weboob.applications.qcineoob.ui.main_window_ui import Ui_MainWindow
......
......@@ -26,6 +26,7 @@ from PyQt5.QtWidgets import QFrame, QMessageBox
from weboob.applications.qcineoob.ui.movie_ui import Ui_Movie
from weboob.capabilities.base import empty
from weboob.applications.suboob.suboob import LANGUAGE_CONV
from weboob.tools.compat import unicode
class Movie(QFrame):
......
......@@ -25,6 +25,7 @@ from PyQt5.QtWidgets import QFrame, QFileDialog
from weboob.applications.qcineoob.ui.torrent_ui import Ui_Torrent
from weboob.applications.weboorrents.weboorrents import sizeof_fmt
from weboob.capabilities.base import empty
from weboob.tools.compat import unicode
class Torrent(QFrame):
......
......@@ -27,7 +27,7 @@ from PyQt5.QtCore import Qt, pyqtSlot as Slot
from weboob.tools.application.qt5 import QtDo, HTMLDelegate
from weboob.tools.application.qt5.models import BackendListModel
from weboob.tools.compat import range
from weboob.tools.compat import range, basestring, unicode
from weboob.tools.misc import to_unicode
from weboob.capabilities.contact import CapContact, Contact
from weboob.capabilities.chat import CapChat
......
......@@ -22,6 +22,7 @@ from PyQt5.QtGui import QImage, QPixmap
from PyQt5.QtWidgets import QFrame
from weboob.tools.application.qt5 import QtDo
from weboob.tools.compat import unicode
from weboob.applications.qvideoob.ui.minivideo_ui import Ui_MiniVideo
from .video import Video
......
......@@ -23,6 +23,7 @@ from PyQt5.QtWidgets import QDialog
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer
from weboob.applications.qvideoob.ui.video_ui import Ui_Video
from weboob.tools.compat import unicode
class Video(QDialog):
......
......@@ -27,6 +27,7 @@ from distutils.spawn import find_executable
from weboob.core.bcall import CallErrors
from weboob.capabilities.content import CapContent, Revision
from weboob.tools.application.repl import ReplApplication, defaultcount
from weboob.tools.compat import unicode
__all__ = ['WebContentEdit']
......
......@@ -51,6 +51,7 @@ except ImportError:
from weboob.exceptions import BrowserHTTPSDowngrade, ModuleInstallError
from weboob.tools.log import getLogger
from weboob.tools.compat import basestring, unicode
from weboob.tools.json import json
from .cookies import WeboobCookieJar
......
......@@ -28,6 +28,7 @@ from copy import deepcopy
import lxml.html
from weboob.tools.log import getLogger, DEBUG_FILTERS
from weboob.tools.compat import basestring, unicode
from weboob.browser.pages import NextPage
from .filters.standard import _Filter, CleanText
......
......@@ -21,6 +21,7 @@
import lxml.html as html
from .standard import _Selector, _NO_DEFAULT, Filter, FilterError
from weboob.tools.html import html2text
from weboob.tools.compat import basestring, unicode
__all__ = ['CSS', 'XPath', 'XPathNotFound', 'AttributeNotFound',
......
......@@ -17,6 +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.tools.compat import basestring
from .standard import _Filter, _NO_DEFAULT, Filter, ParseError
......
......@@ -32,7 +32,7 @@ import lxml.html
from weboob.capabilities.base import empty
from weboob.capabilities.base import Currency as BaseCurrency
from weboob.tools.compat import basestring
from weboob.tools.compat import basestring, unicode
from weboob.exceptions import ParseError
from weboob.browser.url import URL
from weboob.tools.log import getLogger, DEBUG_FILTERS
......
......@@ -34,7 +34,7 @@ except ImportError:
import requests
from weboob.exceptions import ParseError, ModuleInstallError
from weboob.tools.compat import basestring
from weboob.tools.compat import basestring, unicode
from weboob.tools.log import getLogger
from weboob.tools.pdf import decompress_pdf
......
......@@ -25,6 +25,7 @@ except ImportError:
import re
import requests
from weboob.tools.compat import basestring
from weboob.tools.regex_helper import normalize
from weboob.tools.misc import to_unicode
......
......@@ -19,6 +19,8 @@
import re
from weboob.tools.compat import unicode
from .image import Thumbnail
from .base import Field, StringField, IntField, BaseObject
from .date import DeltaField
......
......@@ -25,6 +25,7 @@ import re
from weboob.capabilities.base import empty
from weboob.exceptions import BrowserQuestion
from weboob.tools.capabilities.bank.iban import is_iban_valid
from weboob.tools.compat import unicode
from .base import BaseObject, Field, StringField, DecimalField, IntField, \
UserError, Currency, NotAvailable
......
......@@ -17,6 +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.tools.compat import unicode
from .base import Capability, BaseObject, Field, StringField,\
IntField, UserError
......
......@@ -19,6 +19,8 @@
from collections import OrderedDict
from weboob.tools.compat import unicode
from .base import Capability, BaseObject, Field, StringField, BytesField, IntField, \
BoolField, UserError
......
......@@ -19,6 +19,7 @@
from weboob.capabilities.image import BaseImage as CIBaseImage, Thumbnail
from weboob.tools.compat import unicode
from .base import Capability, BaseObject, NotLoaded, Field, StringField, \
IntField, FloatField
from .date import DateField
......
......@@ -21,6 +21,8 @@
import datetime
import time
from weboob.tools.compat import unicode
from .base import Capability, BaseObject, NotLoaded, Field, StringField, \
IntField, UserError
from .date import DateField
......
......@@ -17,6 +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.tools.compat import unicode
from .base import Capability, BaseObject, NotLoaded, StringField, BoolField, UserError
......
......@@ -20,6 +20,8 @@
from datetime import datetime, date
from weboob.tools.compat import basestring, unicode
from .base import Capability, BaseObject, Field, FloatField, \
StringField, UserError, NotLoaded
from .date import DateField
......
......@@ -27,6 +27,9 @@ except ImportError:
from configparser import RawConfigParser, DuplicateSectionError
from logging import warning
from weboob.tools.compat import unicode
__all__ = ['BackendsConfig', 'BackendAlreadyExists']
......
......@@ -26,6 +26,7 @@ except ImportError:
import queue as Queue
from weboob.capabilities.base import BaseObject
from weboob.tools.compat import basestring
from weboob.tools.misc import get_backtrace
from weboob.tools.log import getLogger
......
......@@ -22,6 +22,7 @@ import imp
import logging
from weboob.tools.backend import Module
from weboob.tools.compat import basestring
from weboob.tools.log import getLogger
from weboob.exceptions import ModuleLoadError
......
......@@ -27,6 +27,7 @@ from weboob.core.requests import RequestsManager
from weboob.core.repositories import Repositories, PrintProgress
from weboob.core.scheduler import Scheduler
from weboob.tools.backend import Module
from weboob.tools.compat import basestring, unicode
from weboob.tools.config.iconfig import ConfigError
from weboob.tools.log import getLogger
from weboob.exceptions import ModuleLoadError
......
......@@ -36,6 +36,7 @@ from weboob.exceptions import BrowserHTTPError, BrowserHTTPNotFound, ModuleInsta
from .modules import LoadedModule
from weboob.tools.log import getLogger
from weboob.tools.misc import get_backtrace, to_unicode, find_exe
from weboob.tools.compat import basestring, unicode
try:
from ConfigParser import RawConfigParser, DEFAULTSECT
except ImportError:
......
......@@ -53,6 +53,7 @@ from gzip import GzipFile
from threading import RLock
from weboob.exceptions import BrowserUnavailable, BrowserIncorrectPassword, BrowserPasswordExpired, BrowserForbidden, BrowserBanned, BrowserHTTPNotFound, BrowserHTTPError, FormFieldConversionWarning, BrowserSSLError
from weboob.tools.compat import basestring, unicode
from weboob.tools.decorators import retry
from weboob.tools.log import getLogger
from weboob.deprecated.browser.parsers import get_parser
......
......@@ -21,6 +21,7 @@
import csv
from weboob.tools.log import getLogger
from weboob.tools.compat import basestring, unicode
from .iparser import IParser
......
......@@ -41,6 +41,7 @@ from weboob.capabilities.bank import TransferInvalidLabel, TransferInvalidAmount
TransferInvalidEmitter, TransferInvalidRecipient
from weboob.tools.value import Value, ValueBool, ValueFloat, ValueInt, ValueBackendPassword
from weboob.tools.misc import to_unicode
from weboob.tools.compat import unicode
from .base import Application, MoreResultsAvailable
......
......@@ -20,6 +20,8 @@
from __future__ import absolute_import
import csv
from weboob.tools.compat import basestring, unicode
from .iformatter import IFormatter
__all__ = ['CSVFormatter']
......
......@@ -62,6 +62,7 @@ else:
from weboob.capabilities.base import BaseObject
from weboob.tools.application.console import ConsoleApplication
from weboob.tools.compat import basestring
from weboob.tools.misc import guess_encoding
__all__ = ['IFormatter', 'MandatoryFieldsNotFound']
......
......@@ -38,6 +38,7 @@ from weboob.exceptions import ModuleInstallError, ModuleLoadError
from .backendcfg_ui import Ui_BackendCfg
from .reposdlg_ui import Ui_RepositoriesDlg
from weboob.tools.misc import to_unicode
from weboob.tools.compat import unicode
from .qt import QtValue
......
......@@ -36,7 +36,7 @@ from PyQt5.QtGui import QTextDocument, QAbstractTextDocumentLayout, QPalette
from weboob.core.ouiboube import Weboob, VersionsMismatchError
from weboob.core.scheduler import IScheduler
from weboob.tools.compat import range
from weboob.tools.compat import range, unicode
from weboob.tools.config.iconfig import ConfigError
from weboob.exceptions import BrowserUnavailable, BrowserIncorrectPassword, BrowserForbidden, ModuleInstallError
from weboob.tools.value import ValueInt, ValueBool, ValueBackendPassword
......
......@@ -31,7 +31,7 @@ import os
from weboob.capabilities.base import FieldNotFound, BaseObject, UserError
from weboob.core import CallErrors
from weboob.tools.application.formatters.iformatter import MandatoryFieldsNotFound
from weboob.tools.compat import range
from weboob.tools.compat import range, basestring, unicode
from weboob.tools.misc import to_unicode
from weboob.tools.path import WorkingPath
from weboob.capabilities.collection import Collection, BaseCollection, CapCollection, CollectionNotFound
......
......@@ -18,6 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities import UserError
from weboob.tools.compat import unicode
__all__ = ['ResultsCondition', 'ResultsConditionError']
......
......@@ -24,6 +24,7 @@ from copy import copy
from weboob.capabilities.base import BaseObject, FieldNotFound, \
Capability, NotLoaded, NotAvailable
from weboob.tools.misc import iter_fields
from weboob.tools.compat import basestring
from weboob.tools.log import getLogger
from weboob.tools.value import ValuesDict
from weboob.exceptions import ModuleInstallError
......
......@@ -20,6 +20,8 @@
import re
from weboob.tools.compat import unicode
_country2length = dict(
AL=28, AD=24, AT=20, AZ=28, BE=16, BH=22, BA=20, BR=29,
BG=22, CR=21, HR=21, CY=28, CZ=24, DK=18, DO=28, EE=20,
......
......@@ -26,6 +26,8 @@ try:
except ImportError:
raise ImportError('Please install python-imaging')
from weboob.tools.compat import basestring
class VirtKeyboardError(Exception):
pass
......
......@@ -28,6 +28,8 @@ from decimal import Decimal
import logging
import os
from weboob.tools.compat import basestring, unicode
from .iconfig import IConfig
......
......@@ -19,6 +19,8 @@
import warnings
from weboob.tools.compat import unicode
__all__ = ['html2text']
......
......@@ -36,6 +36,7 @@ except ImportError:
import json
from weboob.capabilities.base import BaseObject, NotAvailable, NotLoaded
from weboob.tools.compat import basestring
def mini_jsonpath(node, path):
......
......@@ -19,6 +19,8 @@
from copy import copy
from posixpath import sep, join
from .compat import unicode
class WorkingPath(object):
def __init__(self):
......
......@@ -34,6 +34,8 @@ This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from weboob.tools.compat import basestring
# Mapping of an escape character to a representative of that class. So, e.g.,
# "\w" is replaced by "x" in a reverse URL. A value of None means to ignore
# this sequence. Any missing key is mapped to itself.
......
......@@ -25,6 +25,8 @@ import subprocess
from collections import OrderedDict
from subprocess import check_output
from weboob.tools.compat import basestring, unicode
from .misc import to_unicode
......
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