Browse Source

Update soupsieve_py3 2.0.0.final (e66c311) → 2.0.2.dev (05086ef).

Update soupsieve_py2 backport.
tags/release_0.25.1
JackDandy 5 years ago
parent
commit
da341515ab
  1. 2
      CHANGES.md
  2. 16
      lib/soupsieve_py2/css_match.py
  3. 2
      lib/soupsieve_py2/css_parser.py
  4. 12
      lib/soupsieve_py2/util.py
  5. 2
      lib/soupsieve_py3/__meta__.py
  6. 16
      lib/soupsieve_py3/css_match.py
  7. 2
      lib/soupsieve_py3/css_parser.py
  8. 15
      lib/soupsieve_py3/util.py

2
CHANGES.md

@ -8,6 +8,8 @@
* Update feedparser_py2 backport
* Update Js2Py 0.70 (f297498) to 0.70 (92250a4)
* Update profilehooks module 1.11.2 (d72cc2b) to 1.12.0 (3ee1f60)
* Update soupsieve_py3 2.0.0.final (e66c311) to 2.0.2.dev (05086ef)
* Update soupsieve_py2 backport
[develop changelog]

16
lib/soupsieve_py2/css_match.py

@ -6,6 +6,8 @@ import re
from .import css_types as ct
import unicodedata
import bs4
# Empty tag pattern (whitespace okay)
RE_NOT_EMPTY = re.compile('[^ \t\r\n\f]')
@ -88,50 +90,36 @@ class _DocumentNav(object):
@staticmethod
def is_doc(obj):
"""Is `BeautifulSoup` object."""
import bs4
return isinstance(obj, bs4.BeautifulSoup)
@staticmethod
def is_tag(obj):
"""Is tag."""
import bs4
return isinstance(obj, bs4.Tag)
@staticmethod
def is_declaration(obj): # pragma: no cover
"""Is declaration."""
import bs4
return isinstance(obj, bs4.Declaration)
@staticmethod
def is_cdata(obj):
"""Is CDATA."""
import bs4
return isinstance(obj, bs4.CData)
@staticmethod
def is_processing_instruction(obj): # pragma: no cover
"""Is processing instruction."""
import bs4
return isinstance(obj, bs4.ProcessingInstruction)
@staticmethod
def is_navigable_string(obj):
"""Is navigable string."""
import bs4
return isinstance(obj, bs4.NavigableString)
@staticmethod
def is_special_string(obj):
"""Is special string."""
import bs4
return isinstance(obj, (bs4.Comment, bs4.Declaration, bs4.CData, bs4.ProcessingInstruction, bs4.Doctype))
@classmethod

2
lib/soupsieve_py2/css_parser.py

@ -901,7 +901,7 @@ class CSSParser(object):
elif key == 'pseudo_class':
has_selector, is_html = self.parse_pseudo_class(sel, m, has_selector, iselector, is_html)
elif key == 'pseudo_element':
raise NotImplementedError("Psuedo-element found at position {}".format(m.start(0)))
raise NotImplementedError("Pseudo-element found at position {}".format(m.start(0)))
elif key == 'pseudo_contains':
has_selector = self.parse_pseudo_contains(sel, m, has_selector)
elif key in ('pseudo_nth_type', 'pseudo_nth_child'):

12
lib/soupsieve_py2/util.py

@ -33,8 +33,6 @@ DEBUG = 0x00001
RE_PATTERN_LINE_SPLIT = re.compile(r'(?:\r\n|(?!\r\n)[\n\r])|$')
LC_A = ord('a')
LC_Z = ord('z')
UC_A = ord('A')
UC_Z = ord('Z')
@ -49,16 +47,6 @@ def lower(string):
return ''.join(new_string)
def upper(string): # pragma: no cover
"""Lower."""
new_string = []
for c in string:
o = ord(c)
new_string.append(chr(o - 32) if LC_A <= o <= LC_Z else c)
return ''.join(new_string)
def uchr(i):
"""Allow getting Unicode character on narrow python builds."""

2
lib/soupsieve_py3/__meta__.py

@ -185,5 +185,5 @@ def parse_version(ver, pre=False):
return Version(major, minor, micro, release, pre, post, dev)
__version_info__ = Version(2, 0, 0, "final")
__version_info__ = Version(2, 0, 2, ".dev")
__version__ = __version_info__._get_canonical()

16
lib/soupsieve_py3/css_match.py

@ -5,6 +5,8 @@ import re
from .import css_types as ct
import unicodedata
import bs4
# Empty tag pattern (whitespace okay)
RE_NOT_EMPTY = re.compile('[^ \t\r\n\f]')
@ -87,50 +89,36 @@ class _DocumentNav(object):
@staticmethod
def is_doc(obj):
"""Is `BeautifulSoup` object."""
import bs4
return isinstance(obj, bs4.BeautifulSoup)
@staticmethod
def is_tag(obj):
"""Is tag."""
import bs4
return isinstance(obj, bs4.Tag)
@staticmethod
def is_declaration(obj): # pragma: no cover
"""Is declaration."""
import bs4
return isinstance(obj, bs4.Declaration)
@staticmethod
def is_cdata(obj):
"""Is CDATA."""
import bs4
return isinstance(obj, bs4.CData)
@staticmethod
def is_processing_instruction(obj): # pragma: no cover
"""Is processing instruction."""
import bs4
return isinstance(obj, bs4.ProcessingInstruction)
@staticmethod
def is_navigable_string(obj):
"""Is navigable string."""
import bs4
return isinstance(obj, bs4.NavigableString)
@staticmethod
def is_special_string(obj):
"""Is special string."""
import bs4
return isinstance(obj, (bs4.Comment, bs4.Declaration, bs4.CData, bs4.ProcessingInstruction, bs4.Doctype))
@classmethod

2
lib/soupsieve_py3/css_parser.py

@ -901,7 +901,7 @@ class CSSParser(object):
elif key == 'pseudo_class':
has_selector, is_html = self.parse_pseudo_class(sel, m, has_selector, iselector, is_html)
elif key == 'pseudo_element':
raise NotImplementedError("Psuedo-element found at position {}".format(m.start(0)))
raise NotImplementedError("Pseudo-element found at position {}".format(m.start(0)))
elif key == 'pseudo_contains':
has_selector = self.parse_pseudo_contains(sel, m, has_selector)
elif key in ('pseudo_nth_type', 'pseudo_nth_child'):

15
lib/soupsieve_py3/util.py

@ -1,5 +1,5 @@
"""Utility."""
from functools import wraps
from functools import wraps, lru_cache
import warnings
import re
@ -7,12 +7,11 @@ DEBUG = 0x00001
RE_PATTERN_LINE_SPLIT = re.compile(r'(?:\r\n|(?!\r\n)[\n\r])|$')
LC_A = ord('a')
LC_Z = ord('z')
UC_A = ord('A')
UC_Z = ord('Z')
@lru_cache(maxsize=512)
def lower(string):
"""Lower."""
@ -23,16 +22,6 @@ def lower(string):
return ''.join(new_string)
def upper(string): # pragma: no cover
"""Lower."""
new_string = []
for c in string:
o = ord(c)
new_string.append(chr(o - 32) if LC_A <= o <= LC_Z else c)
return ''.join(new_string)
class SelectorSyntaxError(Exception):
"""Syntax error in a CSS selector."""

Loading…
Cancel
Save