27
27
"""
28
28
from .__meta__ import __version__ , __version_info__ # noqa: F401
29
29
from . import css_parser as cp
30
- from .util import HTML , HTML5 , XHTML , XML
30
+ from .util import HTML , HTML5 , XHTML , XML , deprecated
31
31
32
32
__all__ = (
33
33
'HTML' , 'HTML5' , 'XHTML' , 'XML' ,
34
- 'SoupSieve' , 'compile' , 'purge' , 'comments' , 'select' , 'match' , 'filter'
34
+ 'SoupSieve' , 'compile' , 'purge' ,
35
+ 'comments' , 'icomments' , 'select' , 'iselect' , 'match' , 'filter'
35
36
)
36
37
37
38
SoupSieve = cp .SoupSieve
@@ -79,10 +80,10 @@ def comments(node, limit=0, mode=HTML5):
79
80
return compile ("" , None , mode ).comments (node , limit )
80
81
81
82
82
- def commentsiter (node , limit = 0 , mode = HTML5 ):
83
+ def icomments (node , limit = 0 , mode = HTML5 ):
83
84
"""Iterate comments only."""
84
85
85
- yield from compile ("" , None , mode ).commentsiter (node , limit )
86
+ yield from compile ("" , None , mode ).icomments (node , limit )
86
87
87
88
88
89
def select (select , node , namespaces = None , limit = 0 , mode = HTML5 ):
@@ -91,7 +92,22 @@ def select(select, node, namespaces=None, limit=0, mode=HTML5):
91
92
return compile (select , namespaces , mode ).select (node , limit )
92
93
93
94
95
+ def iselect (select , node , namespaces = None , limit = 0 , mode = HTML5 ):
96
+ """Iterate the specified tags."""
97
+
98
+ yield from compile (select , namespaces , mode ).iselect (node , limit )
99
+
100
+
101
+ # ====== Deprecated ======
102
+ @deprecated ("Use 'icomments' instead." )
103
+ def commentsiter (node , limit = 0 , mode = HTML5 ):
104
+ """Iterate comments only."""
105
+
106
+ yield from icomments (node , limit , mode )
107
+
108
+
109
+ @deprecated ("Use 'iselect' instead." )
94
110
def selectiter (select , node , namespaces = None , limit = 0 , mode = HTML5 ):
95
111
"""Iterate the specified tags."""
96
112
97
- yield from compile (select , namespaces , mode ). selectiter ( node , limit )
113
+ yield from iselect (select , node , namespaces , limit , mode )
0 commit comments