jc-debug 1.0.0__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jc_debug-1.0.0 → jc_debug-1.0.1}/PKG-INFO +1 -1
- {jc_debug-1.0.0 → jc_debug-1.0.1}/pyproject.toml +1 -1
- {jc_debug-1.0.0 → jc_debug-1.0.1}/src/debug/__init__.py +2 -2
- {jc_debug-1.0.0 → jc_debug-1.0.1}/src/jc_debug.egg-info/PKG-INFO +1 -1
- {jc_debug-1.0.0 → jc_debug-1.0.1}/tests/test_operations.py +18 -0
- {jc_debug-1.0.0 → jc_debug-1.0.1}/LICENSE +0 -0
- {jc_debug-1.0.0 → jc_debug-1.0.1}/README.md +0 -0
- {jc_debug-1.0.0 → jc_debug-1.0.1}/setup.cfg +0 -0
- {jc_debug-1.0.0 → jc_debug-1.0.1}/src/jc_debug.egg-info/SOURCES.txt +0 -0
- {jc_debug-1.0.0 → jc_debug-1.0.1}/src/jc_debug.egg-info/dependency_links.txt +0 -0
- {jc_debug-1.0.0 → jc_debug-1.0.1}/src/jc_debug.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "jc-debug"
|
7
|
-
version = "1.0.
|
7
|
+
version = "1.0.1" # Consider using a proper versioning scheme
|
8
8
|
authors = [
|
9
9
|
{ name="Jeff Clough", email="jeff@cloughcottage.com" },
|
10
10
|
]
|
@@ -155,7 +155,7 @@ __all__ = [
|
|
155
155
|
"DebugChannel",
|
156
156
|
"line_iter",
|
157
157
|
]
|
158
|
-
__version__ = "0.1
|
158
|
+
__version__ = "1.0.1"
|
159
159
|
|
160
160
|
import inspect, os, sys, traceback
|
161
161
|
|
@@ -565,7 +565,7 @@ class DebugChannel:
|
|
565
565
|
message = "{"
|
566
566
|
self.stream.write(self.fmt.format(**locals()))
|
567
567
|
for k in messages.keys():
|
568
|
-
message = f"{self.indstr}{k}: {messages[k]}"
|
568
|
+
message = f"{self.indstr}{k!r}: {messages[k]!r}"
|
569
569
|
self.stream.write(self.fmt.format(**locals()))
|
570
570
|
message = "}"
|
571
571
|
self.stream.write(self.fmt.format(**locals()))
|
@@ -3,8 +3,11 @@ from io import StringIO
|
|
3
3
|
from src.debug import DebugChannel
|
4
4
|
from pprint import pprint
|
5
5
|
|
6
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
7
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
6
8
|
# We'll be sending debug output to this stream so we can write tests
|
7
9
|
# against its content.
|
10
|
+
|
8
11
|
out=StringIO()
|
9
12
|
|
10
13
|
def clear_output(output_stream=out):
|
@@ -30,6 +33,11 @@ def outstr_lines(output_stream=out):
|
|
30
33
|
|
31
34
|
dc=DebugChannel(True,stream=out)
|
32
35
|
|
36
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
37
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
38
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
39
|
+
# Test code begins here.
|
40
|
+
|
33
41
|
@dc
|
34
42
|
def exception_test():
|
35
43
|
x=1/0
|
@@ -80,6 +88,16 @@ DC: test_basics: Message 2
|
|
80
88
|
"""
|
81
89
|
assert dc.indlev==0
|
82
90
|
|
91
|
+
# Test dictionary output.
|
92
|
+
dc({'a':1,2:'b','c':True})
|
93
|
+
assert outstr()=="""\
|
94
|
+
DC: test_basics: {
|
95
|
+
DC: test_basics: 'a': 1
|
96
|
+
DC: test_basics: 2: 'b'
|
97
|
+
DC: test_basics: 'c': True
|
98
|
+
DC: test_basics: }
|
99
|
+
"""
|
100
|
+
|
83
101
|
@dc
|
84
102
|
def example1(msg):
|
85
103
|
print(msg)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|