File: python3.patch

package info (click to toggle)
python-can 4.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,428 kB
  • sloc: python: 27,154; makefile: 31; sh: 16
file content (153 lines) | stat: -rw-r--r-- 5,502 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From: =?utf-8?q?=22IOhannes_m_zm=C3=B6lnig_=28Debian/GNU=29=22?=
 <umlaeute@debian.org>
Date: Fri, 27 Mar 2020 20:57:21 +0100
Subject: 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
---
 can/viewer.py        | 10 +++++-----
 doc/scripts.rst      | 12 ++++++------
 test/test_scripts.py |  8 ++++----
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/can/viewer.py b/can/viewer.py
index 97bda16..7971167 100644
--- a/can/viewer.py
+++ b/can/viewer.py
@@ -392,7 +392,7 @@ def _parse_viewer_args(
 ) -> tuple[argparse.Namespace, TDataStructs]:
     # 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        +---------+-------------------------------+"
@@ -444,7 +444,7 @@ def _parse_viewer_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"
@@ -453,16 +453,16 @@ def _parse_viewer_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="",
diff --git a/doc/scripts.rst b/doc/scripts.rst
index 1d730a7..c8c5e99 100644
--- a/doc/scripts.rst
+++ b/doc/scripts.rst
@@ -3,7 +3,7 @@ Command Line Tools
 
 The following modules are callable from ``python-can``.
 
-They can be called for example by ``python -m can.logger`` or ``can_logger`` (if installed using pip).
+They can be called for example by ``python3 -m can.logger`` or ``can_logger`` (if installed using pip).
 
 can.logger
 ----------
@@ -11,14 +11,14 @@ can.logger
 Command line help, called with ``--help``:
 
 
-.. command-output:: python -m can.logger -h
+.. command-output:: python3 -m can.logger -h
     :shell:
 
 
 can.player
 ----------
 
-.. command-output:: python -m can.player -h
+.. command-output:: python3 -m can.player -h
     :shell:
 
 
@@ -53,7 +53,7 @@ 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
     :shell:
 
 
@@ -62,12 +62,12 @@ can.bridge
 
 A small application that can be used to connect two can buses:
 
-.. command-output:: python -m can.bridge -h
+.. command-output:: python3 -m can.bridge -h
     :shell:
 
 
 can.logconvert
 --------------
 
-.. command-output:: python -m can.logconvert -h
+.. command-output:: python3 -m can.logconvert -h
     :shell:
diff --git a/test/test_scripts.py b/test/test_scripts.py
index c1a6c08..a9d4269 100644
--- a/test/test_scripts.py
+++ b/test/test_scripts.py
@@ -73,7 +73,7 @@ class CanScriptTest(unittest.TestCase, metaclass=ABCMeta):
 class TestLoggerScript(CanScriptTest):
     def _commands(self):
         commands = [
-            "python -m can.logger --help",
+            "python3 -m can.logger --help",
             "can_logger --help",
         ]
         return commands
@@ -87,7 +87,7 @@ class TestLoggerScript(CanScriptTest):
 class TestPlayerScript(CanScriptTest):
     def _commands(self):
         commands = [
-            "python -m can.player --help",
+            "python3 -m can.player --help",
             "can_player --help",
         ]
         return commands
@@ -101,7 +101,7 @@ class TestPlayerScript(CanScriptTest):
 class TestBridgeScript(CanScriptTest):
     def _commands(self):
         commands = [
-            "python -m can.bridge --help",
+            "python3 -m can.bridge --help",
             "can_bridge --help",
         ]
         return commands
@@ -115,7 +115,7 @@ class TestBridgeScript(CanScriptTest):
 class TestLogconvertScript(CanScriptTest):
     def _commands(self):
         commands = [
-            "python -m can.logconvert --help",
+            "python3 -m can.logconvert --help",
             "can_logconvert --help",
         ]
         return commands