summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>2019-09-10 15:19:19 +0200
committerIOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>2019-09-10 15:19:19 +0200
commitc1e8a6589fb0ae2d4392c3e8e1764eeb01f64776 (patch)
tree4f368e8a5edd5f3e645ceb61f1321a0bb8898750
parent9a13d2d659b6725d170fff7de358b6dcb5b101b8 (diff)
use 'python3' instead of 'python' when calling scripts
Origin: Debian Forwarded: not-needed Last-Update: 2019-09-10 also in the documentation Last-Update: 2019-09-10 Gbp-Pq: Name 0005-python3.patch
-rw-r--r--can/logger.py2
-rw-r--r--can/player.py2
-rw-r--r--can/viewer.py12
-rw-r--r--doc/scripts.rst8
-rw-r--r--test/test_scripts.py8
5 files changed, 16 insertions, 16 deletions
diff --git a/can/logger.py b/can/logger.py
index 00f6679..d5a0b4c 100644
--- a/can/logger.py
+++ b/can/logger.py
@@ -27,7 +27,7 @@ from can import Bus, BusState, Logger
def main():
parser = argparse.ArgumentParser(
- "python -m can.logger",
+ "python3 -m can.logger",
description="Log CAN traffic, printing messages to stdout or to a given file.",
)
diff --git a/can/player.py b/can/player.py
index 34be486..83ced37 100644
--- a/can/player.py
+++ b/can/player.py
@@ -17,7 +17,7 @@ from can import Bus, LogReader, MessageSync
def main():
parser = argparse.ArgumentParser(
- "python -m can.player", description="Replay CAN traffic."
+ "python3 -m can.player", description="Replay CAN traffic."
)
parser.add_argument(
diff --git a/can/viewer.py b/can/viewer.py
index 7071925..86d377d 100644
--- a/can/viewer.py
+++ b/can/viewer.py
@@ -341,7 +341,7 @@ def parse_args(args):
# Parse command line arguments
parser = argparse.ArgumentParser(
- "python -m can.viewer",
+ "python3 -m can.viewer",
description="A simple CAN viewer terminal application written in Python",
epilog="R|Shortcuts: "
"\n +---------+-------------------------+"
@@ -414,7 +414,7 @@ def parse_args(args):
"\n q = int64_t, Q = uint64_t"
"\n f = float (32-bits), d = double (64-bits)"
"\nFx to convert six bytes with ID 0x100 into uint8_t, uint16 and uint32_t:"
- '\n $ python -m can.viewer -d "100:<BHL"'
+ '\n $ python3 -m can.viewer -d "100:<BHL"'
"\nNote that the IDs are always interpreted as hex values."
"\nAn optional conversion from integers to real units can be given"
"\nas additional arguments. In order to convert from raw integer"
@@ -423,16 +423,16 @@ def parse_args(args):
"\nto convert from real units to raw integer values."
"\nFx lets say the uint8_t needs no conversion, but the uint16 and the uint32_t"
"\nneeds to be divided by 10 and 100 respectively:"
- '\n $ python -m can.viewer -d "101:<BHL:1:10.0:100.0"'
+ '\n $ python3 -m can.viewer -d "101:<BHL:1:10.0:100.0"'
"\nBe aware that integer division is performed if the scaling value is an integer."
"\nMultiple arguments are separated by spaces:"
- '\n $ python -m can.viewer -d "100:<BHL" "101:<BHL:1:10.0:100.0"'
+ '\n $ python3 -m can.viewer -d "100:<BHL" "101:<BHL:1:10.0:100.0"'
"\nAlternatively a file containing the conversion strings separated by new lines"
"\ncan be given as input:"
"\n $ cat file.txt"
"\n 100:<BHL"
"\n 101:<BHL:1:10.0:100.0"
- "\n $ python -m can.viewer -d file.txt",
+ "\n $ python3 -m can.viewer -d file.txt",
metavar="{<id>:<format>,<id>:<format>:<scaling1>:...:<scalingN>,file.txt}",
nargs=argparse.ONE_OR_MORE,
default="",
@@ -445,7 +445,7 @@ def parse_args(args):
"\n <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)"
"\n <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)"
"\nFx to show only frames with ID 0x100 to 0x103 and 0x200 to 0x20F:"
- "\n python -m can.viewer -f 100:7FC 200:7F0"
+ "\n python3 -m can.viewer -f 100:7FC 200:7F0"
"\nNote that the ID and mask are alway interpreted as hex values",
metavar="{<can_id>:<can_mask>,<can_id>~<can_mask>}",
nargs=argparse.ONE_OR_MORE,
diff --git a/doc/scripts.rst b/doc/scripts.rst
index a63f1b1..d61efc2 100644
--- a/doc/scripts.rst
+++ b/doc/scripts.rst
@@ -3,7 +3,7 @@ Scripts
The following modules are callable from python-can.
-They can be called for example by ``python -m can.logger`` or ``can_logger.py`` (if installed using pip).
+They can be called for example by ``python3 -m can.logger`` or ``can_logger.py`` (if installed using pip).
can.logger
----------
@@ -11,13 +11,13 @@ can.logger
Command line help, called with ``--help``:
-.. command-output:: python -m can.logger -h
+.. command-output:: python3 -m can.logger -h
can.player
----------
-.. command-output:: python -m can.player -h
+.. command-output:: python3 -m can.player -h
can.viewer
@@ -37,5 +37,5 @@ By default the ``can.viewer`` uses the :doc:`/interfaces/socketcan` interface. A
The full usage page can be seen below:
-.. command-output:: python -m can.viewer -h
+.. command-output:: python3 -m can.viewer -h
diff --git a/test/test_scripts.py b/test/test_scripts.py
index 4560210..117b236 100644
--- a/test/test_scripts.py
+++ b/test/test_scripts.py
@@ -70,8 +70,8 @@ class CanScriptTest(unittest.TestCase, metaclass=ABCMeta):
class TestLoggerScript(CanScriptTest):
def _commands(self):
commands = [
- "python -m can.logger --help",
-# "python scripts/can_logger.py --help",
+ "python3 -m can.logger --help",
+# "python3 scripts/can_logger.py --help",
]
# if IS_UNIX:
# commands += ["can_logger.py --help"]
@@ -86,8 +86,8 @@ class TestLoggerScript(CanScriptTest):
class TestPlayerScript(CanScriptTest):
def _commands(self):
commands = [
- "python -m can.player --help",
-# "python scripts/can_player.py --help",
+ "python3 -m can.player --help",
+# "python3 scripts/can_player.py --help",
]
# if IS_UNIX:
# commands += ["can_player.py --help"]