From 0ec94b6ffa775c950e22d650b10a62412d6cd36f Mon Sep 17 00:00:00 2001 From: jquast Date: Sat, 7 Sep 2013 12:11:12 -0400 Subject: 'defaultdict' imported but unused --- blessings/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/blessings/__init__.py b/blessings/__init__.py index c03e105..dab2f27 100644 --- a/blessings/__init__.py +++ b/blessings/__init__.py @@ -1,4 +1,3 @@ -from collections import defaultdict from contextlib import contextmanager import curses from curses import tigetstr, tigetnum, setupterm, tparm -- cgit v1.2.1 From 07716adddd303c01975e6b20a9c928bcde04f7d9 Mon Sep 17 00:00:00 2001 From: jquast Date: Sat, 7 Sep 2013 12:11:38 -0400 Subject: 'os' imported but unused --- blessings/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blessings/__init__.py b/blessings/__init__.py index dab2f27..9e97e5b 100644 --- a/blessings/__init__.py +++ b/blessings/__init__.py @@ -9,7 +9,6 @@ except ImportError: """A dummy exception to take the place of Python 3's ``io.UnsupportedOperation`` in Python 2""" import os -from os import isatty, environ from platform import python_version_tuple import struct import sys @@ -88,7 +87,7 @@ class Terminal(object): stream_descriptor = None self.is_a_tty = (stream_descriptor is not None and - isatty(stream_descriptor)) + os.isatty(stream_descriptor)) self.does_styling = ((self.is_a_tty or force_styling) and force_styling is not None) @@ -104,7 +103,7 @@ class Terminal(object): # init sequences to the stream if it has a file descriptor, and # send them to stdout as a fallback, since they have to go # somewhere. - setupterm(kind or environ.get('TERM', 'unknown'), + setupterm(kind or os.environ.get('TERM', 'unknown'), self._init_descriptor) self.stream = stream -- cgit v1.2.1 From af20a2937246394ebc66ed07d6a3f2634dda77c5 Mon Sep 17 00:00:00 2001 From: jquast Date: Sat, 7 Sep 2013 12:24:41 -0400 Subject: import sorting using tool 'isort', https://github.com/timothycrosley/isort --- blessings/__init__.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/blessings/__init__.py b/blessings/__init__.py index 9e97e5b..675c2d7 100644 --- a/blessings/__init__.py +++ b/blessings/__init__.py @@ -1,18 +1,24 @@ -from contextlib import contextmanager +""" +(c) 2012 Erik Rose +MIT Licensed +https://github.com/erikrose/blessings +""" import curses -from curses import tigetstr, tigetnum, setupterm, tparm +import os +import struct +import sys +from contextlib import contextmanager +from curses import setupterm, tigetnum, tigetstr, tparm from fcntl import ioctl +from platform import python_version_tuple +from termios import TIOCGWINSZ + try: from io import UnsupportedOperation as IOUnsupportedOperation except ImportError: class IOUnsupportedOperation(Exception): """A dummy exception to take the place of Python 3's ``io.UnsupportedOperation`` in Python 2""" -import os -from platform import python_version_tuple -import struct -import sys -from termios import TIOCGWINSZ __all__ = ['Terminal'] -- cgit v1.2.1