Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: third_party/pexpect/doc/api/replwrap.rst

Issue 1398903002: Add third_party/pexpect (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@end-to-end-test
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pexpect/doc/api/pxssh.rst ('k') | third_party/pexpect/doc/clean.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pexpect/doc/api/replwrap.rst
diff --git a/third_party/pexpect/doc/api/replwrap.rst b/third_party/pexpect/doc/api/replwrap.rst
new file mode 100644
index 0000000000000000000000000000000000000000..bf44a948db88f8af9b31e89452f3d1becbfb35e1
--- /dev/null
+++ b/third_party/pexpect/doc/api/replwrap.rst
@@ -0,0 +1,26 @@
+replwrap - Control read-eval-print-loops
+========================================
+
+.. automodule:: pexpect.replwrap
+
+.. versionadded:: 3.3
+
+.. autoclass:: REPLWrapper
+
+ .. automethod:: run_command
+
+.. data:: PEXPECT_PROMPT
+
+ A string that can be used as a prompt, and is unlikely to be found in output.
+
+Using the objects above, it is easy to wrap a REPL. For instance, to use a
+Python shell::
+
+ py = REPLWrapper("python", ">>> ", "import sys; sys.ps1={!r}; sys.ps2={!r}")
+ py.run_command("4+7")
+
+Convenience functions are provided for Python and bash shells:
+
+.. autofunction:: python
+
+.. autofunction:: bash
« no previous file with comments | « third_party/pexpect/doc/api/pxssh.rst ('k') | third_party/pexpect/doc/clean.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698