diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2012-02-20 01:52:38 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2012-02-20 01:52:38 +0000 |
commit | 096e196aeedf7bf45370739800f01680c1e1ab75 (patch) | |
tree | de85f81fcb490719e15dcc6818c99ba9a6b3f503 /pyserial/serial/tools | |
parent | 065080d4274c2137ada562fb66827e686623a75f (diff) | |
download | pyserial-git-096e196aeedf7bf45370739800f01680c1e1ab75.tar.gz |
allow to override command line default parameters by putting them into globals
Diffstat (limited to 'pyserial/serial/tools')
-rw-r--r-- | pyserial/serial/tools/miniterm.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pyserial/serial/tools/miniterm.py b/pyserial/serial/tools/miniterm.py index 5d794fa..2cdc497 100644 --- a/pyserial/serial/tools/miniterm.py +++ b/pyserial/serial/tools/miniterm.py @@ -13,6 +13,11 @@ import sys, os, serial, threading EXITCHARCTER = '\x1d' # GS/CTRL+] MENUCHARACTER = '\x14' # Menu: CTRL+T +DEFAULT_PORT = None +DEFAULT_BAUDRATE = 9600 +DEFAULT_RTS = None +DEFAULT_DTR = None + def key_description(character): """generate a readable description for a key""" @@ -447,7 +452,7 @@ def main(): parser.add_option("-p", "--port", dest = "port", help = "port, a number or a device name. (deprecated option, use parameter instead)", - default = None + default = DEFAULT_PORT ) parser.add_option("-b", "--baud", @@ -455,7 +460,7 @@ def main(): action = "store", type = 'int', help = "set baud rate, default %default", - default = 9600 + default = DEFAULT_BAUDRATE ) parser.add_option("--parity", @@ -517,7 +522,7 @@ def main(): action = "store", type = 'int', help = "set initial RTS line state (possible values: 0, 1)", - default = None + default = DEFAULT_RTS ) parser.add_option("--dtr", @@ -525,7 +530,7 @@ def main(): action = "store", type = 'int', help = "set initial DTR line state (possible values: 0, 1)", - default = None + default = DEFAULT_DTR ) parser.add_option("-q", "--quiet", |