[Python-modules-commits] [pyquery] 02/06: Import pyquery_1.2.9.orig.tar.gz

Takaki Taniguchi takaki at moszumanska.debian.org
Wed Nov 25 09:56:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

takaki pushed a commit to branch master
in repository pyquery.

commit e10ea3b42a8e5900017d64f842e924107d74f527
Author: TANIGUCHI Takaki <takaki at asis.media-as.org>
Date:   Wed Nov 25 18:40:39 2015 +0900

    Import pyquery_1.2.9.orig.tar.gz
---
 CHANGES.rst                                        |  54 ++++
 MANIFEST.in                                        |  13 +-
 PKG-INFO                                           |  72 ++++-
 README.rst                                         |  10 +-
 README_fixt.py                                     |  27 ++
 buildout.cfg                                       |  37 +++
 docs/Makefile                                      | 153 +++++++++
 docs/_build/html/_sources/ajax.txt                 |  56 ----
 docs/_build/html/_sources/api.txt                  |   9 -
 docs/_build/html/_sources/scrap.txt                |  19 --
 docs/_build/html/_sources/tips.txt                 |  36 ---
 docs/{ajax.txt => ajax.rst}                        |  10 +-
 docs/ajax_fixt.py                                  |  33 ++
 docs/{api.txt => api.rst}                          |   0
 .../_sources/attributes.txt => attributes.rst}     |   2 +
 docs/attributes.txt                                |  30 --
 .../html/_sources/changes.txt => changes.rst}      |   0
 docs/changes.txt                                   |   4 -
 docs/conf.py                                       | 280 ++++++++++++++++
 docs/{_build/html/_sources/css.txt => css.rst}     |   0
 docs/css.txt                                       |  45 ---
 .../html/_sources/future.txt => future.rst}        |   0
 docs/future.txt                                    |  22 --
 docs/{_build/html/_sources/index.txt => index.rst} |   3 +-
 docs/index.txt                                     |  44 ---
 .../_sources/manipulating.txt => manipulating.rst} |  29 +-
 docs/manipulating.txt                              |  71 ----
 docs/pseudo_classes.rst                            | 330 +++++++++++++++++++
 docs/scrap.rst                                     |  22 ++
 docs/scrap.txt                                     |  19 --
 docs/scrap_fixt.py                                 |  21 ++
 .../html/_sources/testing.txt => testing.rst}      |   0
 docs/testing.txt                                   |  15 -
 docs/{tips.txt => tips.rst}                        |  11 +-
 docs/tips_fixt.py                                  |  21 ++
 .../_sources/traversing.txt => traversing.rst}     |   3 +
 docs/traversing.txt                                |  33 --
 pyquery.egg-info/PKG-INFO                          |  72 ++++-
 pyquery.egg-info/SOURCES.txt                       |  56 ++--
 pyquery.egg-info/requires.txt                      |   2 +-
 pyquery/ajax.py                                    |   5 +-
 pyquery/cssselectpatch.py                          | 359 ++++++++++++++++-----
 pyquery/openers.py                                 |   4 +-
 pyquery/pyquery.py                                 | 281 ++++++++++------
 setup.cfg                                          |  23 +-
 setup.py                                           |  26 +-
 tests/__init__.py                                  |   0
 tests/apps.py                                      |  35 ++
 tests/compat.py                                    |  26 ++
 pyquery/tests.txt => tests/doctests.rst            |   4 +
 pyquery/test.html => tests/invalid.xml             |   2 +
 {pyquery => tests}/test.html                       |   0
 pyquery/test.py => tests/test_pyquery.py           | 289 ++++++++---------
 tox.ini                                            |  62 ++--
 54 files changed, 1890 insertions(+), 890 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index ffdab6b..c0afa03 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,57 @@
