diff --git a/HISTORY.rst b/HISTORY.rst index 70cc9ca..4af4b7f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,13 @@ History ------- +0.2.1 (2011-03-24) +++++++++++++++++++ + +* Python 2.5 Support +* List of available colors + + 0.2.0 (2011-03-23) ++++++++++++++++++ diff --git a/clint/__init__.py b/clint/__init__.py index 5c3d52e..29ec2d2 100644 --- a/clint/__init__.py +++ b/clint/__init__.py @@ -19,8 +19,8 @@ from .pipes import piped_in __title__ = 'clint' -__version__ = '0.2.0' -__build__ = 0x000200 +__version__ = '0.2.1' +__build__ = 0x000201 __author__ = 'Kenneth Reitz' __license__ = 'ISC' __copyright__ = 'Copyright 2011 Kenneth Reitz' diff --git a/clint/pipes.py b/clint/pipes.py index 713e914..de7ba28 100644 --- a/clint/pipes.py +++ b/clint/pipes.py @@ -9,6 +9,7 @@ This module contains the helper functions for dealing with unix pipes. """ from __future__ import absolute_import +from __future__ import with_statement import sys diff --git a/clint/resources.py b/clint/resources.py index 996d435..27ad10a 100644 --- a/clint/resources.py +++ b/clint/resources.py @@ -10,6 +10,7 @@ This module contains all the application resource features of clint. from __future__ import absolute_import +from __future__ import with_statement import errno from os import remove, removedirs diff --git a/clint/textui/__init__.py b/clint/textui/__init__.py index d260ede..aa3a36a 100644 --- a/clint/textui/__init__.py +++ b/clint/textui/__init__.py @@ -8,8 +8,6 @@ This module provides the text output helper system. """ -from __future__ import absolute_import - from . import colored -from .core import * +from core import * diff --git a/clint/textui/colored.py b/clint/textui/colored.py index 37f3247..dcee961 100644 --- a/clint/textui/colored.py +++ b/clint/textui/colored.py @@ -16,18 +16,18 @@ import sys from ..packages import colorama -DISABLE_COLOR = False - -if sys.stdout.isatty(): - colorama.init(autoreset=True) - - __all__ = ( 'red', 'green', 'yellow', 'blue', 'black', 'magenta', 'cyan', 'white', 'clean', 'disable' ) +COLORS = __all__[:-2] +DISABLE_COLOR = False + +if sys.stdout.isatty(): + colorama.init(autoreset=True) + class ColoredString(object): """Enhanced string for __len__ operations on Colored output.""" diff --git a/clint/utils.py b/clint/utils.py index 4d1257b..3f499d0 100644 --- a/clint/utils.py +++ b/clint/utils.py @@ -9,6 +9,7 @@ Various Python helpers used within clint. """ from __future__ import absolute_import +from __future__ import with_statement import sys import errno @@ -28,7 +29,7 @@ def mkdir_p(path): """Emulates `mkdir -p` behavior.""" try: makedirs(path) - except OSError as exc: # Python >2.5 + except OSError, exc: # Python >2.5 if exc.errno == errno.EEXIST: pass else: diff --git a/examples/colors_all.py b/examples/colors_all.py index 3f806d4..92dd779 100755 --- a/examples/colors_all.py +++ b/examples/colors_all.py @@ -12,5 +12,5 @@ text = 'THIS TEXT IS COLORED %s!' if __name__ == '__main__': - for color in colored.__all__: + for color in colored.COLORS: print getattr(colored, color)(text % color.upper()) \ No newline at end of file diff --git a/examples/colors_indent.py b/examples/colors_indent.py index c899fac..f5638ad 100755 --- a/examples/colors_indent.py +++ b/examples/colors_indent.py @@ -1,6 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import with_statement + + import sys import os diff --git a/examples/indents.py b/examples/indents.py index 087fa20..434dd6a 100755 --- a/examples/indents.py +++ b/examples/indents.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import with_statement + import sys import os diff --git a/examples/newline_indent.py b/examples/newline_indent.py index c3eec18..033dc32 100755 --- a/examples/newline_indent.py +++ b/examples/newline_indent.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import with_statement + import sys import os diff --git a/examples/piped.py b/examples/piped.py index 2aa1856..63701d4 100644 --- a/examples/piped.py +++ b/examples/piped.py @@ -4,6 +4,8 @@ import sys import os +from __future__ import with_statement + sys.path.insert(0, os.path.abspath('..')) from clint import piped_in diff --git a/setup.py b/setup.py index 77e0fa4..a6f90e7 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,9 @@ import sys from distutils.core import setup +import clint + + def publish(): """Publish to PyPi""" @@ -19,7 +22,7 @@ required = [] setup( name='clint', - version='0.2.0', + version=clint.__version__, description='Python Command-line Application Tools', long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(), @@ -29,7 +32,6 @@ setup( packages= [ 'clint', 'clint.textui', - 'clint.packages', 'clint.packages.colorama' ], install_requires=required, @@ -40,7 +42,7 @@ setup( 'Natural Language :: English', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python', - # 'Programming Language :: Python :: 2.5', + 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', # 'Programming Language :: Python :: 3.0',