[Python-modules-commits] [nevow] 04/10: Import nevow_0.13.0.orig.tar.gz
Tristan Seligmann
mithrandi at moszumanska.debian.org
Wed Feb 17 14:57:46 UTC 2016
This is an automated email from the git hooks/post-receive script.
mithrandi pushed a commit to branch master
in repository nevow.
commit 643a8070e72d90f8ba76f8f0a008d85b9d489108
Author: Tristan Seligmann <mithrandi at debian.org>
Date: Wed Feb 17 16:43:52 2016 +0200
Import nevow_0.13.0.orig.tar.gz
---
PKG-INFO | 2 +-
doc/howto/deployment.rst | 155 +------
doc/howto/intro.rst | 3 -
doc/howto/traversal.rst | 9 +-
examples/examples.tac | 8 -
examples/index.html | 105 +----
examples/liveanimal/__init__.py | 0
examples/liveanimal/liveanimal.py | 120 -----
examples/liveanimal/liveanimal.tac | 13 -
examples/livepage/__init__.py | 0
examples/livepage/livepage.py | 25 -
examples/progress/__init__.py | 0
examples/progress/progress.py | 61 ---
examples/tests/testexamples.py | 194 --------
examples/tests/testformless.py | 105 -----
examples/wsgi/README | 2 -
examples/wsgi/test-cgi.py | 118 -----
examples/wsgi/test-modpy.py | 139 ------
examples/xul/__init__.py | 0
examples/xul/xul_example.xul | 38 --
examples/xul/xul_nevow.py | 30 --
nevow/__init__.py | 2 -
nevow/_version.py | 4 +-
nevow/appserver.py | 122 ++++-
nevow/compression.py | 2 +-
nevow/flat/flatstan.py | 12 -
nevow/guard.py | 6 +-
nevow/inevow.py | 10 +-
nevow/liveglue.js | 273 -----------
nevow/livepage.py | 906 -------------------------------------
nevow/livetest-postscripts.js | 49 --
nevow/livetest.css | 33 --
nevow/livetest.js | 35 --
nevow/livetest.py | 365 ---------------
nevow/rend.py | 2 +-
nevow/stan.py | 8 -
nevow/taglibrary/livetags.py | 93 ----
nevow/taglibrary/progressBar.css | 11 -
nevow/taglibrary/progressBar.js | 7 -
nevow/taglibrary/progressbar.py | 52 ---
nevow/taglibrary/tabbedPane.py | 69 +--
nevow/tags.py | 4 +-
nevow/test/test_appserver.py | 31 +-
nevow/test/test_athena.py | 8 +-
nevow/test/test_compression.py | 26 +-
nevow/test/test_guard.py | 40 +-
nevow/test/test_livepage.py | 353 ---------------
nevow/test/test_rend.py | 20 +
nevow/test/test_static.py | 80 ++--
nevow/test/test_tags.py | 21 -
nevow/test/test_testutil.py | 8 +-
nevow/testutil.py | 55 ++-
nevow/wsgi.py | 615 -------------------------
nevow/zomnesrv.py | 102 -----
setup.py | 170 +++----
zomne.c | 183 --------
56 files changed, 431 insertions(+), 4473 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index e9aaa58..6e00af0 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: Nevow
-Version: 0.12.0
+Version: 0.13.0
Summary: Web Application Construction Kit
Home-page: https://github.com/twisted/nevow
Author: Twisted Matrix Labs
diff --git a/doc/howto/deployment.rst b/doc/howto/deployment.rst
index 175d5ce..46697b4 100644
--- a/doc/howto/deployment.rst
+++ b/doc/howto/deployment.rst
@@ -51,72 +51,17 @@ not get any :doc:`traversal` features, and you
have to generate HTTP headers yourself. WSGI is a slightly higher-level
deployment option which does not suffer these problems.
-WSGI
-----
-
-WSGI is a python interface for plugging web applications into various
-HTTP server architectures. It is described in `PEP
-333 <http://www.python.org/peps/pep-0333.html>`__, the Python Web
-Services Gateway Interface Python Enhancement Proposal. Nevow includes
-the ``nevow.wsgi`` module, which includes a ``createWSGIApplication``
-function which takes a Page and returns a standard WSGI application
-callable. With the help of the ``run_with_cgi`` example gateway from the
-PEP (which I will omit here), our CGI example becomes shorter:
-
-.. code-block:: python
-
- #!/usr/bin/env python
-
- from nevow import rend, loaders, wsgi
-
- class HelloWorld(rend.Page):
- docFactory = loaders.stan("Hello, world!")
-
- run_with_cgi(wsgi.createWSGIApplication(HelloWorld()))
-
-
-Of course, you can use any available WSGI gateway to publish your
-application object, such as one of the gateways which comes with the
-`PEAK <http://peak.telecommunity.com/>`__ toolkit. For example, here is
-a simple python module which creates a WSGI application which we will
-then deploy with PEAK's SimpleHTTPServer gateway:
-
-.. code-block:: python
-
- ## helloworld.py
-
- from nevow import rend, loaders, wsgi
-
- class HelloWorld(rend.Page):
- docFactory = loaders.stan("Hello, world!")
-
- application = wsgi.createWSGIApplication(HelloWorld())
-
-
-Save this file as "helloworld.py" somewhere on your PYTHONPATH and then
-run the following command:
-
-::
-
- peak launch WSGI import:helloworld.application
-
-This will bring up a SimpleHTTPServer running your Nevow code and launch
-a web browser to view the output. (TODO: I couldn't get this working
-immediately but I will seek assistance with PEAK and update the
-instructions once I do.)
-
Twisted.Web
-----------
-A convenient and powerful way to deploy Nevow applications is inside a
-process running the twisted.web HTTP server. With Python, Twisted, and
-Nevow installed, you have all you need to run a Web Application, with no
-other dependencies or external HTTP servers such as Apache required.
-Running your Nevow applications under twisted.web also gives you access
-to some of the more advanced "Live" features of Nevow, such as
-``nevow.livepage`` and ``nevow.canvas``. Currently, these modules
-require more control over the HTTP socket than CGI or WSGI can provide.
-(This may change in the future.)
+A convenient and powerful way to deploy Nevow applications is inside a process
+running the twisted.web HTTP server. With Python, Twisted, and Nevow installed,
+you have all you need to run a Web Application, with no other dependencies or
+external HTTP servers such as Apache required. Running your Nevow applications
+under twisted.web also gives you access to some of the more advanced "Live"
+features of Nevow, such as ``nevow.athena``. Currently, these modules require
+more control over the HTTP socket than CGI can provide. (This may change in
+the future.)
Deploying a Nevow application under twisted.web requires a little more
boilerplate, but can be considerably easier to set up than other
@@ -150,88 +95,6 @@ Then visit your twisted.web server by viewing the url
more information about what twistd is capable of, including daemonizing
the HTTP server.
-Zomne
------
-
-*Warning* Zomne is experimental. It may blow up your computer and
-require your first born son as a sacrifice. Zomne also only works in
-UNIX-like environments where unix domain sockets are available, and may
-not work on windows.
-
-Zomne, or "Zombie Nevow", is a CGI written in C which can start up a
-long- running Application Server process if one is not already running.
-It then uses a simple custom protocol to transmit information about the
-HTTP request from the CGI process to the application server process.
-
-Zomne combines the ease of deployment of the CGI environment with the
-speed and flexibility of the twisted.web long-running application server
-process model.
-
-To use Zomne, you must first compile the CGI. cd into the directory
-created when unpacking the Nevow tarball, and compile the CGI:
-
-::
-
- % gcc zomne.c
-
-Move it into your cgi-bin:
-
-::
-
- % mv a.out /Library/WebServer/CGI-Executables/nevow.cgi
-
-Create a file which tells the cgi where to look for the application:
-
-::
-
- % cat > /Library/WebServer/CGI-Executables/.nevow.cgi.dir
- /Users/dp/zomne-test
- ^D
-
-The CGI name can be anything, as long as there is a file with a
-prepended "." and a postfixed ".dir" in the same directory which
-contains the full path of a zomne application directory. Next, create
-the application directory:
-
-::
-
- mkdir /Users/dp/zomne-test
-
-Finally, create the zomne.tac file which the zomne.cgi will execute to
-start the long-running application server process:
-
-.. code-block:: python
-
- from nevow import rend, loaders, zomnesrv
-
- class HelloWorld(rend.Page):
- docFactory = loaders.stan("Hello, world!")
-
- from twisted.application import service, internet
- application = service.Application('nevow-zomne-test')
- internet.UNIXServer('zomne.socket', zomnesrv.ZomneFactory(HelloWorld())).setServiceParent(application)
-
-
-Now, visiting the nevow.cgi URL through the web should render the Hello
-World page, after a pause while the server is starting up. Subsequent
-requests should be very fast, because the application server is already
-running, and the CGI merely has to forward the request to it.
-
-Another useful capability of the zomne CGI process is the ability to
-control environment variables the CGI will use. Create a directory named
-"zomne\_environ" in the application directory, and fill it with text
-files whose name will be the environment key and whose contents will be
-the environment value:
-
-::
-
- % cd zomne-test
- % mkdir zomne-environ
- % cd zomne-environ
- % cat > PYTHONPATH
- /Users/dp/Projects/Nevow:/Users/dp/Projects/helloworld
- ^D
-
Conclusion
----------
@@ -241,7 +104,7 @@ try out the Nevow templating mechanism, but can be slow. A long-running
application server process can be a good way to get good performance as
well as additional features such as in-memory server-side sessions,
advanced automatic form handling with formless, and live page updating
-features such as nevow.livepage and nevow.canvas.
+features such as nevow.athena.
Which deployment option you choose will depend on the amount of control
you have over your deployment environment, and what advanced features
diff --git a/doc/howto/intro.rst b/doc/howto/intro.rst
index 3a4c217..195f00e 100644
--- a/doc/howto/intro.rst
+++ b/doc/howto/intro.rst
@@ -25,9 +25,6 @@ web solution:
- formless.webform: For rendering web forms based on formless type
descriptions, accepting form posts and passing them to formless
validators, and rendering error forms in the event validation fails
-- livepage: Cross-browser JavaScript glue for sending client side
- events to the server and server side events to the client after the
- page has loaded, without causing the entire page to refresh
Disk based templates
--------------------
diff --git a/doc/howto/traversal.rst b/doc/howto/traversal.rst
index 5891e68..94d4989 100644
--- a/doc/howto/traversal.rst
+++ b/doc/howto/traversal.rst
@@ -50,12 +50,11 @@ over a very simple root resource:
return "Hello, world!"
-This resource, when passed as the root resource to
-``appserver.NevowSite`` or ``wsgi.createWSGIApplication``, will
-immediately return itself, consuming all path segments. This means that
+This resource, when passed as the root resource to ``appserver.NevowSite``,
+will immediately return itself, consuming all path segments. This means that
for every URI a user visits on a web server which is serving this root
-resource, the text ``"Hello, world!"`` will be rendered. Let's examine
-the value of ``segments`` for various values of URI:
+resource, the text ``"Hello, world!"`` will be rendered. Let's examine the
+value of ``segments`` for various values of URI:
- ``/`` - ``('',)``
- ``/foo/bar`` - ``('foo', 'bar')``
diff --git a/examples/examples.tac b/examples/examples.tac
index e3fa6e7..6656c36 100644
--- a/examples/examples.tac
+++ b/examples/examples.tac
@@ -58,8 +58,6 @@ try:
from cal import cal
from tabbed import tabbed
from progress import progress
- from tests import testformless, testexamples
- from nevow import livetest
from athenademo import calculator
from athenademo import typeahead
@@ -162,12 +160,6 @@ class Examples(rend.Page):
calendar=cal.Calendar(),
tabbed=tabbed.TabbedPage(),
progress=progress.createResource(),
- tests=testexamples.createResource(),
- livetests=testexamples.createLiveSuite(),
- testtests=livetest.createResource(),
- testformless=testformless.NameWizard(),
- formless_redirector=testformless.Redirector(),
- formless_tests=testformless.formless_tests,
fragments=fragments.Root(),
macros=macros.Root(),
typeahead=typeahead.DataEntry(),
diff --git a/examples/index.html b/examples/index.html
index 3b9120d..1ac7268 100644
--- a/examples/index.html
+++ b/examples/index.html
@@ -50,36 +50,11 @@
<li><a href="#examples">Examples</a></li>
- <li><a href="#livepage">LivePage/Canvas/XUL</a></li>
-
<li><a href="#taglibrary">Tag Library Examples</a></li>
<li><a href="#demoapp">Demo Applications</a></li>
</ol>
- <h1 id="tests">Test Suite</h1>
-
- <p>Nevow 0.4 now includes a live test runner which operates
- inside of your web browser. The test runner currently operates
- only under Firefox, and not IE or Safari. This will be fixed in
- a future release. Test suites for some of the examples provided
- here have been written. The following test suites may be
- executed by visiting their respective pages:</p>
-
- <ol>
- <li><a href="/tests/">Run basic tests</a></li>
-
- <li><a href="/formless_tests/">Run formless tests</a></li>
-
- <li><a href="/livetests/">Run livepage example tests</a></li>
-
- <li><a href="/testtests/tests/">Test test harness</a></li>
- </ol>
-
- <p>Athena also has <a href="/athenatest/">some tests</a>, although
- there is not yet a fancy test runner like the one demonstrated
- above.</p>
-
<h1 id="examples">Examples Listing</h1>
<ol>
@@ -758,24 +733,6 @@
<ul>
<li>
- <span>LiveAnimal: A small LivePage game</span>
-
- <div class="source">
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td>Python Source</td>
-
- <td width="100%"><a href=
- "sources/liveanimal/liveanimal.py">liveanimal.py</a></td>
- </tr>
- </tbody>
- </table>Live example: <a href=
- "liveanimal/">liveanimal</a>
- </div>
- </li>
-
- <li>
<span>TypeAhead: Using asynchronous remote method invocation from
JavaScript to complete what the user is typing.
</span>
@@ -821,7 +778,7 @@
methods for manipulating particular sections of a page's DOM, as
well as communicating in both directions between the client and
server.</span>
-
+
<div class="source">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
@@ -838,46 +795,6 @@
</div>
</li>
- <li>
- <span>Integration between Flash(TM) and Nevow</span>
-
- <div class="source">
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td>Stan Source</td>
-
- <td width="100%"><a href=
- "sources/canvas/canvas.py">canvas.py</a></td>
- </tr>
- </tbody>
- </table>Live example: <a href="canvas/">canvas</a>
- </div>
- </li>
-
- <li>
- <span>Integration between XUL and Nevow</span>
-
- <div class="source">
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td>Stan Source</td>
-
- <td width="100%"><a href=
- "sources/xul/xul_nevow.py">xul_nevow.py</a></td>
- </tr>
-
- <tr>
- <td>XUL Source</td>
-
- <td width="100%"><a href=
- "sources/xul/xul_example.xul">xul_example.xul</a></td>
- </tr>
- </tbody>
- </table>Live example: <a href="xul_nevow/">xul_nevow</a>
- </div>
- </li>
</ul>
<h1 id="taglibrary">Tag Library Examples</h1>
@@ -901,26 +818,6 @@
</table>Live example: <a href="calendar/">calendar</a>
</div>
</li>
-
- <li>
- <span>How to use the TabbedPane tag from the
- taglibrary</span>
-
- <div class="source">
- <table border="0" cellpadding="0" cellspacing="0" width=
- "100%">
- <tbody>
- <tr>
- <td>Stan Source</td>
-
- <td width="100%"><a href=
- "sources/tabbed/tabbed.py">tabbed.py</a></td>
- </tr>
- </tbody>
- </table>Live example: <a href="tabbed/">tabbed</a>
- </div>
- </li>
-
<li>
<span>How to use the Progressbar tag from the
taglibrary</span>
diff --git a/examples/liveanimal/__init__.py b/examples/liveanimal/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/liveanimal/liveanimal.py b/examples/liveanimal/liveanimal.py
deleted file mode 100644
index 834ca42..0000000
--- a/examples/liveanimal/liveanimal.py
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-import atexit, pickle
-from nevow import loaders, tags, livepage, inevow
-
-
-class node:
- def __init__(self, question, positive=None, negative=None):
- self.question = question
- self.positive = positive
- self.negative = negative
-
- def clone(self):
- return self.__class__(**vars(self))
-
- def isLeaf(self):
- return not (self.positive or self.negative)
-
-
-win = 'winnar'
-lose = lambda: node("I give up. What is the animal, and what question describes it?")
-
-
-def guess(animal):
- return node("Is it " + animal + "?", win, lose())
-
-
-try:
- knowledge = pickle.load(file('knowledge', 'rb'))
-except:
- knowledge = lose()
-atexit.register(lambda: pickle.dump(knowledge, file('knowledge', 'wb')))
-
-
-class AnimalPage(livepage.LivePage):
- addSlash = True
- def locateChild(self, ctx, segments):
- if ctx.arg('fresh') is not None:
- global knowledge
- knowledge = lose()
- return super(AnimalPage, self).locateChild(ctx, segments)
-
- def goingLive(self, ctx, client):
- client.oldNode = knowledge
- client.node = knowledge
- client.send(self.handle_updateDom(ctx))
-
- docFactory = loaders.stan(
- tags.html[
- tags.head[
- tags.directive('liveglue')],
- tags.body[
- tags.h1["Live Animal"],
- tags.div(id='question')[""],
- tags.div(id='answer-inputs')[
- tags.form(
- name='new-question',
- pattern="leaf",
- onsubmit=[
- livepage.server.handle(
- 'newquestion',
- livepage.get('animal').value,
- livepage.get('new-question').value),
- livepage.stop])[
- tags.input(name='animal', id='animal'),
- tags.input(name='new-question', id='new-question'),
- tags.button['Submit']],
- tags.invisible(pattern='branch')[
- tags.button(
- id="yes-response",
- onclick=livepage.server.handle('positiveResponse'))['Yes'],
- tags.button(
- id="no-response",
- onclick=livepage.server.handle('negativeResponse'))['No']]]]])
-
- def handle_updateDom(self, ctx):
- client = livepage.IClientHandle(ctx)
- yield livepage.set('question', client.node.question), livepage.eol
- if client.node.isLeaf():
- yield livepage.set('answer-inputs', inevow.IQ(AnimalPage.docFactory).onePattern('leaf')), livepage.eol
- else:
- yield livepage.set('answer-inputs', inevow.IQ(AnimalPage.docFactory).onePattern('branch')), livepage.eol
-
- def handle_newquestion(self, ctx, animal, question):
- client = livepage.IClientHandle(ctx)
- newNegative = client.oldNode.clone()
-
- client.oldNode.question = question
- client.oldNode.positive = guess(animal)
- client.oldNode.negative = newNegative
-
- client.node = knowledge
- return self.handle_updateDom(ctx)
-
- def handle_positiveResponse(self, ctx):
- client = livepage.IClientHandle(ctx)
- client.oldNode = client.node
- client.node = client.node.positive
- if client.node == win:
- client.node = knowledge
- yield livepage.set('question', "I win!"), livepage.eol
- yield livepage.set(
- 'answer-inputs',
- tags.button(
- id="start-over",
- onclick=livepage.server.handle('updateDom'))["Start over"]), livepage.eol
- else:
- yield self.handle_updateDom(ctx), livepage.eol
-
- def handle_negativeResponse(self, ctx):
- client = livepage.IClientHandle(ctx)
- client.oldNode = client.node
- client.node = client.node.negative
- return self.handle_updateDom(ctx)
-
-
-def createResource():
- return AnimalPage()
-
-
diff --git a/examples/liveanimal/liveanimal.tac b/examples/liveanimal/liveanimal.tac
deleted file mode 100644
index d2fd93e..0000000
--- a/examples/liveanimal/liveanimal.tac
+++ /dev/null
@@ -1,13 +0,0 @@
-
-from nevow.appserver import NevowSite
-from liveanimal import createResource
-
-from twisted.application import service, internet
-
-application = service.Application('HADHF')
-internet.TCPServer(
- 4242,
- NevowSite(
- createResource(),
- logPath="web.log")
-).setServiceParent(application)
diff --git a/examples/livepage/__init__.py b/examples/livepage/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/livepage/livepage.py b/examples/livepage/livepage.py
deleted file mode 100644
index 6073305..0000000
--- a/examples/livepage/livepage.py
+++ /dev/null
@@ -1,25 +0,0 @@
-"""
-A short LivePage server. Text inputted into the input box on the page is
-routed to the server, and the server echoes it back in an alert box.
-"""
-
-from twisted.internet import reactor
-
-from nevow import livepage, tags, loaders, appserver
-
-class LiveExamplePage(livepage.LivePage):
- docFactory = loaders.stan(
- tags.html[
- tags.head[
- livepage.glue],
- tags.body[
- tags.input(
- type="text",
- onchange="server.handle('change', this.value)")]])
-
- def handle_change(self, ctx, value):
- return livepage.alert(value)
-
-site = appserver.NevowSite(LiveExamplePage())
-reactor.listenTCP(8080, site)
-reactor.run()
diff --git a/examples/progress/__init__.py b/examples/progress/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/progress/progress.py b/examples/progress/progress.py
deleted file mode 100644
index 90174d4..0000000
--- a/examples/progress/progress.py
+++ /dev/null
@@ -1,61 +0,0 @@
-from twisted.internet import task
-from nevow import loaders, livepage, tags as t
-from nevow.taglibrary.livetags import component, componentGlue
-from nevow.taglibrary.progressbar import progressBar, progressBarGlue
-
-
-class Progressbar(livepage.LivePage):
- addSlash = True
-
- progress = {
- 'bar1': 0,
- 'bar2': 20,
- 'bar3': 30,
- 'bar4': 50,
- }
-
- def data_bar1(self, ctx, data):
- return { 'name': 'bar1' }
- def data_bar2(self, ctx, data):
- return { 'name': 'bar2', 'percent': self.progress['bar2'] }
- def data_bar3(self, ctx, data):
- return { 'name': 'bar3', 'percent': self.progress['bar3'] }
- def data_bar4(self, ctx, data):
- return { 'name': 'bar4', 'percent': self.progress['bar4'] }
-
- def goingLive(self, ctx, client):
- self.progress = self.progress.copy()
-
- def handle_click(self, ctx, value):
- def send():
- if self.progress[value] >= 100:
- t.stop()
- else:
- self.progress[value] += 1
- livepage.IClientHandle(ctx).send(component[value].setPercent(str(self.progress[value])))
- t = task.LoopingCall(send)
- t.start(1)
-
- docFactory = loaders.stan(
- t.html[
- t.head[
- t.title["ProgressBar Example"],
- livepage.glue,
- componentGlue.inlineGlue,
- progressBarGlue.inlineGlue,
- ],
- t.body[
- t.invisible(data=t.directive('bar1'), render=progressBar),
- t.p[ t.a(href="", onclick=[livepage.server.handle('click', 'bar1'), livepage.stop])['Start meter'] ],
- t.invisible(data=t.directive('bar2'), render=progressBar),
- t.p[ t.a(href="", onclick=[livepage.server.handle('click', 'bar2'), livepage.stop])['Start meter'] ],
- t.invisible(data=t.directive('bar3'), render=progressBar),
- t.p[ t.a(href="", onclick=[livepage.server.handle('click', 'bar3'), livepage.stop])['Start meter'] ],
- t.invisible(data=t.directive('bar4'), render=progressBar),
- t.p[ t.a(href="", onclick=[livepage.server.handle('click', 'bar4'), livepage.stop])['Start meter'] ],
- ]
- ]
- )
-
-def createResource():
- return Progressbar()
diff --git a/examples/tests/testexamples.py b/examples/tests/testexamples.py
deleted file mode 100644
index df25955..0000000
--- a/examples/tests/testexamples.py
+++ /dev/null
@@ -1,194 +0,0 @@
-from nevow import livetest
-
-
-all_suites = dict(
- most_basic=[
- ('visit', '/most_basic/', ''),
- ('assert', 'foo', 'foo'),
- ('follow', 'foo', ''),
- ('assert', 'heading', 'You are in Foo'),
- ('follow', 'baz', ''),
- ('assert', 'heading', 'You are in Baz')],
- hellostan=[
- ('visit', '/hellostan/', ''),
- ('assert', 'body', 'Welcome to the wonderful world of Nevow!')],
- hellohtml=[
- ('visit', '/hellohtml/', ''),
- ('assert', 'body', 'Welcome to the wonderful world of Nevow!')],
- simple=[
- ('visit', '/simple/', ''),
- ('assert', 'count', '1'),
- ('visit', '/simple/', ''),
- ('assert', 'count', '2'),
- ('visit', '/simple/reset', ''),
- ('assert', 'reset', 'Count reset')],
- simplehtml=[
- ('visit', '/simplehtml/', ''),
- ('assert', 'count', '1'),
- ('visit', '/simplehtml/', ''),
- ('assert', 'count', '2'),
- ('visit', '/simplehtml/reset', ''),
- ('assert', 'reset', 'Count reset')],
- tables=[
- ('visit', '/tablehtml/', ''),
- ('assert', 'firstHeader', 'First Column'),
- ('assert', 'secondHeader', 'Second Column'),
- ('assert', 'firstFooter', 'First Footer'),
- ('assert', 'secondFooter', 'Second Footer')],
- disktemplates_stan=[
- ('visit', '/disktemplates_stan/', ''),
- ('assert', 'header', 'Welcome')],
- disktemplates=[
- ('visit', '/disktemplates/', ''),
- ('assert', 'header', 'Welcome')],
- children=[
- ('visit', '/children/', ''),
- ('follow', 'foo', ''),
- ('assert', 'name', 'foo'),
- ('follow', 'child', ''),
- ('assert', 'parentName', 'foo'),
- ('visit', '/children/', ''),
- ('follow', 'bar', ''),
- ('assert', 'name', 'bar'),
- ('follow', 'child', ''),
- ('assert', 'parentName', 'bar'),
- ('visit', '/children/', ''),
- ('follow', 'd1', ''),
- ('assert', 'name', '1'),
- ('follow', 'child', ''),
- ('assert', 'parentName', '1'),
- ('visit', '/children/', ''),
- ('follow', 'd2', ''),
- ('assert', 'name', '2'),
- ('follow', 'child', ''),
- ('assert', 'parentName', '2'),
- ('visit', '/children/', ''),
- ('follow', 'd3', ''),
- ('assert', 'name', '3'),
- ('follow', 'child', ''),
- ('assert', 'parentName', '3'),
- ('visit', '/children/', ''),
- ('follow', 'd4', ''),
- ('assert', 'name', '4'),
- ('visit', '/children/', ''),
- ('follow', 'd5', ''),
- ('assert', 'name', '5'),
- ('visit', '/children/', ''),
- ('follow', 'd6/7', ''),
- ('assert', 'name', '6/7')],
- objcontainer=[
- ('visit', '/objcontainer/', ''),
- ],
- manualform=[
- ('visit', '/manualform/', ''),
- ],
- advanced_manualform=[
- ('visit', '/advanced_manualform/', ''),
- ],
- formpost=[
- ('visit', '/formpost/', ''),
- ],
- formpost2=[
- ('visit', '/formpost2/', ''),
- ],
- db=[
- ('visit', '/db/', ''),
- ],
- http_auth=[
- ('visit', '/http_auth/', ''),
- ],
- guarded=[
- ('visit', '/guarded/', ''),
- ],
- guarded2=[
- ('visit', '/guarded2/', ''),
- ],
- logout_guard=[
- ('visit', '/logout_guard/', ''),
- ],
- logout_guard2=[
- ('visit', '/logout_guard2/', ''),
- ],
- customform=[
- ('visit', '/customform/', ''),
- ],
- formbuilder=[
- ('visit', '/formbuilder/', ''),
- ],
- simple_irenderer=[
- ('visit', '/simple_irenderer/', ''),
- ],
- irenderer=[
- ('visit', '/irenderer/', ''),
- ],
- tree=[
- ('visit', '/tree/', ''),
- ],
- i18n=[
- ('visit', '/i18n/', ''),
- ],
- xmli18n=[
- ('visit', '/xmli18n/', ''),
- ],
- # Tag Library Examples
- calendar=[
- ('visit', '/calendar/', ''),
- ],
- tabbed=[
- ('visit', '/tabbed/', ''),
- ],
- progress=[
- ('visit', '/progress/', ''),
- ],
- ## TODO: There are many more tests to be written here, but it is boring
-)
-
-live_suites = dict(
- ## Now the fun stuff: The livepage example tests.
-liveanimal=[
- ('visit', '/liveanimal/?fresh=true', ''),
- ('assert', 'question', 'I give up. What is the animal, and what question describes it?'),
- ('submit', 'new-question', {'animal': "Monkey", 'new-question': 'is it crazy'}),
- ('assert', 'question', 'is it crazy'),
- ('click', 'yes-response', ''),
- ('assert', 'question', 'Is it Monkey?'),
- ('click', 'no-response', ''),
- ('assert', 'question', 'I give up. What is the animal, and what question describes it?'),
- ('submit', 'new-question', {'animal': 'Mongoose', 'new-question': 'does it eat snakes'}),
- ('assert', 'question', 'is it crazy'),
- ('click', 'yes-response', ''),
- ('assert', 'question', 'does it eat snakes'),
- ('click', 'yes-response', ''),
- ('assert', 'question', 'Is it Mongoose?'),
- ('click', 'yes-response', ''),
- ('assert', 'question', 'I win!'),
- ('click', 'start-over', ''),
- ('assert', 'question', 'is it crazy')
- ],
-#chatola=[
-# ('visit', '/chatola/', ''),
-# ('submit', 'topicform', {'change-topic': 'Hello, world!'}),
-# ('submit', 'inputform', {'inputline': 'Greetings humans of earth'}),
-# ('submit', 'inputform', {'inputline': 'Take me to your leader'}),
-#]
-)
-
-
-
-def createResource(whichOne=None):
- if whichOne is None:
- suite = []
- for subsuite in all_suites.values():
- suite.extend(subsuite)
- return livetest.Tester(suite)
-
- return livetest.Tester(all_suites[whichOne])
-
-
-def createLiveSuite(whichOne=None):
- suite = []
- for subsuite in live_suites.values():
- suite.extend(subsuite)
- return livetest.Tester(suite)
-
-
diff --git a/examples/tests/testformless.py b/examples/tests/testformless.py
deleted file mode 100644
index b0feeb1..0000000
--- a/examples/tests/testformless.py
+++ /dev/null
@@ -1,105 +0,0 @@
-
-from twisted.internet import defer
-
-from formless import annotate, webform
-
-from nevow import rend, loaders, tags, livetest, url, livepage
-
-
-"""WWWWizard functionality!
-"""
-
-
-test_suite = [
- ('visit', '/formpost/', ''),
- ('value', 'foo-foo', '5'),
- ('post', 'foo', {'foo-foo': 'asdf'}),
- ('assert', livetest.xpath('//form[@id="foo"]//div[@class="freeform-form-error"]'), "'asdf' is not an integer."),
- ## Check to make sure we repopulate the user's input with the erronious input
- ('value', 'foo-foo', 'asdf'),
- ('post', 'foo', {'foo-foo': '10'}),
- ('value', 'foo-foo', '10'),
- ]
-
-
-test_suite += [
- ('visit', '/formpost2/', ''),
- ('post', 'bar', {'bar-baz': '5', 'bar-slam': '5', 'bar-ham': 'efgh', 'bar-custom': '1'}),
- ## XXX TODO: Can't post a radio button, so there is "None" below
- ('assert', livetest.xpath('//h3'), "You called bar! 5 5 efgh None {'stuff': 1234, 'name': 'One'}")
-]
-
-test_suite += [
- ('visit', '/testformless', ''),
- ('post', 'name', {'name-name': 'Fred'}),
- ('post', 'quest', {'quest-quest': 'Find the Grail'}),
- ('post', 'speed', {'speed-speed': '123'}),
- ('assert', 'body', "Thanks for taking our survey! You said: 'Fred' 'Find the Grail' 123")]
-
-
-class NameWizard(rend.Page):
- docFactory = loaders.stan(tags.html[tags.h1["What is your name"], webform.renderForms()])
-
- def bind_name(self, ctx):
- return [('name', annotate.String())]
-
- def name(self, name):
- return QuestWizard(name)
-
-
-class QuestWizard(rend.Page):
- docFactory = loaders.stan(tags.html[tags.h1["What is your quest"], webform.renderForms()])
-
- def bind_quest(self, ctx):
- return [('quest', annotate.Choice(['Find the Grail', 'Get laid', 'Earn twenty bucks', 'Destroy the sun']))]
-
- def quest(self, quest):
- return FinalWizard((self.original, quest))
-
-
-class FinalWizard(rend.Page):
- docFactory = loaders.stan(tags.html[tags.h1["What is the airspeed velocity of an unladen swallow"], webform.renderForms()])
-
- def bind_speed(self, ctx):
- return [('speed', annotate.Integer())]
-
- def speed(self, speed):
- return rend.Page(
- docFactory=loaders.stan(
- tags.html[
- tags.body(id='body')[
- "Thanks for taking our survey! You said: %r %r %r" % (
- self.original[0], self.original[1], speed)]]))
-
... 4836 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/nevow.git
More information about the Python-modules-commits
mailing list