diff options
author | jquast <contact@jeffquast.com> | 2014-06-29 00:50:27 -0700 |
---|---|---|
committer | jquast <contact@jeffquast.com> | 2014-06-29 00:50:27 -0700 |
commit | 07a4df55583e5ed720542106fe26afb34556fcaf (patch) | |
tree | 4d57f66660d26d170d085e740c3d9bb519611386 /blessed | |
parent | 3b02724cccd8b10657c758450cbb7021b1045c8a (diff) | |
download | blessings-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.
Diffstat (limited to 'blessed')
-rw-r--r-- | blessed/formatters.py | 6 | ||||
-rw-r--r-- | blessed/sequences.py | 4 |
2 files changed, 7 insertions, 3 deletions
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 |