+1.2.9 (2014-08-22)
+------------------
+
+- Support for keyword arguments in PyQuery custom functions
+
+- Fixed #78: items must take care or the parent
+
+- Fixed #65 PyQuery.make_links_absolute() no longer creates 'href' attribute
+  when it isn't there
+
+- Fixed #19. ``is_()`` was broken.
+
+- Fixed #9. ``.replaceWith(PyQuery element)`` raises error
+
+- Remove official python3.2 support (mostly because of 3rd party semi-deps)
+
+
+1.2.8 (2013-12-21)
+------------------
+
+- Fixed #22: Open by filename fails when file contains invalid xml
+
+- Bug fix in .remove_class()
+
+
+1.2.7 (2013-12-21)
+------------------
+
+- Use pep8 name for methods but keep an alias for camel case method.
+  Eg: remove_attr and removeAttr works
+  Fix #57
+
+- .text() now return an empty string instead of None if there is no text node.
+  Fix #45
+
+- Fixed #23: removeClass adds class attribute to elements which previously
+  lacked one
+
+
+1.2.6 (2013-10-11)
+------------------
+
+README_fixt.py was not include in the release. Fix #54.
+
+
+1.2.5 (2013-10-10)
+------------------
+
+cssselect compat. See https://github.com/SimonSapin/cssselect/pull/22
+
+tests improvments. no longer require a eth connection.
+
+fix #55
+
 1.2.4
 -----
 
diff --git a/MANIFEST.in b/MANIFEST.in
index fd84dc1..861cd34 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,7 @@
-recursive-include pyquery *.txt
-recursive-include pyquery *.html
-recursive-include docs *.txt
-include README.rst
-include CHANGES.rst
-include tox.ini
+graft docs
+prune docs/_build
+graft pyquery
+graft tests
+include *_fixt.py *.rst *.cfg *.ini
+global-exclude *.pyc
+global-exclude __pycache__
diff --git a/PKG-INFO b/PKG-INFO
index 210ddd2..3f6525d 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: pyquery
-Version: 1.2.4
+Version: 1.2.9
 Summary: A jquery-like library for python
 Home-page: https://github.com/gawel/pyquery
 Author: Gael Pasgrimaud
@@ -18,11 +18,6 @@ Description:
         javascript code. I just liked the jquery API and I missed it in python so I
         told myself "Hey let's make jquery in python". This is the result.
         
-        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 a git repository on Github. 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.
@@ -45,8 +40,9 @@ Description:
             >>> import urllib
             >>> d = pq("<html></html>")
             >>> d = pq(etree.fromstring("<html></html>"))
-            >>> d = pq(url='http://google.com/')
-            >>> # d = pq(url='http://google.com/', opener=lambda url, **kw: urllib.urlopen(url).read())
+            >>> d = pq(url=your_url)
+            >>> d = pq(url=your_url,
+            ...        opener=lambda url, **kw: urlopen(url).read())
             >>> d = pq(filename=path_to_html_file)
         
         Now d is like the $ in jquery::
@@ -72,11 +68,65 @@ Description:
         
         
         
-        See http://packages.python.org/pyquery/ for the full documentation
+        See http://pyquery.rtfd.org/ for the full documentation
         
         News
         ====
         
+        1.2.9 (2014-08-22)
+        ------------------
+        
+        - Support for keyword arguments in PyQuery custom functions
+        
+        - Fixed #78: items must take care or the parent
+        
+        - Fixed #65 PyQuery.make_links_absolute() no longer creates 'href' attribute
+          when it isn't there
+        
+        - Fixed #19. ``is_()`` was broken.
+        
+        - Fixed #9. ``.replaceWith(PyQuery element)`` raises error
+        
+        - Remove official python3.2 support (mostly because of 3rd party semi-deps)
+        
+        
+        1.2.8 (2013-12-21)
+        ------------------
+        
+        - Fixed #22: Open by filename fails when file contains invalid xml
+        
+        - Bug fix in .remove_class()
+        
+        
+        1.2.7 (2013-12-21)
+        ------------------
+        
+        - Use pep8 name for methods but keep an alias for camel case method.
+          Eg: remove_attr and removeAttr works
+          Fix #57
+        
+        - .text() now return an empty string instead of None if there is no text node.
+          Fix #45
+        
+        - Fixed #23: removeClass adds class attribute to elements which previously
+          lacked one
+        
+        
+        1.2.6 (2013-10-11)
+        ------------------
+        
+        README_fixt.py was not include in the release. Fix #54.
+        
+        
+        1.2.5 (2013-10-10)
+        ------------------
+        
+        cssselect compat. See https://github.com/SimonSapin/cssselect/pull/22
+        
+        tests improvments. no longer require a eth connection.
+        
+        fix #55
+        
         1.2.4
         -----
         
