Commit f01823af authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Vincent A

weboob.browser.pages: import json toplevel, it's cleaner

It's not an optional or costly dependency.
parent bf90e699
...@@ -33,8 +33,10 @@ import requests ...@@ -33,8 +33,10 @@ import requests
from weboob.exceptions import ParseError, ModuleInstallError from weboob.exceptions import ParseError, ModuleInstallError
from weboob.tools.compat import basestring, unicode, urljoin from weboob.tools.compat import basestring, unicode, urljoin
from weboob.tools.json import json, mini_jsonpath
from weboob.tools.log import getLogger from weboob.tools.log import getLogger
from weboob.tools.pdf import decompress_pdf from weboob.tools.pdf import decompress_pdf
from .exceptions import LoggedOut from .exceptions import LoggedOut
...@@ -468,12 +470,9 @@ class JsonPage(Page): ...@@ -468,12 +470,9 @@ class JsonPage(Page):
return default return default
def path(self, path, context=None): def path(self, path, context=None):
from weboob.tools.json import mini_jsonpath
return mini_jsonpath(context or self.doc, path) return mini_jsonpath(context or self.doc, path)
def build_doc(self, text): def build_doc(self, text):
from weboob.tools.json import json
bom = u'\uFEFF' # wtf bom = u'\uFEFF' # wtf
if text.startswith(bom): if text.startswith(bom):
text = text[len(bom):] text = text[len(bom):]
......
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