Skip to content

Commit d5a0eea

Browse files
Bug fixes and improvements.
1 parent 1addc2d commit d5a0eea

5 files changed

Lines changed: 18 additions & 12 deletions

File tree

CHANGES-LOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Help this project by [Donation](DONATE.md)
66
Changes log
77
-----------
88

9+
### 2.4.1
10+
11+
Bug fixes and improvements.
12+
913
### 2.4.0
1014

1115
+ Made it more compatible with multi-threading.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ python setup.py install
5353
Changes
5454
-------
5555

56-
### 2.4.0
56+
### 2.4.1
5757

58-
+ Made it more compatible with multi-threading.
59-
+ Fixed some bugs.
58+
Bug fixes and improvements.
6059

6160
[Full Changes Log](https://github.com/MPCodeWriter21/log21/blob/master/CHANGES-LOG.md)
6261

log21/PPrint.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class PrettyPrinter(_PrettyPrinter):
7676
}
7777

7878
def __init__(self, indent=1, width=80, depth=None, stream=None, signs_colors: _Dict[str, str] = None, *,
79-
compact=False, **kwargs):
79+
compact=False, sort_dicts=True, underscore_numbers=False, **kwargs):
8080
super().__init__(indent=indent, width=width, depth=depth, stream=stream, compact=compact, **kwargs)
8181
self._depth = depth
8282
self._indent_per_level = indent
@@ -86,6 +86,8 @@ def __init__(self, indent=1, width=80, depth=None, stream=None, signs_colors: _D
8686
else:
8787
self._stream = _sys.stdout
8888
self._compact = bool(compact)
89+
self._sort_dicts = sort_dicts
90+
self._underscore_numbers = underscore_numbers
8991
if signs_colors:
9092
for sign, color in signs_colors.items():
9193
self.signs_colors[sign.lower()] = _gc(color)
@@ -560,7 +562,8 @@ def _pprint_user_string(self, obj, stream, indent, allowance, context, level):
560562
_dispatch[_collections.UserString.__repr__] = _pprint_user_string
561563

562564

563-
def pformat(obj, indent=1, width=80, depth=None, signs_colors: _Dict[str, str] = None, *, compact=False, **kwargs):
565+
def pformat(obj, indent=1, width=80, depth=None, signs_colors: _Dict[str, str] = None, *, compact=False,
566+
sort_dicts=True, underscore_numbers=False, **kwargs):
564567
"""Format a Python object into a pretty-printed representation."""
565568
return PrettyPrinter(indent=indent, width=width, depth=depth, compact=compact, signs_colors=signs_colors,
566-
**kwargs).pformat(obj)
569+
sort_dicts=True, underscore_numbers=False, **kwargs).pformat(obj)

log21/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from log21.Formatters import ColorizingFormatter, DecolorizingFormatter
2222
from log21.Colors import Colors, get_color, get_colors, ansi_escape, get_color_name, closest_color
2323

24-
__version__ = "2.4.0"
24+
__version__ = "2.4.1"
2525
__author__ = "CodeWriter21 (Mehrad Pooryoussof)"
2626
__github__ = "Https://GitHub.com/MPCodeWriter21/log21"
2727
__all__ = ['ColorizingStreamHandler', 'DecolorizingFileHandler', 'ColorizingFormatter', 'DecolorizingFormatter',
@@ -235,11 +235,11 @@ def getpass(*msg, args: tuple = (), end='', **kwargs):
235235
return logger.getpass(*msg, args=args, end=end, **kwargs)
236236

237237

238-
def pprint(obj, indent=1, width=80, depth=None, signs_colors: _Dict[str, str] = None, *, compact=False, end='\033[0m\n',
239-
**kwargs):
238+
def pprint(obj, indent=1, width=80, depth=None, signs_colors: _Dict[str, str] = None, *, sort_dicts=True,
239+
underscore_numbers=False, compact=False, end='\033[0m\n', **kwargs):
240240
logger = get_logger('log21.pprint', level=DEBUG, show_time=False, show_level=False)
241-
logger.print(pformat(obj=obj, indent=indent, width=width, depth=depth, signs_colors=signs_colors, compact=compact),
242-
end=end, **kwargs)
241+
logger.print(pformat(obj=obj, indent=indent, width=width, depth=depth, signs_colors=signs_colors, compact=compact,
242+
sort_dicts=sort_dicts, underscore_numbers=underscore_numbers), end=end, **kwargs)
243243

244244

245245
pretty_print = pprint

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
long_description = file.read()
88

99
DESCRIPTION = 'A simple logging package that helps you log colorized messages in Windows console.'
10-
VERSION = '2.4.0'
10+
VERSION = '2.4.1'
1111

1212
setup(
1313
name='log21',

0 commit comments

Comments
 (0)