@@ -183,5 +233,5 @@ Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
 Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
diff --git a/README.rst b/README.rst
index d56fec9..a3e5238 100644
--- a/README.rst
+++ b/README.rst
@@ -9,11 +9,6 @@ This is not (or at least not yet) a library to produce or interact with
 javascript code. I just liked the jquery API and I missed it in python so I
 told myself "Hey let's make jquery in python". This is the result.
 
-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 a git repository on Github. 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.
@@ -36,8 +31,9 @@ document, from a file or from an url::
     >>> import urllib
     >>> d = pq("<html></html>")
     >>> d = pq(etree.fromstring("<html></html>"))
-    >>> d = pq(url='http://google.com/')
-    >>> # d = pq(url='http://google.com/', opener=lambda url, **kw: urllib.urlopen(url).read())
+    >>> d = pq(url=your_url)
+    >>> d = pq(url=your_url,
+    ...        opener=lambda url, **kw: urlopen(url).read())
     >>> d = pq(filename=path_to_html_file)
 
 Now d is like the $ in jquery::
diff --git a/README_fixt.py b/README_fixt.py
new file mode 100644
index 0000000..49775d0
--- /dev/null
+++ b/README_fixt.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+import os
+from webtest import http
+from webtest.debugapp import debug_app
+
+try:
+    from urllib import urlopen
+except ImportError:
+    from urllib.request import urlopen
+
+
+def setup_test(test):
+    server = http.StopableWSGIServer.create(debug_app)
+    server.wait()
+    path_to_html_file = os.path.join('tests', 'test.html')
+    test.globs.update(
+        urlopen=urlopen,
+        server=server,
+        your_url=server.application_url,
+        path_to_html_file=path_to_html_file,
+    )
+setup_test.__test__ = False
+
+
+def teardown_test(test):
+    test.globs['server'].shutdown()
+teardown_test.__test__ = False
diff --git a/buildout.cfg b/buildout.cfg
new file mode 100644
index 0000000..1c1ecea
--- /dev/null
+++ b/buildout.cfg
@@ -0,0 +1,37 @@
+[buildout]
+newest = false
+parts = py2 docs
+develop = .
+
+[py3]
+recipe = zc.recipe.egg
+eggs =
+    cssselect>0.7.9
+    WebOb>1.1.9
+    WebTest
+    pyquery
+    nose
+    coverage
+
+[py2]
+recipe = zc.recipe.egg
+eggs =
+    ${py3:eggs}
+    unittest2
+    BeautifulSoup
+    restkit
+
+
+[docs]
+recipe = zc.recipe.egg
+eggs =
+    ${py2:eggs}
+    Pygments
+    Sphinx
+    sphinx-pypi-upload
+interpreter = py
+scripts =
+    sphinx-build
+
+[tox]
+recipe = gp.recipe.tox
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..117b10d
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = ../bin/sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/chut.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/chut.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/chut"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/chut"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/_build/html/_sources/ajax.txt b/docs/_build/html/_sources/ajax.txt
deleted file mode 100644
index 30068fe..0000000
--- a/docs/_build/html/_sources/ajax.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-:mod:`pyquery.ajax` -- PyQuery AJAX extension
-=============================================
-
-.. automodule:: pyquery.ajax
-
-
-.. fake imports
-
-    >>> from ajax import PyQuery as pq
-
-You can query some wsgi app if `WebOb`_ is installed (it's not a pyquery
-dependencie). IN this example the test app returns a simple input at `/` and a
-submit button at `/submit`::
-
-    >>> d = pq('<form></form>', app=input_app)
-    >>> d.append(d.get('/'))
-    [<form>]
-    >>> print d
-    <form><input name="youyou" type="text" value=""/></form>
-
-The app is also available in new nodes::
-
-    >>> d.get('/').app is d.app is d('form').app
-    True
-
-You can also request another path::
-
-    >>> d.append(d.get('/submit'))
-    [<form>]
-    >>> print d
-    <form><input name="youyou" type="text" value=""/><input type="submit" value="OK"/></form>
-
-If `restkit`_ is installed, you are able to get url directly with a `HostProxy`_ app::
-
-    >>> a = d.get('http://packages.python.org/pyquery/')
-    >>> a
-    [<html>]
-
-You can retrieve the app response::
-
-    >>> print a.response.status
-    200 OK
-
-The response attribute is a `WebOb`_ `Response`_
-
-.. _webob: http://pythonpaste.org/webob/
-.. _response: http://pythonpaste.org/webob/#response
-.. _restkit: http://benoitc.github.com/restkit/
-.. _hostproxy: http://benoitc.github.com/restkit/wsgi_proxy.html
-
-Api
----
-
-.. autoclass:: PyQuery
-   :members:
-
diff --git a/docs/_build/html/_sources/api.txt b/docs/_build/html/_sources/api.txt
deleted file mode 100644
index 58dcf43..0000000
--- a/docs/_build/html/_sources/api.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-:mod:`~pyquery.pyquery` -- PyQuery complete API
-================================================
-
-.. automodule:: pyquery.pyquery
-
-.. autoclass:: PyQuery
-   :members:
-
-
diff --git a/docs/_build/html/_sources/scrap.txt b/docs/_build/html/_sources/scrap.txt
deleted file mode 100644
index 924f93f..0000000
--- a/docs/_build/html/_sources/scrap.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Scraping
-=========
-
-PyQuery is able to load html document from urls::
-
-  >>> pq('http://duckduckgo.com/')
-  [<html>]
-
-By default it use python's urllib.
-
-If `requests`_ is installed then it will use it. This allow you to use most of `requests`_ parameters::
-
-  >>> pq('http://duckduckgo.com/', headers={'user-agent': 'pyquery'})
-  [<html>]
-
-  >>> pq('https://duckduckgo.com/', {'q': 'foo'}, method='post', verify=True)
-  [<html>]
-
-.. _requests: http://docs.python-requests.org/en/latest/
diff --git a/docs/_build/html/_sources/tips.txt b/docs/_build/html/_sources/tips.txt
deleted file mode 100644
index 7e5aa6c..0000000
--- a/docs/_build/html/_sources/tips.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Tips
-====
-
-Making links absolute
----------------------
-
-You can make links absolute which can be usefull for screen scrapping::
-
-    >>> d = pq(url='http://duckduckgo.com/', parser='html')
-    >>> d('a[tabindex="-1"]').attr('href')
-    '/about.html'
-    >>> d.make_links_absolute()
-    [<html>]
-    >>> d('a[tabindex="-1"]').attr('href')
-    'http://duckduckgo.com/about.html'
-
-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 from lxml.html. The xml parser can sometimes be
-problematic when parsing xhtml pages because the parser will not raise an error
-but give an unusable tree (on w3c.org for example).
-
-You can also choose which parser to use explicitly::
-
-   >>> pq('<html><body><p>toto</p></body></html>', parser='xml')
-   [<html>]
-   >>> pq('<html><body><p>toto</p></body></html>', parser='html')
-   [<html>]
-   >>> pq('<html><body><p>toto</p></body></html>', parser='html_fragments')
-   [<p>]
-
-The html and html_fragments parser are the ones from lxml.html.
-
-
diff --git a/docs/ajax.txt b/docs/ajax.rst
similarity index 88%
rename from docs/ajax.txt
rename to docs/ajax.rst
index e80ab5b..3d57c7a 100644
--- a/docs/ajax.txt
+++ b/docs/ajax.rst
@@ -7,7 +7,7 @@
 
 .. fake imports
 
