From 3688a2a67b4c9f93411d4879262a8c36668c2e6f Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 03:40:37 -0400 Subject: [PATCH 1/7] list of available colors --- clint/textui/colored.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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.""" From 61225d90e6c7b4821c2ddf6eb81b57e11c909066 Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 03:40:42 -0400 Subject: [PATCH 2/7] fix all colors example --- examples/colors_all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From b92f3204c97e8e19cacddf0b6a2a340f014f64db Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 03:42:11 -0400 Subject: [PATCH 3/7] version bump --- clint/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' From 6404b0e49c5399c9b8f91619a65105c3316cd72f Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 03:42:20 -0400 Subject: [PATCH 4/7] no redundant versions --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 77e0fa4..c96c898 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, From bf7b5d093076140c8c23fdf1fcf2cd752d57597d Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 05:06:23 -0400 Subject: [PATCH 5/7] 2.5 with_statement support! --- clint/pipes.py | 1 + clint/resources.py | 1 + clint/textui/__init__.py | 4 +--- clint/utils.py | 3 ++- examples/colors_indent.py | 3 +++ examples/indents.py | 2 ++ examples/newline_indent.py | 2 ++ examples/piped.py | 2 ++ 8 files changed, 14 insertions(+), 4 deletions(-) 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/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_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 From 598deda4d9ea5c8e40202935a36aad2da115f3d0 Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 05:07:14 -0400 Subject: [PATCH 6/7] python 2.5 support! --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c96c898..a6f90e7 100644 --- a/setup.py +++ b/setup.py @@ -42,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', From 401344ff1ee0d0e6fcda3b6c90b23f86fc426c8d Mon Sep 17 00:00:00 2001 From: "star:Kenneth Reitz" Date: Thu, 24 Mar 2011 05:09:09 -0400 Subject: [PATCH 7/7] updated version info --- HISTORY.rst | 7 +++++++ 1 file changed, 7 insertions(+) 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) ++++++++++++++++++