summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjquast <contact@jeffquast.com>2014-06-29 00:50:27 -0700
committerjquast <contact@jeffquast.com>2014-06-29 00:50:27 -0700
commit07a4df55583e5ed720542106fe26afb34556fcaf (patch)
tree4d57f66660d26d170d085e740c3d9bb519611386
parent3b02724cccd8b10657c758450cbb7021b1045c8a (diff)
downloadblessings-07a4df55583e5ed720542106fe26afb34556fcaf.tar.gz
release version 1.9
* workaround: ignore 'tparm() returned NULL', this occurs on win32 platforms using PDCurses_ without a termcap or termlib. * bugfix: term.center('text') should not padd right side with whitespace.
-rw-r--r--README.rst6
-rw-r--r--blessed/formatters.py6
-rw-r--r--blessed/sequences.py4
-rw-r--r--docs/conf.py4
-rwxr-xr-xsetup.py2
-rw-r--r--tox.ini8
6 files changed, 18 insertions, 12 deletions
diff --git a/README.rst b/README.rst
index dd35516..f6258ff 100644
--- a/README.rst
+++ b/README.rst
@@ -668,6 +668,11 @@ shares the same. See the LICENSE file.
Version History
===============
+1.9
+ * workaround: ignore 'tparm() returned NULL', this occurs on win32
+ platforms using PDCurses_ without a termcap or termlib.
+ * bugfix: term.center('text') should not padd right side with whitespace.
+
1.8
* enhancement: export keyboard-read function as public method ``getch()``,
so that it may be overridden by custom terminal implementers.
@@ -825,3 +830,4 @@ Version History
.. _tparm: http://www.openbsd.org/cgi-bin/man.cgi?query=tparm&sektion=3
.. _SIGWINCH: https://en.wikipedia.org/wiki/SIGWINCH
.. _`API Documentation`: http://blessed.rtfd.org
+.. _`PDCurses`: http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses
diff --git a/blessed/formatters.py b/blessed/formatters.py
index b33ca21..1af6471 100644
--- a/blessed/formatters.py
+++ b/blessed/formatters.py
@@ -65,6 +65,12 @@ class ParameterizingString(unicode):
# Somebody passed a non-string; I don't feel confident
# guessing what they were trying to do.
raise
+ except Exception, err:
+ # ignore 'tparm() returned NULL', you won't get any styling,
+ # even if does_styling is True. This happens on win32 platforms
+ # with http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses installed
+ if "tparm() returned NULL" not in err:
+ raise
class ParameterizingProxyString(unicode):
diff --git a/blessed/sequences.py b/blessed/sequences.py
index a08c926..b7a8a79 100644
--- a/blessed/sequences.py
+++ b/blessed/sequences.py
@@ -409,9 +409,7 @@ class Sequence(unicode):
split = max(0.0, float(width) - self.length()) / 2
leftside = fillchar * int((max(0.0, math.floor(split)))
/ float(len(fillchar)))
- rightside = fillchar * int((max(0.0, math.ceil(split)))
- / float(len(fillchar)))
- return u''.join((leftside, self, rightside))
+ return u''.join((leftside, self))
def length(self):
"""S.length() -> int
diff --git a/docs/conf.py b/docs/conf.py
index bb5c999..de243fa 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -53,12 +53,12 @@ copyright = u'2014 Jeff Quast, 2011 Erik Rose'
# built documents.
#
# The short X.Y version.
-version = '1.8.8'
+version = '1.9.0'
# The full version, including alpha/beta/rc tags.
release = version
-# The language for content autogenerated by Sphinx. Refer to documentation
+# The language for content auto-generated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
diff --git a/setup.py b/setup.py
index a188a78..cc8915a 100755
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@ def main():
here = os.path.dirname(__file__)
setuptools.setup(
name='blessed',
- version='1.8.9',
+ version='1.9.0',
description="A feature-filled fork of Erik Rose's blessings project",
long_description=open(os.path.join(here, 'README.rst')).read(),
author='Jeff Quast',
diff --git a/tox.ini b/tox.ini
index 41e5150..23379ee 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,6 @@
[tox]
envlist = py26,
py27,
- py33,
py34,
pypy
@@ -16,6 +15,7 @@ deps = pytest
-rrequirements.txt
whitelist_externals = /bin/bash
+setenv = PYTHONIOENCODING=UTF8
# run each test twice -- 1. w/o tty
commands = /bin/bash -c {envbindir}/py.test -v \
@@ -37,6 +37,7 @@ deps = pytest
mock
-rrequirements.txt
+setenv = PYTHONIOENCODING=UTF8
# run each test twice -- 1. w/o tty,
commands = /bin/bash -c {envbindir}/py.test -v \
@@ -54,11 +55,6 @@ commands = /bin/bash -c {envbindir}/py.test -v \
#
# some issue with py.test & python 3 does not allow non-tty testing.
-[testenv:py33]
-changedir = {toxworkdir}
-commands = {envbindir}/py.test -x --strict --pep8 --flakes \
- {envsitepackagesdir}/blessed/tests {posargs}
-
[testenv:py34]
changedir = {toxworkdir}
commands = {envbindir}/py.test -x --strict --pep8 --flakes \