Permalink
Browse files

Documentation details.

  • Loading branch information...
1 parent f4676c3 commit 6a83c2ad54f85ff0c5cc4574edecb9dbacae4b6f @SimonSapin SimonSapin committed Apr 18, 2012
Showing with 8 additions and 4 deletions.
  1. +6 −2 cssselect/parser.py
  2. +2 −2 cssselect/xpath.py
View
@@ -44,7 +44,11 @@ class Selector(object):
"""
def __init__(self, tree, pseudo_element=None):
self._tree = tree
- #: A string like ``'after'`` or ``None``
+ #: If the selector has a pseudo-element: a string like ``'after'``.
+ #: Otherwise, ``None``.
+ #: Any identifier preceded by ``::`` is accepted as a pseudo-element.
+ #: It is the user’s responsibility to reject selectors with
+ #: unknown or unsupported pseudo-elements.
self.pseudo_element = pseudo_element
def __repr__(self):
@@ -242,7 +246,7 @@ def specificity(self):
def parse(css):
"""Parse a CSS *group of selectors*.
- If you dont care about pseudo-elements or selector specificity,
+ If you don't care about pseudo-elements or selector specificity,
you can skip this and use :meth:`~GenericTranslator.css_to_xpath`.
:param css:
View
@@ -120,7 +120,7 @@ def css_to_xpath(self, css, prefix='descendant-or-self::'):
"""Translate a *group of selectors* to XPath.
Pseudo-elements are not supported here since XPath only knows
- about real elements.
+ about "real" elements.
:param css:
A *group of selectors* as an Unicode string.
@@ -145,7 +145,7 @@ def selector_to_xpath(self, selector, prefix='descendant-or-self::'):
"""Translate a parsed selector to XPath.
The :attr:`~Selector.pseudo_element` attribute of the selector
- is ignored. It is the callers responsibility to reject selectors
+ is ignored. It is the caller's responsibility to reject selectors
with pseudo-elements, or to account for them somehow.
:param selector:

0 comments on commit 6a83c2a

Please sign in to comment.