-    >>> from ajax import PyQuery as pq
+    >>> from pyquery.ajax import PyQuery as pq
 
 You can query some wsgi app if `WebOb`_ is installed (it's not a pyquery
 dependencie). IN this example the test app returns a simple input at `/` and a
@@ -16,7 +16,7 @@ submit button at `/submit`::
     >>> d = pq('<form></form>', app=input_app)
     >>> d.append(d.get('/'))
     [<form>]
-    >>> print d
+    >>> print(d)
     <form><input name="youyou" type="text" value=""/></form>
 
 The app is also available in new nodes::
@@ -28,18 +28,18 @@ You can also request another path::
 
     >>> d.append(d.get('/submit'))
     [<form>]
-    >>> print d
+    >>> print(d)
     <form><input name="youyou" type="text" value=""/><input type="submit" value="OK"/></form>
 
 If `restkit`_ is installed, you are able to get url directly with a `HostProxy`_ app::
 
-    >>> a = d.get('http://packages.python.org/pyquery/')
+    >>> a = d.get(your_url)
     >>> a
     [<html>]
 
 You can retrieve the app response::
 
-    >>> print a.response.status
+    >>> print(a.response.status)
     200 OK
 
 The response attribute is a `WebOb`_ `Response`_
diff --git a/docs/ajax_fixt.py b/docs/ajax_fixt.py
new file mode 100644
index 0000000..c2f639d
--- /dev/null
+++ b/docs/ajax_fixt.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+import os
+import sys
+sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
+from webtest import http
+from doctest import SKIP
+from tests.apps import input_app
+
+PY3 = sys.version_info >= (3,)
+
+
+def setup_test(test):
+    for example in test.examples:
+        # urlopen as moved in py3
+        if PY3:
+            example.options.setdefault(SKIP, 1)
+    if not PY3:
+        server = http.StopableWSGIServer.create(input_app)
+        server.wait()
+        path_to_html_file = os.path.join('tests', 'test.html')
+        test.globs.update(
+            input_app=input_app,
+            server=server,
+            your_url=server.application_url.rstrip('/') + '/html',
+            path_to_html_file=path_to_html_file,
+        )
+setup_test.__test__ = False
+
+
+def teardown_test(test):
+    if 'server' in test.globs:
+        test.globs['server'].shutdown()
+teardown_test.__test__ = False
diff --git a/docs/api.txt b/docs/api.rst
similarity index 100%
rename from docs/api.txt
rename to docs/api.rst
diff --git a/docs/_build/html/_sources/attributes.txt b/docs/attributes.rst
similarity index 92%
rename from docs/_build/html/_sources/attributes.txt
rename to docs/attributes.rst
index e249293..5020bf8 100644
--- a/docs/_build/html/_sources/attributes.txt
+++ b/docs/attributes.rst
@@ -1,6 +1,8 @@
 Attributes
 ----------
 
