diff --git a/.sources/make b/.sources/make index e0e9d2cc0..1c8b1d695 100755 --- a/.sources/make +++ b/.sources/make @@ -1,4 +1,5 @@ #!/bin/sh -pygmentize -f html ./examples_context.py > ../libpathod/templates/examples_context.html -pygmentize -f html ./examples_setup.py > ../libpathod/templates/examples_setup.html -pygmentize -f html ./examples_setupall.py > ../libpathod/templates/examples_setupall.html +pygmentize -f html ../examples/test_context.py > ../libpathod/templates/examples_context.html +pygmentize -f html ../examples/test_setup.py > ../libpathod/templates/examples_setup.html +pygmentize -f html ../examples/test_setupall.py > ../libpathod/templates/examples_setupall.html +pygmentize -f html ../examples/libpathod_pathoc.py > ../libpathod/templates/libpathod_pathoc.html diff --git a/examples/pathoc.py b/examples/libpathod_pathoc.py old mode 100755 new mode 100644 similarity index 81% rename from examples/pathoc.py rename to examples/libpathod_pathoc.py index 4c3fae52d..ca53b08f7 --- a/examples/pathoc.py +++ b/examples/libpathod_pathoc.py @@ -4,3 +4,4 @@ from libpathod import pathoc p = pathoc.Pathoc("google.com", 80) p.connect() print p.request("get:/") +print p.request("get:/foo") diff --git a/.sources/examples_context.py b/examples/test_context.py similarity index 100% rename from .sources/examples_context.py rename to examples/test_context.py diff --git a/.sources/examples_setup.py b/examples/test_setup.py similarity index 87% rename from .sources/examples_setup.py rename to examples/test_setup.py index 5366c9ef1..2918a4dd3 100644 --- a/.sources/examples_setup.py +++ b/examples/test_setup.py @@ -3,8 +3,8 @@ from libpathod import test class Test: """ - Testing the requests module with - a pathod instance started for + Testing the requests module with + a pathod instance started for each test. """ def setUp(self): diff --git a/.sources/examples_setupall.py b/examples/test_setupall.py similarity index 100% rename from .sources/examples_setupall.py rename to examples/test_setupall.py diff --git a/libpathod/templates/docs_libpathod.html b/libpathod/templates/docs_libpathod.html index 8d51ebba6..aa404eed2 100644 --- a/libpathod/templates/docs_libpathod.html +++ b/libpathod/templates/docs_libpathod.html @@ -1,7 +1,27 @@ {% extends "frame.html" %} {% block body %} -Foo + +
+
+ +

Behind the pathod and pathoc command-line tools lurks + libpathod, a powerful library for manipulating and serving HTTP + requests and responses. The canonical documentation for the library is + in the code, and can be accessed using pydoc.

+ +
+
+

pathoc

+ + {% include "libpathod_pathoc.html" %} +
+
{% endblock %} diff --git a/libpathod/templates/examples_setup.html b/libpathod/templates/examples_setup.html index bde458408..b80ad3796 100644 --- a/libpathod/templates/examples_setup.html +++ b/libpathod/templates/examples_setup.html @@ -3,8 +3,8 @@ class Test: """ - Testing the requests module with - a pathod instance started for + Testing the requests module with + a pathod instance started for each test. """ def setUp(self): diff --git a/libpathod/templates/index.html b/libpathod/templates/index.html index 9561fee1f..4b52b6a5f 100644 --- a/libpathod/templates/index.html +++ b/libpathod/templates/index.html @@ -66,26 +66,4 @@ - -
-
-
-

libpathod.test

- -

Using pathod in your unit tests.

- -
-
-
-
-

libpathod.test

- -

Using pathod in your unit tests.

- - {% include "examples_context.html" %} - -
-
-
- {% endblock %} diff --git a/libpathod/templates/libpathod_pathoc.html b/libpathod/templates/libpathod_pathoc.html new file mode 100644 index 000000000..f2737c019 --- /dev/null +++ b/libpathod/templates/libpathod_pathoc.html @@ -0,0 +1,7 @@ +
#!/usr/bin/env python
+from libpathod import pathoc
+
+p = pathoc.Pathoc("google.com", 80)
+p.connect()
+print p.request("get:/")
+