summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Hunt <dave.hunt@gmail.com>2018-06-18 15:54:34 +0100
committerDave Hunt <dave.hunt@gmail.com>2018-06-18 15:54:48 +0100
commit37784c170a423faa8a7970ece416c99b93692f79 (patch)
treedb9c25f48ad18a95acf944f684b73064809403aa
parent49ec0e263b630cb97b16a1d9da55e70fef75c5d0 (diff)
downloadblessings-37784c170a423faa8a7970ece416c99b93692f79.tar.gz
Import constants from six instead of importing the six module
-rw-r--r--blessings/__init__.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/blessings/__init__.py b/blessings/__init__.py
index 0212ae9..ebace02 100644
--- a/blessings/__init__.py
+++ b/blessings/__init__.py
@@ -6,7 +6,7 @@ from contextlib import contextmanager
import curses
from curses import setupterm, tigetnum, tigetstr, tparm
from fcntl import ioctl
-import six
+from six import text_type, string_types
try:
from io import UnsupportedOperation as IOUnsupportedOperation
@@ -422,7 +422,7 @@ COMPOUNDABLES = (COLORS |
'shadow', 'standout', 'subscript', 'superscript']))
-class ParametrizingString(six.text_type):
+class ParametrizingString(text_type):
"""A Unicode string which can be called to parametrize it as a terminal
capability"""
@@ -434,7 +434,7 @@ class ParametrizingString(six.text_type):
"normal" capability.
"""
- new = six.text_type.__new__(cls, formatting)
+ new = text_type.__new__(cls, formatting)
new._normal = normal
return new
@@ -463,7 +463,7 @@ class ParametrizingString(six.text_type):
except TypeError:
# If the first non-int (i.e. incorrect) arg was a string, suggest
# something intelligent:
- if len(args) == 1 and isinstance(args[0], six.string_types):
+ if len(args) == 1 and isinstance(args[0], string_types):
raise TypeError(
'A native or nonexistent capability template received '
'%r when it was expecting ints. You probably misspelled a '
@@ -474,12 +474,12 @@ class ParametrizingString(six.text_type):
raise
-class FormattingString(six.text_type):
+class FormattingString(text_type):
"""A Unicode string which can be called upon a piece of text to wrap it in
formatting"""
def __new__(cls, formatting, normal):
- new = six.text_type.__new__(cls, formatting)
+ new = text_type.__new__(cls, formatting)
new._normal = normal
return new
@@ -494,7 +494,7 @@ class FormattingString(six.text_type):
return self + text + self._normal
-class NullCallableString(six.text_type):
+class NullCallableString(text_type):
"""A dummy callable Unicode to stand in for ``FormattingString`` and
``ParametrizingString``
@@ -502,7 +502,7 @@ class NullCallableString(six.text_type):
"""
def __new__(cls):
- new = six.text_type.__new__(cls, u'')
+ new = text_type.__new__(cls, u'')
return new
def __call__(self, *args):