+..
+    >>> from pyquery import PyQuery as pq
 
 You can play with the attributes with the jquery API::
 
diff --git a/docs/attributes.txt b/docs/attributes.txt
deleted file mode 100644
index e249293..0000000
--- a/docs/attributes.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Attributes
-----------
-
-
-You can play with the attributes with the jquery API::
-
-    >>> p = pq('<p id="hello" class="hello"></p>')('p')
-    >>> p.attr("id")
-    'hello'
-    >>> p.attr("id", "plop")
-    [<p#plop.hello>]
-    >>> p.attr("id", "hello")
-    [<p#hello.hello>]
-
-
-Or in a more pythonic way::
-
-    >>> p.attr.id = "plop"
-    >>> p.attr.id
-    'plop'
-    >>> p.attr["id"] = "ola"
-    >>> p.attr["id"]
-    'ola'
-    >>> p.attr(id='hello', class_='hello2')
-    [<p#hello.hello2>]
-    >>> p.attr.class_
-    'hello2'
-    >>> p.attr.class_ = 'hello'
-
-
diff --git a/docs/_build/html/_sources/changes.txt b/docs/changes.rst
similarity index 100%
rename from docs/_build/html/_sources/changes.txt
rename to docs/changes.rst
diff --git a/docs/changes.txt b/docs/changes.txt
deleted file mode 100644
index 4a97d1e..0000000
--- a/docs/changes.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-News
-=====
-
-.. include:: ../CHANGES.rst
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100755
index 0000000..116711e
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,280 @@
+# -*- coding: utf-8 -*-
+#
+# pyquery documentation build configuration file, created by
+# sphinx-quickstart on Thu Nov  1 21:48:09 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'pyquery'
+copyright = u'2012, Olivier Lauzanne'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.3'
+# The full version, including alpha/beta/rc tags.
+release = '0.3'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'nature'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'pyquerydoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
... 3138 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyquery.git



More information about the Python-modules-commits mailing list