Release 1.2.2

This commit is contained in:
Wojciech Kozlowski 2017-03-14 22:32:19 +00:00
parent 4c8bfc2763
commit 6395ddd821
3 changed files with 48 additions and 42 deletions

View File

@ -1,6 +1,11 @@
Changelog
=========
1.2.2
-----
- Modified message wrapping code.
1.2.1
-----

View File

@ -478,34 +478,35 @@ def trace(message, function=None):
# -----------------------------------------------------------------
wrapped = textwrap.wrap(message, MESSAGE_WIDTH)
if wrapped:
if not wrapped:
wrapped = [""]
if MESSAGE_WRAP:
# ---------------------------------------------------------
# Print the first line. It gets special treatment
# as it doesn't need whitespace in front of it.
# ---------------------------------------------------------
# -------------------------------------------------------------
# Print the first line. It gets special treatment as
# it doesn't need whitespace in front of it.
# -------------------------------------------------------------
msg += wrapped[0]
# ---------------------------------------------------------
# -------------------------------------------------------------
# Print the remaining lines. Append whitespace to
# align it with the first line.
# ---------------------------------------------------------
# -------------------------------------------------------------
for line in wrapped[1:]:
msg += '\n' + '{:{w}}'.format('', w=premsglen) + line
else:
# ---------------------------------------------------------
# -------------------------------------------------------------
# The message is not being wrapped.
# ---------------------------------------------------------
# -------------------------------------------------------------
if MESSAGE_MARK_TRUNCATION and wrapped[1:]:
# -----------------------------------------------------
# We want to mark truncated lines so we need
# to determine if the line is being
# truncated. If it is we replace the last
# character with '\'.
# -----------------------------------------------------
# ---------------------------------------------------------
# We want to mark truncated lines so we need to
# determine if the line is being truncated. If it
# is we replace the last character with '\'.
# ---------------------------------------------------------
if MESSAGE_WIDTH > 1:
wrapped = textwrap.wrap(wrapped[0],
@ -521,10 +522,10 @@ def trace(message, function=None):
msg += '\\'
else:
# -----------------------------------------------------
# ---------------------------------------------------------
# Either the message is not being truncated or
# MESSAGE_MARK_TRUNCATION is False.
# -----------------------------------------------------
# ---------------------------------------------------------
msg += wrapped[0]
else:

View File

@ -9,7 +9,7 @@ with open(path.join(pwd, 'README.rst'), encoding='utf-8') as f:
setup(
name='PyLg',
version='1.2.1',
version='1.2.2',
description='Python module to facilitate and automate the process of writing runtime logs.',
long_description=long_description,
url='https://gitlab.wojciechkozlowski.eu/wojtek/PyLg',
@ -17,7 +17,7 @@ setup(
author='Wojciech Kozlowski',
author_email='wojciech.kozlowski@vivaldi.net',
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Debuggers',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',