jc-debug 1.0.0__tar.gz → 1.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jc-debug
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Makes debugging to the console both simpler and much more powerful.
5
5
  Author-email: Jeff Clough <jeff@cloughcottage.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "jc-debug"
7
- version = "1.0.0" # Consider using a proper versioning scheme
7
+ version = "1.0.2" # 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.0"
158
+ __version__ = "1.0.2"
159
159
 
160
160
  import inspect, os, sys, traceback
161
161
 
@@ -556,7 +556,7 @@ class DebugChannel:
556
556
  message = left
557
557
  self.stream.write(self.fmt.format(**locals()))
558
558
  for message in messages:
559
- message = self.indstr + message
559
+ message = self.indstr + repr(message)
560
560
  self.stream.write(self.fmt.format(**locals()))
561
561
  message = right
562
562
  self.stream.write(self.fmt.format(**locals()))
@@ -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()))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jc-debug
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Makes debugging to the console both simpler and much more powerful.
5
5
  Author-email: Jeff Clough <jeff@cloughcottage.com>
6
6
  License: MIT License
@@ -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,36 @@ DC: test_basics: Message 2
80
88
  """
81
89
  assert dc.indlev==0
82
90
 
91
+ # Test tuple output.
92
+ dc(('a',2,True))
93
+ assert outstr()=="""\
94
+ DC: test_basics: (
95
+ DC: test_basics: 'a'
96
+ DC: test_basics: 2
97
+ DC: test_basics: True
98
+ DC: test_basics: )
99
+ """
100
+
101
+ # Test list output.
102
+ dc(['a',2,True])
103
+ assert outstr()=="""\
104
+ DC: test_basics: [
105
+ DC: test_basics: 'a'
106
+ DC: test_basics: 2
107
+ DC: test_basics: True
108
+ DC: test_basics: ]
109
+ """
110
+
111
+ # Test dictionary output.
112
+ dc({'a':1,2:'b','c':True})
113
+ assert outstr()=="""\
114
+ DC: test_basics: {
115
+ DC: test_basics: 'a': 1
116
+ DC: test_basics: 2: 'b'
117
+ DC: test_basics: 'c': True
118
+ DC: test_basics: }
119
+ """
120
+
83
121
  @dc
84
122
  def example1(msg):
85
123
  print(msg)
File without changes
File without changes
File without changes