summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2015-08-21 23:15:45 +0200
committerChris Liechti <cliechti@gmx.net>2015-08-21 23:15:45 +0200
commit876801a5c65e097b31b6824e055a0e99bcdc595e (patch)
tree6d812e5758381f07ee0c4621a91b700aa16cb0cb
parentd14b1ab6ecdf39020c7a2f6a1efee1c21254d176 (diff)
downloadpyserial-git-876801a5c65e097b31b6824e055a0e99bcdc595e.tar.gz
spy: rename parameter dev -> file
-rw-r--r--documentation/pyserial_api.rst6
-rw-r--r--serial/urlhandler/protocol_spy.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/documentation/pyserial_api.rst b/documentation/pyserial_api.rst
index c32cece..692c65e 100644
--- a/documentation/pyserial_api.rst
+++ b/documentation/pyserial_api.rst
@@ -909,7 +909,7 @@ possible for the user to add protocol handlers using
Supported options in the URL are:
- - ``dev=FILENAME`` output to given file or device instead of stderr
+ - ``file=FILENAME`` output to given file or device instead of stderr
- ``color`` enable ANSI escape sequences to colorize output
- ``raw`` output the read and written data directly (default is to create a
hex dump). In this mode, no control line and other commands are logged.
@@ -918,7 +918,7 @@ possible for the user to add protocol handlers using
import serial
- with serial.serial_for_url('spy:///dev/ttyUSB0?dev=test.txt', timeout=1) as s:
+ with serial.serial_for_url('spy:///dev/ttyUSB0?file=test.txt', timeout=1) as s:
s.setDTR(False)
s.write('hello world')
s.read(20)
@@ -983,7 +983,7 @@ Examples:
- ``socket://localhost:7777``
- ``loop://?logging=debug``
- ``hwgrep://0451:f432`` (USB VID:PID)
-- ``spy://COM54?dev=log.txt``
+- ``spy://COM54?file=log.txt``
Tools
=====
diff --git a/serial/urlhandler/protocol_spy.py b/serial/urlhandler/protocol_spy.py
index d6ed458..c06d9c0 100644
--- a/serial/urlhandler/protocol_spy.py
+++ b/serial/urlhandler/protocol_spy.py
@@ -167,7 +167,7 @@ class Serial(serial.Serial):
output = sys.stderr
try:
for option, values in urlparse.parse_qs(parts.query, True).items():
- if option == 'dev':
+ if option == 'file':
output = open(values[0], 'w')
elif option == 'color':
color = True