Commits

Olivier Lauzanne  committed 3bce8f5

documentation

  • Participants
  • Parent commits b45eaa0

Comments (0)

Files changed (2)

File pyquery/README.txt

 
 It can be used for many purposes, one idea that I might try in the future is to
 use it for templating with pure http templates that you modify using pyquery.
+I can also be used for web scrapping or for theming applications with
+`Deliverance`_.
+
+The project is being actively developped on `Bitbucket`_ and I have the policy
+of giving push access to anyone who wants it and then to review what he does.
+So if you want to contribute just email me.
+
+The Sphinx documentation is available on `pyquery.org`_.
+
+.. _deliverance: http://www.gawel.org/weblog/en/2008/12/skinning-with-pyquery-and-deliverance
+.. _bitbucket: http://www.bitbucket.org/olauzanne/pyquery/
+.. _pyquery.org: http://pyquery.org/
 
 .. contents::
 
     'you know Python rocks'
 
 You can use some of the pseudo classes that are available in jQuery but that
-are not standard in css such as :first :last :even :odd :eq :lt :gt::
+are not standard in css such as :first :last :even :odd :eq :lt :gt :checked
+:selected :file::
 
     >>> d('p:first')
     [<p#hello.hello>]
     >>> d('a[title="W3C Activities"]').attr('href')
     'http://www.w3.org/Consortium/activities'
 
+Using different parsers
+-----------------------
+
+By default pyquery uses the lxml xml parser and then if it doesn't work goes on
+to try the html parser. It can sometimes be problematic when parsing xhtml pages
+because the parser will not raise an error but give an unusable tree.
+
+You can also choose which parser to use explicitly::
+
+   >>> pq('<p>toto</p>', parser='html')
+   [<html>]
+   >>> pq('<p>toto</p>', parser='xml')
+   [<p>]
 
 Testing
 -------
 Other documentations
 --------------------
 
-For more documentation about the API use the jquery website http://docs.jquery.com/
+First there is the Sphinx documentation `here`_.
+Then for more documentation about the API you can use the jquery website http://docs.jquery.com/.
+The reference I'm now using for the API is ... the `color cheat sheet`_.
+Then you can always look at the `code`_.
 
-The reference I'm now using for the API is ... the color cheat sheet
-http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png
+.. _code: http://www.bitbucket.org/olauzanne/pyquery/src/tip/pyquery/pyquery.py
+.. _here: http://pyquery.org
+.. _color cheat sheet: http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png
 
 TODO
 ----
 
-- SELECTORS: it works fine but missing all the :xxx (:first, :last, ...) can be
-  done by patching lxml.cssselect
+- SELECTORS: still missing some jQuery pseudo classes (:radio, :password, ...)
 - ATTRIBUTES: done
 - CSS: done
 - HTML: done
-- MANIPULATING: did all but the "wrap" methods
-- TRAVERSING: did a few
+- MANIPULATING: missing the wrapAll and wrapInner methods
+- TRAVERSING: about half done
 - EVENTS: nothing to do with server side might be used later for automatic ajax
 - CORE UI EFFECTS: did hide and show the rest doesn't really makes sense on
   server side

File pyquery/pyquery.py

         elements = []
         self._base_url = None
         parser = kwargs.get('parser')
+        if 'parser' in kwargs:
+            del kwargs['parser']
 
         if 'parent' in kwargs:
             self._parent = kwargs.pop('parent')