run(input=sys.stdout,
output=sys.stdout)
|
|
CouchDB view function handler implementation for Python.
>>> from StringIO import StringIO
>>> output = StringIO()
>>> run(input=StringIO('["reset"]\n'), output=output)
>>> print output.getvalue()
true
<BLANKLINE>
>>> output = StringIO()
>>> run(input=StringIO('["add_fun", "def fun(doc): yield None, doc"]\n'),
... output=output)
>>> print output.getvalue()
true
<BLANKLINE>
>>> output = StringIO()
>>> run(input=StringIO('["add_fun", "def fun(doc): yield None, doc"]\n'
... '["map_doc", {"foo": "bar"}]\n'),
... output=output)
>>> print output.getvalue()
true
[[[null, {"foo": "bar"}]]]
<BLANKLINE>
- Parameters:
input - the readable file-like object to read input from
output - the writable file-like object to write output to
|