6 Commits

Author SHA1 Message Date
Jason Piper fc463f16c3 0.3.3 2014-01-09 23:45:19 +00:00
Jason Piper 9324af95b2 Fixed README and HISTORY being installed to /usr 2014-01-09 22:52:08 +00:00
Jason Piper 50294ea2dc Merge pull request #95 from saimn/patch-1
Use print() function to fix install on python 3
2014-01-09 12:25:27 -08:00
kennethreitz 56fe6138b6 Merge pull request #96 from sephii/bold_support
Add support for bold text
2014-01-08 11:59:57 -08:00
Sylvain Fankhauser d22847fb95 add support for bold text 2013-12-18 17:02:38 +01:00
Simon Conseil ce25cea7e8 Use print() function to fix install on python 3
clint 0.3.2 can't be installed on python 3.3 because of a print statement.
2013-12-05 23:42:27 +01:00
5 changed files with 38 additions and 28 deletions
+14
View File
@@ -1,6 +1,20 @@
History
-------
0.3.3
+++++
* Fixed Python 3 build issues
* Fixed README and HISTORY being installed to /usr
* Support added for bold text
0.3.2
+++++
* Unknown
0.3.1
+++++
* Unknown
0.3.0
+++++
+2 -2
View File
@@ -26,8 +26,8 @@ from .pipes import piped_in
__title__ = 'clint'
__version__ = '0.3.2'
__build__ = 0x000302
__version__ = '0.3.3'
__build__ = 0x000303
__author__ = 'Kenneth Reitz'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Kenneth Reitz'
+20 -18
View File
@@ -40,11 +40,12 @@ else:
class ColoredString(object):
"""Enhanced string for __len__ operations on Colored output."""
def __init__(self, color, s, always_color=False):
def __init__(self, color, s, always_color=False, bold=False):
super(ColoredString, self).__init__()
self.s = s
self.color = color
self.always_color = always_color
self.bold = bold
def __getattr__(self, att):
def func_help(*args, **kwargs):
@@ -59,7 +60,8 @@ class ColoredString(object):
@property
def color_str(self):
c = '%s%s%s' % (getattr(colorama.Fore, self.color), self.s, colorama.Fore.RESET)
style = 'BRIGHT' if self.bold else 'NORMAL'
c = '%s%s%s%s' % (getattr(colorama.Fore, self.color), getattr(colorama.Style, style), self.s, colorama.Fore.RESET)
if self.always_color:
return c
@@ -113,29 +115,29 @@ def clean(s):
return txt
def black(string, always=False):
return ColoredString('BLACK', string, always_color=always)
def black(string, always=False, bold=False):
return ColoredString('BLACK', string, always_color=always, bold=bold)
def red(string, always=False):
return ColoredString('RED', string, always_color=always)
def red(string, always=False, bold=False):
return ColoredString('RED', string, always_color=always, bold=bold)
def green(string, always=False):
return ColoredString('GREEN', string, always_color=always)
def green(string, always=False, bold=False):
return ColoredString('GREEN', string, always_color=always, bold=bold)
def yellow(string, always=False):
return ColoredString('YELLOW', string, always_color=always)
def yellow(string, always=False, bold=False):
return ColoredString('YELLOW', string, always_color=always, bold=bold)
def blue(string, always=False):
return ColoredString('BLUE', string, always_color=always)
def blue(string, always=False, bold=False):
return ColoredString('BLUE', string, always_color=always, bold=bold)
def magenta(string, always=False):
return ColoredString('MAGENTA', string, always_color=always)
def magenta(string, always=False, bold=False):
return ColoredString('MAGENTA', string, always_color=always, bold=bold)
def cyan(string, always=False):
return ColoredString('CYAN', string, always_color=always)
def cyan(string, always=False, bold=False):
return ColoredString('CYAN', string, always_color=always, bold=bold)
def white(string, always=False):
return ColoredString('WHITE', string, always_color=always)
def white(string, always=False, bold=False):
return ColoredString('WHITE', string, always_color=always, bold=bold)
def disable():
"""Disables colors."""
+2 -2
View File
@@ -8,7 +8,7 @@ Module for simple interactive prompts handling
"""
from __future__ import absolute_import
from __future__ import absolute_import, print_function
from re import match, I
@@ -30,7 +30,7 @@ def yn(prompt, default='y', batch=False):
if not batch:
input = raw_input(prompt).strip()
else:
print prompt
print(prompt)
input = ''
# If input is empty default choice is assumed
-6
View File
@@ -11,8 +11,6 @@ except ImportError:
import clint
def publish():
"""Publish to PyPi"""
os.system("python setup.py sdist upload")
@@ -32,10 +30,6 @@ setup(
author='Kenneth Reitz',
author_email='me@kennethreitz.com',
url='https://github.com/kennethreitz/clint',
data_files=[
'README.rst',
'HISTORY.rst',
],
packages= [
'clint',
'clint.textui',